Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
subtitles [2019/06/29 04:27]
beandog [Extract CC]
subtitles [2020/10/26 18:49] (current)
beandog [Detect CC]
Line 3: Line 3:
   * [[ffmpeg]]   * [[ffmpeg]]
  
 +** WARNING: ** ffmpeg automatically muxes the closed captioning in **with libx264** if it exists, and will not show up in the map output, meaning it cannot be disabled. Also, ''​mediainfo''​ may or may not display it, while other applications (mplayer, mpv, HandBrake) will. It can be disabled in encoding with ''​-a53cc 0''​ for libx264. Using ''​libx265''​ does not encode the CC at all.
 ==== Detect VobSub ==== ==== Detect VobSub ====
  
Line 36: Line 37:
  
 For DVDs, closed captioning streams are embedded in the video stream. For DVDs, closed captioning streams are embedded in the video stream.
 +
 +By default, ffmpeg will copy the Closed Captions. Even passing ''​-sn''​ will not disable them. They must be selected using lavfi and modified / ignored that way.
  
 The fastest way is to see if it has closed captioning is using ffprobe and looking for ''​Closed Captions''​ in the output: The fastest way is to see if it has closed captioning is using ffprobe and looking for ''​Closed Captions''​ in the output:
Line 100: Line 103:
 [/STREAM] [/STREAM]
 </​code>​ </​code>​
- 
  
 ==== Extract CC ==== ==== Extract CC ====
Line 114: Line 116:
 <​code>​ <​code>​
 dvd_copy -o dvd_copy.mpg dvd_copy -o dvd_copy.mpg
-ffmpeg -f lavfi -i move=dvd_copy.mpg[out+subcc] -map 0:s subtitles.srt+ffmpeg -f lavfi -i movie=dvd_copy.mpg[out+subcc] -map 0:s subtitles.srt
 </​code>​ </​code>​
  
Line 120: Line 122:
  
 <​code>​ <​code>​
-ffmpeg -f lavfi -i move=dvd_copy.mpg[out+subcc] -map 0:v -map 0:s video.mkv+ffmpeg -f lavfi -i movie=dvd_copy.mpg[out+subcc] -map 0:v -map 0:s video.mkv
 </​code>​ </​code>​
  
-==== Encode ​DVD with Closed Captioning ====+==== Encode with existing ​Closed Captioning ====
  
 Since ffmpeg can input from two sources at once, you can input the same source twice, encode the audio and video from one, split the closed captioning data from the other, and mux them into one file all at once. Since ffmpeg can input from two sources at once, you can input the same source twice, encode the audio and video from one, split the closed captioning data from the other, and mux them into one file all at once.
 +
 +This will work **on a file but not with piped input**
  
 <​code>​ <​code>​
-dvd_copy -o - | ffmpeg -i -f lavfi -i movie=pipe\\\\:0[out+subcc] -map 1:s dvd_copy.mkv +ffmpeg -i dvd_copy.mpg ​-f lavfi -i movie=dvd_copy.mpg[out+subcc] ​-map 0:v -map 0:a -map 1:sdvd_copy.mkv 
-</​code> ​+</​code>​
 ==== Default Subtitles ==== ==== Default Subtitles ====
  

Navigation