Allow rendering subtitles besides simply adding a subtitle stream (was: Feature request "-f bestsubtitle") #7928

Open
opened 2026-02-21 02:58:43 -05:00 by deekerman · 24 comments
Owner

Originally created by @KaiserKatze on GitHub (Jun 1, 2016).

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 that [x])
  • Use Preview tab to see how your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2016.05.30.2. 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 2016.05.30.2

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably 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 -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

$ youtube-dl -v <your command line>
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj']
[debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251
[debug] youtube-dl version 2016.05.30.2
[debug] Python version 2.7.11 - Windows-2003Server-5.2.3790-SP2
[debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4
[debug] Proxy map: {}
...
<end of log>

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):


Description of your issue, suggested solution and other information

there are already -f parameters bestvideo and bestaudio but i wonder why there is no bestsub or bestsubtitle to help burn subtitles into video files
For example:

-f "bestvideo[ext=mp4]+bestaudio[ext=m4a]+bestsubtitle[ext=vtt]/best"

will burn both best audio and best subtitle into the mp4 file.

  • --write-auto-sub option should be automatically used if bestsubtitle is invoked but no subtitle is available
  • if bestsubtitle is invoked without bestvideo and bestaudio, download best subtitle only
Originally created by @KaiserKatze on GitHub (Jun 1, 2016). ## 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 that [x]) - Use _Preview_ tab to see how your issue will actually look like --- ### Make sure you are using the _latest_ version: run `youtube-dl --version` and ensure your version is _2016.05.30.2_. If it's not read [this FAQ entry](https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl) and update. Issues with outdated version will be rejected. - [x] I've **verified** and **I assure** that I'm running youtube-dl **2016.05.30.2** ### Before submitting an _issue_ make sure you have: - [x] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections - [ ] [Searched](https://github.com/rg3/youtube-dl/search?type=Issues) 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) - [x] 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 `-v` flag to **your command line** you run youtube-dl with, copy the **whole** output and insert it here. It should look similar to one below (replace it with **your** log inserted between triple ```): ``` $ youtube-dl -v <your command line> [debug] System config: [] [debug] User config: [] [debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj'] [debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251 [debug] youtube-dl version 2016.05.30.2 [debug] Python version 2.7.11 - Windows-2003Server-5.2.3790-SP2 [debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4 [debug] Proxy map: {} ... <end of log> ``` --- ### 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**): - Single video: https://www.youtube.com/watch?v=BaW_jenozKc - Single video: https://youtu.be/BaW_jenozKc - Playlist: https://www.youtube.com/playlist?list=PL4lCao7KL_QFVb7Iudeipvc2BCavECqzc --- ### Description of your _issue_, suggested solution and other information there are already `-f` parameters `bestvideo` and `bestaudio` but i wonder why there is no `bestsub` or `bestsubtitle` to help burn subtitles into video files For example: ``` bash -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]+bestsubtitle[ext=vtt]/best" ``` will burn both best audio and best subtitle into the mp4 file. - `--write-auto-sub` option should be automatically used if `bestsubtitle` is invoked but no subtitle is available - if `bestsubtitle` is invoked without `bestvideo` and `bestaudio`, download best subtitle only
Author
Owner

@yan12125 commented on GitHub (Jun 1, 2016):

How to determine the "best" one among several subtitles?

@yan12125 commented on GitHub (Jun 1, 2016): How to determine the "best" one among several subtitles?
Author
Owner

@KaiserKatze commented on GitHub (Jun 1, 2016):

bestsubtitle[ext=vtt] is an arbitrary available subtitle file that is .vtt but not an automatically generated subtitle, if not available just use generated one.

How to burn subtitles into video

https://trac.ffmpeg.org/wiki/HowToBurnSubtitlesIntoVideo

@KaiserKatze commented on GitHub (Jun 1, 2016): `bestsubtitle[ext=vtt]` is an arbitrary available subtitle file that is .vtt but not an automatically generated subtitle, if not available just use generated one. #### How to burn subtitles into video https://trac.ffmpeg.org/wiki/HowToBurnSubtitlesIntoVideo
Author
Owner

@vxbinaca commented on GitHub (Jun 1, 2016):

@yan12125 nails it with his comment.

Why is VTT better than SRT? VTT is nice for streaming sites, except for Archive.org which requires SRT.

Perhaps use --convert-subs "vtt" for uniform output?

@vxbinaca commented on GitHub (Jun 1, 2016): @yan12125 nails it with his comment. Why is VTT better than SRT? VTT is nice for streaming sites, except for Archive.org which requires SRT. Perhaps use `--convert-subs "vtt"` for uniform output?
Author
Owner

@yan12125 commented on GitHub (Jun 1, 2016):

There are more formats. Besides WebVTT and SRT, TTML, SMPTE-TT, SSA are also common. For videos and audios, bitrates, filesizes and resolutions are the three primary metrics. Are there comparable quantities for subtitles? It no, hard-coding order may also be acceptable.

How to burn subtitles into video

@donizyo FYI: this is already implemented via --embed-subs.

@yan12125 commented on GitHub (Jun 1, 2016): There are more formats. Besides WebVTT and SRT, TTML, SMPTE-TT, SSA are also common. For videos and audios, bitrates, filesizes and resolutions are the three primary metrics. Are there comparable quantities for subtitles? It no, hard-coding order may also be acceptable. > How to burn subtitles into video @donizyo FYI: this is already implemented via `--embed-subs`.
Author
Owner

@KaiserKatze commented on GitHub (Jun 1, 2016):

but what about the feature download subtitle only?

@KaiserKatze commented on GitHub (Jun 1, 2016): but what about the feature _**download subtitle only**_?
Author
Owner

@KaiserKatze commented on GitHub (Jun 1, 2016):

suppose i've downloaded a video and an audio and they are merged into a .mp4 file but i forgot to download auto generated subtitle

@KaiserKatze commented on GitHub (Jun 1, 2016): suppose i've downloaded a video and an audio and they are merged into a .mp4 file but i forgot to download auto generated subtitle
Author
Owner

@yan12125 commented on GitHub (Jun 1, 2016):

  1. youtube-dl also downloads subtitles if --write-sub given. To download subtitles only but not videos, add --skip-download.
  2. --embed-subs reads from existing files if there are files with the same name as the output of --write-sub.
@yan12125 commented on GitHub (Jun 1, 2016): 1. youtube-dl also downloads subtitles if `--write-sub` given. To download subtitles only but not videos, add `--skip-download`. 2. `--embed-subs` reads from existing files if there are files with the same name as the output of `--write-sub`.
Author
Owner

@KaiserKatze commented on GitHub (Jun 1, 2016):

just ran a test, youtube-dl failed to burn VTT subtitle into merged video file (:зゝ∠)

@KaiserKatze commented on GitHub (Jun 1, 2016): just ran a test, `youtube-dl` failed to burn VTT subtitle into merged video file _(:зゝ∠)_
Author
Owner

@yan12125 commented on GitHub (Jun 1, 2016):

Please post the output your command. Don't forget to add -v to your commands.

@yan12125 commented on GitHub (Jun 1, 2016): Please post the output your command. Don't forget to add `-v` to your commands.
Author
Owner

@KaiserKatze commented on GitHub (Jun 1, 2016):

$ ytdl --playlist-start 29 "https://www.youtube.com/playlist?list=PLjyuVPBuorqIhlqZtoIvnAVQ3x18sNev4"
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', '--proxy', 'http://127.0.0.1:8087/', '--socket-timeout', '1200', '--yes-playlist', '-o', '%(playlist_index)s.%(ext)s', '--user-agent', 'Mozilla/5.0 (Windows NT 6.0; rv:46.0) Gecko/20100101 Firefox/46.0', '--write-auto-sub', '--sub-format', '"srt/best"', '--embed-subs', '-f', 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best', '--recode-video', 'mp4', '--no-post-overwrites', '-k', '--playlist-start', '29', 'https://www.youtube.com/playlist?list=PLjyuVPBuorqIhlqZtoIvnAVQ3x18sNev4']
[debug] Encodings: locale cp936, fs mbcs, out cp936, pref cp936
[debug] youtube-dl version 2016.05.30.2
[debug] Python version 3.5.1 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-80123-gd74cc61, ffprobe N-80123-gd74cc61
[debug] Proxy map: {'http': 'http://127.0.0.1:8087/', 'https': 'http://127.0.0.1:8087/'}
[youtube:playlist] PLjyuVPBuorqIhlqZtoIvnAVQ3x18sNev4: Downloading webpage
[download] Downloading playlist: Blender Video Editing (2.7X series [Current Series])
[youtube:playlist] playlist Blender Video Editing (2.7X series [Current Series]): Downloading 1 videos
[download] Downloading video 1 of 1
[youtube] XPndVNEA1JQ: Downloading webpage
[youtube] XPndVNEA1JQ: Downloading video info webpage
[youtube] XPndVNEA1JQ: Extracting video information
[youtube] XPndVNEA1JQ: Looking for automatic captions
[youtube] XPndVNEA1JQ: Downloading MPD manifest
WARNING: No subtitle format found matching ""srt/best"" for language en, using vtt
[info] Writing video subtitles to: 29.en.vtt
[debug] Invoking downloader on 'https://r1---sn-i3b7kn7z.googlevideo.com/videoplayback?id=5cf9dd54d100d494&itag=137&source=youtube&requiressl=yes&nh=IgpwcjA0LmhrZzAxKgkxMjcuMC4wLjE&mv=u&ms=au&mn=sn-i3b7kn7z&mm=31&pl=17&ratebypass=yes&mime=video/mp4&gir=yes&clen=53360738&lmt=1449224937977359&dur=461.033&key=dg_yt0&fexp=9413138,9416126,9416891,9422596,9428398,9430794,9431012,9433096,9433380,9433457,9433946,9434086,9435527,9435850,9435876,9435922,9437027,9437067,9437255,9437553,9438051,9438244&sver=3&mt=1464807759&upn=lO_NJqBAe4I&signature=5C4D4A9A530173AFD1312373E346142F983AE774.3A1E92942C7DF0869D2642AEB5D72231FB6541E8&ip=171.88.98.161&ipbits=0&expire=1464830061&sparams=ip,ipbits,expire,id,itag,source,requiressl,nh,mv,ms,mn,mm,pl,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: 29.f137.mp4
[download] 100% of 50.89MiB in 00:42
[debug] Invoking downloader on 'https://r1---sn-i3b7kn7z.googlevideo.com/videoplayback?id=5cf9dd54d100d494&itag=140&source=youtube&requiressl=yes&nh=IgpwcjA0LmhrZzAxKgkxMjcuMC4wLjE&mv=u&ms=au&mn=sn-i3b7kn7z&mm=31&pl=17&ratebypass=yes&mime=audio/mp4&gir=yes&clen=7324094&lmt=1449224655848039&dur=461.101&key=dg_yt0&fexp=9413138,9416126,9416891,9422596,9428398,9430794,9431012,9433096,9433380,9433457,9433946,9434086,9435527,9435850,9435876,9435922,9437027,9437067,9437255,9437553,9438051,9438244&sver=3&mt=1464807759&upn=lO_NJqBAe4I&signature=9A38A0E15065F1936C3EB430BEAC74C55F12E4C7.2C91A12B3BFEC485AFDE60CB10DE8188B85FA947&ip=171.88.98.161&ipbits=0&expire=1464830061&sparams=ip,ipbits,expire,id,itag,source,requiressl,nh,mv,ms,mn,mm,pl,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: 29.f140.m4a
[download] 100% of 6.98MiB in 00:14
[ffmpeg] Merging formats into "29.mp4"
[debug] ffmpeg command line: ffmpeg -y -i file:29.f137.mp4 -i file:29.f140.m4a -c copy -map 0:v:0 -map 1:a:0 file:29.temp.mp4
[ffmpeg] Not converting video file 29.mp4 - already is in target format mp4
[ffmpeg] Embedding subtitles in '29.mp4'
[debug] ffmpeg command line: ffmpeg -y -i file:29.mp4 -i file:29.en.vtt -map 0 -c copy -map -0:s -c:s mov_text -map 1:0 -metadata:s:s:0 language=eng file:29.temp.mp4
[download] Finished downloading playlist: Blender Video Editing (2.7X series [Current Series])
@KaiserKatze commented on GitHub (Jun 1, 2016): ``` bash $ ytdl --playlist-start 29 "https://www.youtube.com/playlist?list=PLjyuVPBuorqIhlqZtoIvnAVQ3x18sNev4" [debug] System config: [] [debug] User config: [] [debug] Command-line args: ['--verbose', '--proxy', 'http://127.0.0.1:8087/', '--socket-timeout', '1200', '--yes-playlist', '-o', '%(playlist_index)s.%(ext)s', '--user-agent', 'Mozilla/5.0 (Windows NT 6.0; rv:46.0) Gecko/20100101 Firefox/46.0', '--write-auto-sub', '--sub-format', '"srt/best"', '--embed-subs', '-f', 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best', '--recode-video', 'mp4', '--no-post-overwrites', '-k', '--playlist-start', '29', 'https://www.youtube.com/playlist?list=PLjyuVPBuorqIhlqZtoIvnAVQ3x18sNev4'] [debug] Encodings: locale cp936, fs mbcs, out cp936, pref cp936 [debug] youtube-dl version 2016.05.30.2 [debug] Python version 3.5.1 - Windows-7-6.1.7601-SP1 [debug] exe versions: ffmpeg N-80123-gd74cc61, ffprobe N-80123-gd74cc61 [debug] Proxy map: {'http': 'http://127.0.0.1:8087/', 'https': 'http://127.0.0.1:8087/'} [youtube:playlist] PLjyuVPBuorqIhlqZtoIvnAVQ3x18sNev4: Downloading webpage [download] Downloading playlist: Blender Video Editing (2.7X series [Current Series]) [youtube:playlist] playlist Blender Video Editing (2.7X series [Current Series]): Downloading 1 videos [download] Downloading video 1 of 1 [youtube] XPndVNEA1JQ: Downloading webpage [youtube] XPndVNEA1JQ: Downloading video info webpage [youtube] XPndVNEA1JQ: Extracting video information [youtube] XPndVNEA1JQ: Looking for automatic captions [youtube] XPndVNEA1JQ: Downloading MPD manifest WARNING: No subtitle format found matching ""srt/best"" for language en, using vtt [info] Writing video subtitles to: 29.en.vtt [debug] Invoking downloader on 'https://r1---sn-i3b7kn7z.googlevideo.com/videoplayback?id=5cf9dd54d100d494&itag=137&source=youtube&requiressl=yes&nh=IgpwcjA0LmhrZzAxKgkxMjcuMC4wLjE&mv=u&ms=au&mn=sn-i3b7kn7z&mm=31&pl=17&ratebypass=yes&mime=video/mp4&gir=yes&clen=53360738&lmt=1449224937977359&dur=461.033&key=dg_yt0&fexp=9413138,9416126,9416891,9422596,9428398,9430794,9431012,9433096,9433380,9433457,9433946,9434086,9435527,9435850,9435876,9435922,9437027,9437067,9437255,9437553,9438051,9438244&sver=3&mt=1464807759&upn=lO_NJqBAe4I&signature=5C4D4A9A530173AFD1312373E346142F983AE774.3A1E92942C7DF0869D2642AEB5D72231FB6541E8&ip=171.88.98.161&ipbits=0&expire=1464830061&sparams=ip,ipbits,expire,id,itag,source,requiressl,nh,mv,ms,mn,mm,pl,ratebypass,mime,gir,clen,lmt,dur' [download] Destination: 29.f137.mp4 [download] 100% of 50.89MiB in 00:42 [debug] Invoking downloader on 'https://r1---sn-i3b7kn7z.googlevideo.com/videoplayback?id=5cf9dd54d100d494&itag=140&source=youtube&requiressl=yes&nh=IgpwcjA0LmhrZzAxKgkxMjcuMC4wLjE&mv=u&ms=au&mn=sn-i3b7kn7z&mm=31&pl=17&ratebypass=yes&mime=audio/mp4&gir=yes&clen=7324094&lmt=1449224655848039&dur=461.101&key=dg_yt0&fexp=9413138,9416126,9416891,9422596,9428398,9430794,9431012,9433096,9433380,9433457,9433946,9434086,9435527,9435850,9435876,9435922,9437027,9437067,9437255,9437553,9438051,9438244&sver=3&mt=1464807759&upn=lO_NJqBAe4I&signature=9A38A0E15065F1936C3EB430BEAC74C55F12E4C7.2C91A12B3BFEC485AFDE60CB10DE8188B85FA947&ip=171.88.98.161&ipbits=0&expire=1464830061&sparams=ip,ipbits,expire,id,itag,source,requiressl,nh,mv,ms,mn,mm,pl,ratebypass,mime,gir,clen,lmt,dur' [download] Destination: 29.f140.m4a [download] 100% of 6.98MiB in 00:14 [ffmpeg] Merging formats into "29.mp4" [debug] ffmpeg command line: ffmpeg -y -i file:29.f137.mp4 -i file:29.f140.m4a -c copy -map 0:v:0 -map 1:a:0 file:29.temp.mp4 [ffmpeg] Not converting video file 29.mp4 - already is in target format mp4 [ffmpeg] Embedding subtitles in '29.mp4' [debug] ffmpeg command line: ffmpeg -y -i file:29.mp4 -i file:29.en.vtt -map 0 -c copy -map -0:s -c:s mov_text -map 1:0 -metadata:s:s:0 language=eng file:29.temp.mp4 [download] Finished downloading playlist: Blender Video Editing (2.7X series [Current Series]) ```
Author
Owner

@dstftw commented on GitHub (Jun 1, 2016):

According to log vtt is embedded just fine. Post the output of ffmpeg -i 29.mp4.

@dstftw commented on GitHub (Jun 1, 2016): According to log vtt is embedded just fine. Post the output of `ffmpeg -i 29.mp4`.
Author
Owner

@KaiserKatze commented on GitHub (Jun 1, 2016):

$ ffmpeg -i 29.mp4
ffmpeg version N-80123-gd74cc61 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 24.100 / 55. 24.100
  libavcodec     57. 43.100 / 57. 43.100
  libavformat    57. 37.101 / 57. 37.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 46.100 /  6. 46.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '29.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.37.101
  Duration: 00:07:44.98, start: 0.000000, bitrate: 1048 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 922 kb/s, 30 fps, 30 tbr, 90k tbn (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Stream #0:2(eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default)
    Metadata:
      handler_name    : SubtitleHandler
At least one output file must be specified
@KaiserKatze commented on GitHub (Jun 1, 2016): ``` bash $ ffmpeg -i 29.mp4 ffmpeg version N-80123-gd74cc61 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 5.3.0 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib libavutil 55. 24.100 / 55. 24.100 libavcodec 57. 43.100 / 57. 43.100 libavformat 57. 37.101 / 57. 37.101 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 46.100 / 6. 46.100 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '29.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf57.37.101 Duration: 00:07:44.98, start: 0.000000, bitrate: 1048 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 922 kb/s, 30 fps, 30 tbr, 90k tbn (default) Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default) Metadata: handler_name : SoundHandler Stream #0:2(eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default) Metadata: handler_name : SubtitleHandler At least one output file must be specified ```
Author
Owner

@dstftw commented on GitHub (Jun 1, 2016):

Stream #0:2(eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default)
Metadata:
handler_name : SubtitleHandler

@dstftw commented on GitHub (Jun 1, 2016): > Stream #0:2(eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default) > Metadata: > handler_name : SubtitleHandler
Author
Owner

@KaiserKatze commented on GitHub (Jun 1, 2016):

for now, i'm using my own burning function... (:зゝ∠)

function burn_subtitle
{
    # param1: video extension
    ext_vid=$1
    # param2: subtitle extension
    ext_sub=$2
    for file in *.$ext_vid; do
        idx=`expr index $file "."`;
        ((idx-=1));
        name=${file:0:$idx};
        file_sub=$name"."$ext_sub;
        file_out=$name"_out.mp4";
        echo "[BURN] Merge $file and $file_sub into $file_out ..."
        if [ ! -f $file_sub ]; then
            echo "[BURN] File $file_sub not found!"
            continue;
        fi
        ffmpeg -loglevel 0 -i $file -vf subtitles=$file_sub $file_out
    done
}
$ burn_subtitle "mp4" "vtt"
[BURN] Merge 29.mp4 and 29.vtt into 29_out.mp4 ...

$ ffmpeg -i 29_out.mp4
ffmpeg version N-80123-gd74cc61 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 24.100 / 55. 24.100
  libavcodec     57. 43.100 / 57. 43.100
  libavformat    57. 37.101 / 57. 37.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 46.100 /  6. 46.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '29_out.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.37.101
  Duration: 00:07:41.13, start: 0.000000, bitrate: 849 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 708 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 132 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
At least one output file must be specified

and it works fine

@KaiserKatze commented on GitHub (Jun 1, 2016): for now, i'm using my own burning function... _(:зゝ∠)_ ``` bash function burn_subtitle { # param1: video extension ext_vid=$1 # param2: subtitle extension ext_sub=$2 for file in *.$ext_vid; do idx=`expr index $file "."`; ((idx-=1)); name=${file:0:$idx}; file_sub=$name"."$ext_sub; file_out=$name"_out.mp4"; echo "[BURN] Merge $file and $file_sub into $file_out ..." if [ ! -f $file_sub ]; then echo "[BURN] File $file_sub not found!" continue; fi ffmpeg -loglevel 0 -i $file -vf subtitles=$file_sub $file_out done } ``` ``` $ burn_subtitle "mp4" "vtt" [BURN] Merge 29.mp4 and 29.vtt into 29_out.mp4 ... $ ffmpeg -i 29_out.mp4 ffmpeg version N-80123-gd74cc61 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 5.3.0 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib libavutil 55. 24.100 / 55. 24.100 libavcodec 57. 43.100 / 57. 43.100 libavformat 57. 37.101 / 57. 37.101 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 46.100 / 6. 46.100 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '29_out.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf57.37.101 Duration: 00:07:41.13, start: 0.000000, bitrate: 849 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 708 kb/s, 30 fps, 30 tbr, 15360 tbn (default) Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 132 kb/s (default) Metadata: handler_name : SoundHandler At least one output file must be specified ``` and it works fine
Author
Owner

@yan12125 commented on GitHub (Jun 1, 2016):

Please check against the file generated by youtube-dl but not your script.

@yan12125 commented on GitHub (Jun 1, 2016): Please check against the file generated by youtube-dl but not your script.
Author
Owner

@KaiserKatze commented on GitHub (Jun 1, 2016):

@yan12125
problematic output is generated by youtube-dl, my script is fine

@KaiserKatze commented on GitHub (Jun 1, 2016): @yan12125 problematic output is generated by youtube-dl, my script is fine
Author
Owner

@yan12125 commented on GitHub (Jun 2, 2016):

Could you point out the "problematic output"? Seems both youtube-dl and ffmpeg outputs are fine.

@yan12125 commented on GitHub (Jun 2, 2016): Could you point out the "problematic output"? Seems both youtube-dl and ffmpeg outputs are fine.
Author
Owner

@KaiserKatze commented on GitHub (Jun 2, 2016):

@yan12125
the part quoted by @dstftw is buggy
FULL

$ ffmpeg -i 29.mp4
ffmpeg version N-80123-gd74cc61 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 24.100 / 55. 24.100
  libavcodec     57. 43.100 / 57. 43.100
  libavformat    57. 37.101 / 57. 37.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 46.100 /  6. 46.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '29.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.37.101
  Duration: 00:07:44.98, start: 0.000000, bitrate: 1048 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 922 kb/s, 30 fps, 30 tbr, 90k tbn (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Stream #0:2(eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default)
    Metadata:
      handler_name    : SubtitleHandler
At least one output file must be specified

PART

Stream #0:2(eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default)
Metadata:
handler_name : SubtitleHandler

@KaiserKatze commented on GitHub (Jun 2, 2016): @yan12125 the part quoted by @dstftw is buggy FULL ``` bash $ ffmpeg -i 29.mp4 ffmpeg version N-80123-gd74cc61 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 5.3.0 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib libavutil 55. 24.100 / 55. 24.100 libavcodec 57. 43.100 / 57. 43.100 libavformat 57. 37.101 / 57. 37.101 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 46.100 / 6. 46.100 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '29.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf57.37.101 Duration: 00:07:44.98, start: 0.000000, bitrate: 1048 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 922 kb/s, 30 fps, 30 tbr, 90k tbn (default) Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default) Metadata: handler_name : SoundHandler Stream #0:2(eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default) Metadata: handler_name : SubtitleHandler At least one output file must be specified ``` PART > Stream #0:2(eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default) > Metadata: > handler_name : SubtitleHandler
Author
Owner

@yan12125 commented on GitHub (Jun 2, 2016):

The subtitle stream is for storing subtitles, and it can be parsed and played correctly with latest mpv. For example:
screenshot_2016-06-02_12-33-59
Which player are you using?

@yan12125 commented on GitHub (Jun 2, 2016): The subtitle stream is for storing subtitles, and it can be parsed and played correctly with latest mpv. For example: ![screenshot_2016-06-02_12-33-59](https://cloud.githubusercontent.com/assets/1937689/15734132/e5a75846-28be-11e6-90d8-a14024ad9182.png) Which player are you using?
Author
Owner

@KaiserKatze commented on GitHub (Jun 2, 2016):

VLC and windows media player won't work

@KaiserKatze commented on GitHub (Jun 2, 2016): VLC and windows media player won't work
Author
Owner

@KaiserKatze commented on GitHub (Jun 2, 2016):

@yan12125
did you delete VTT file in directory before you watch the video?

@KaiserKatze commented on GitHub (Jun 2, 2016): @yan12125 did you delete VTT file in directory before you watch the video?
Author
Owner

@yan12125 commented on GitHub (Jun 2, 2016):

did you delete VTT file in directory before you watch the video?

Yes.

VLC and windows media player won't work

Confirmed. VLC 2.2.3 can't recognize the embedded WebVTT subtitle. VLC nightly needed.

Windows Media Player...Is it really a functional media player? :D

To sum up: the current approach adds a subtitle stream. youtube-dl need some way to render the subtitle directly on the video. Is it what you want?

@yan12125 commented on GitHub (Jun 2, 2016): > did you delete VTT file in directory before you watch the video? Yes. > VLC and windows media player won't work Confirmed. VLC 2.2.3 can't recognize the embedded WebVTT subtitle. VLC nightly needed. Windows Media Player...Is it really a functional media player? :D To sum up: the current approach adds a subtitle stream. youtube-dl need some way to render the subtitle directly on the video. Is it what you want?
Author
Owner

@KaiserKatze commented on GitHub (Jun 2, 2016):

yep, i think i'm gonna render it with -vf subtitles=29.vtt instead of -i 29.vtt -c:v copy

@KaiserKatze commented on GitHub (Jun 2, 2016): yep, i think i'm gonna render it with `-vf subtitles=29.vtt` instead of `-i 29.vtt -c:v copy`
Author
Owner

@kitokirisaki commented on GitHub (Jun 17, 2016):

When will be implemented (Hardsubs)?

@kitokirisaki commented on GitHub (Jun 17, 2016): When will be implemented (Hardsubs)?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl#7928
No description provided.