Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

youtube auto generated subtitle not time synced with audio on mp4 #14442

Closed
yunw3n opened this issue Oct 7, 2017 · 1 comment
Closed

youtube auto generated subtitle not time synced with audio on mp4 #14442

yunw3n opened this issue Oct 7, 2017 · 1 comment

Comments

@yunw3n
Copy link

@yunw3n yunw3n commented Oct 7, 2017

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like this: [x])
  • Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.10.07. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2017.10.07

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

# ---------- download the video at first time -----------------
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-f', u'best[ext=mp4]/best', u'--write-auto-sub', u'--sub-lang', u'en', u'--embed-subs', u'--embed-thumbnail', u'IgSuFYamZas']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.10.07
[debug] Python version 2.7.13 - Darwin-17.0.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 3.2.2, ffprobe 3.2.2
[debug] Proxy map: {'http': 'http://127.0.0.1:1087', 'https': 'http://127.0.0.1:1087'}
[youtube] IgSuFYamZas: Downloading webpage
[youtube] IgSuFYamZas: Downloading video info webpage
[youtube] IgSuFYamZas: Extracting video information
[youtube] IgSuFYamZas: Looking for automatic captions
[youtube] IgSuFYamZas: Downloading MPD manifest
[info] Writing video subtitles to: MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.en.vtt
[youtube] IgSuFYamZas: Downloading thumbnail ...
[youtube] IgSuFYamZas: Writing thumbnail to: MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.jpg
[debug] Invoking downloader on u'https://r6---sn-a5mlrn7d.googlevideo.com/videoplayback?signature=609DCE5736953E64B6A44DB63E4574C0A0E16AB4.417B54DA52F8C6B1E58FB3FA57027B80FB2F3FFE&expire=1507410218&ratebypass=yes&pl=23&mv=m&ei=yuzYWdmQJq2V_AP7_JvICA&ipbits=0&ms=au&mm=31&mime=video%2Fmp4&sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&mn=sn-a5mlrn7d&key=yt6&source=youtube&dur=2096.390&mt=1507388520&id=o-ALn7t6MEsiBQZBjQXMMxgVrlvxGdf2k-IqAGo4n1WtgZ&lmt=1486021188926210&itag=22&requiressl=yes&ip=107.191.58.237&initcwndbps=9013750'
[download] Destination: MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.mp4
[download] 100% of 100.07MiB in 03:43
[ffmpeg] Embedding subtitles in 'MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.mp4'
[debug] ffmpeg command line: ffmpeg -y -i 'file:MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.mp4' -i 'file:MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.en.vtt' -map 0 -c copy -map '-0:s' '-c:s' mov_text -map '1:0' '-metadata:s:s:0' 'language=eng' 'file:MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.temp.mp4'
Deleting original file MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.en.vtt (pass -k to keep)
[atomicparsley] Adding thumbnail to "MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.mp4"
[debug] AtomicParsley command line: AtomicParsley 'MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.mp4' --artwork 'MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.jpg' -o 'MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.temp.mp4'

# ---------- play with mpv, subtitle not synced -----------------
mpv MIT\ 6.S191\ Lecture\ 1\ -\ Intro\ to\ Deep\ Learning-IgSuFYamZas.mp4

# ---------- So I download it again with youtube-dl ---------------------

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-f', u'best[ext=mp4]/best', u'--write-auto-sub', u'--sub-lang', u'en', u'--embed-subs', u'--embed-thumbnail', u'IgSuFYamZas']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.10.07
[debug] Python version 2.7.13 - Darwin-17.0.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 3.2.2, ffprobe 3.2.2
[debug] Proxy map: {'http': 'http://127.0.0.1:1087', 'https': 'http://127.0.0.1:1087'}
[youtube] IgSuFYamZas: Downloading webpage
[youtube] IgSuFYamZas: Downloading video info webpage
[youtube] IgSuFYamZas: Extracting video information
[youtube] IgSuFYamZas: Looking for automatic captions
[youtube] IgSuFYamZas: Downloading MPD manifest
[info] Writing video subtitles to: MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.en.vtt
[youtube] IgSuFYamZas: Downloading thumbnail ...
[youtube] IgSuFYamZas: Writing thumbnail to: MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.jpg
[debug] Invoking downloader on u'https://r1---sn-a5mekn7y.googlevideo.com/videoplayback?mv=m&mt=1507388990&ms=au&id=o-AAQS_GbImsgX7nWQQvhZzyn6uoeWFgMbya5iP33nugn8&ei=ke7YWYa2Hor7-gPyiIeoDA&pl=23&source=youtube&expire=1507410673&dur=2096.390&ip=107.191.58.237&key=yt6&requiressl=yes&mn=sn-a5mekn7y&signature=AD183C60BE02D551DE4291D5FCEEFD22101C8617.3579F61EBADC2F7A97D41F2799713DC5CEC38F3C&sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&ipbits=0&ratebypass=yes&itag=22&initcwndbps=9410000&mm=31&mime=video%2Fmp4&lmt=1486021188926210'
[download] MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.mp4 has already been downloaded
[download] 100% of 101.32MiB
[ffmpeg] Embedding subtitles in 'MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.mp4'
[debug] ffmpeg command line: ffmpeg -y -i 'file:MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.mp4' -i 'file:MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.en.vtt' -map 0 -c copy -map '-0:s' '-c:s' mov_text -map '1:0' '-metadata:s:s:0' 'language=eng' 'file:MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.temp.mp4'
Deleting original file MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.en.vtt (pass -k to keep)
[atomicparsley] Adding thumbnail to "MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.mp4"
[debug] AtomicParsley command line: AtomicParsley 'MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.mp4' --artwork 'MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.jpg' -o 'MIT 6.S191 Lecture 1 - Intro to Deep Learning-IgSuFYamZas.temp.mp4'

# -------------- then, I play it with mpv and now the subtitle is synced, very weird ----------------------
mpv MIT\ 6.S191\ Lecture\ 1\ -\ Intro\ to\ Deep\ Learning-IgSuFYamZas.mp4

If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):

Note that youtube-dl does not support sites dedicated to copyright infringement. In order for site support request to be accepted all provided example URLs should not violate any copyrights.


Description of your issue, suggested solution and other information

Command:
youtube-dl -f 'best[ext=mp4]/best' --write-auto-sub --sub-lang en --embed-subs --embed-thumbnail IgSuFYamZas

After run this command, the video is downloaded successfully, but the subtitle embedded in video file which is automatic generated by Youtube is not time synced with audio. But, but, when I run the command again, it downloads the subtitle again, and skip the video download(video file exists), and embed the subtitle into video file again, and then the subtitle works well.

Really weird..guess there's some issue when merging subtitle file at first time.

Run the command below will reproduce the issue.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Oct 7, 2017

You can compare final and intermediate files if you believe Youtube serves you different files.

@dstftw dstftw closed this Oct 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.