Closed Captions for zone 1 DVD

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Closed Captions for zone 1 DVD

PPRJ01
Hi All,

I don't understand why neither ffmpeg nor ffprobe detect presence of closed captions within MP4/H.264 in some video streams when VLC does.

Let me explain this... In the past 20 years, I have been working in several countries over the world and I bought official DVDs. Not duplicates ;-) I ripped them first to VOB and recently converted them to MP4/H.264 with ffmpeg without using the "-a53cc" option.

Reminder : when running ffmpeg and ffprobe, a few lines are written first to stderr. The words "Closed Captions", when present, indicate that the video stream contains closed captions.

==> The point is that ffmpeg/ffprobe do not show closed captions existence for MP4/H.264 files that come from ZONE 1 DVDs but VLC does and displays them.

==> Conversely, for zone 2 DVD, ffmpeg/ffprobe work properly.

==> Do you know why this happens ???

I am currently using a Windows 10 version of ffmpeg/ffprobe. Please see the details below with a DVD, bought in zone 1, that contains closed captions.

 

Best rgds


________________________________________

ffprobe version 4.1 Copyright (c) 2007-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181017
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2005_Executive decision_2h08m35_en.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : Executive decision
    encoder         : Lavf58.20.100
  Duration: 02:08:35.08, start: 0.000000, bitrate: 1813 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x480 [SAR 32:27 DAR 16:9], 1538 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Stream #0:2(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      handler_name    : SoundHandler
    Stream #0:3(spa): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 720x480, 2 kb/s (default)
    Metadata:
      handler_name    : SubtitleHandler
    Stream #0:4(spa): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 720x480, 2 kb/s
    Metadata:
      handler_name    : SubtitleHandler
    Stream #0:5(fre): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 720x480, 1 kb/s
    Metadata:
      handler_name    : SubtitleHandler
    Stream #0:6(fre): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 720x480, 1 kb/s
    Metadata:
      handler_name    : SubtitleHandler
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Closed Captions for zone 1 DVD

Carl Eugen Hoyos-2
Am Di., 5. Mai 2020 um 17:41 Uhr schrieb PPRJ01 <[hidden email]>:

> I don't understand why neither ffmpeg nor ffprobe detect presence of closed captions within MP4/H.264 in some video streams when VLC does.
>
> Let me explain this... In the past 20 years, I have been working in several countries over the world and I bought official DVDs. Not duplicates ;-) I ripped them first to VOB and recently converted them to MP4/H.264 with ffmpeg without using the "-a53cc" option.
>
> Reminder : when running ffmpeg and ffprobe, a few lines are written first to stderr. The words "Closed Captions", when present, indicate that the video stream contains closed captions.
>
> ==> The point is that ffmpeg/ffprobe do not show closed captions existence for MP4/H.264 files that come from ZONE 1 DVDs but VLC does and displays them.
>
> ==> Conversely, for zone 2 DVD, ffmpeg/ffprobe work properly.
>
> ==> Do you know why this happens ???
>
> I am currently using a Windows 10 version of ffmpeg/ffprobe. Please see the details below with a DVD, bought in zone 1, that contains closed captions.

> ________________________________________
>
> ffprobe version 4.1 Copyright (c) 2007-2018 the FFmpeg developers

Please test current FFmpeg git head before reporting issues on this
mailing list.

For future questions: Please understand that your subject is maximally
misleading, please try to improve...

Finally: Please confirm that this happens for files where the first closed
captions appear later in the stream and retry with (very) large values
for -analyzeduration and -probesize.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Closed Captions for zone 1 DVD

PPRJ01
Thank you Carl Eugen,

I tried adding large values with options "-analyzeduration" and "probesize" but this does NOT work for Closed Captions even if it works properly for regular subtitle streams.

Please understand that I am not a beginner. I have a 45 years background in IT support for several companies of more than 100,000 employees all over the world.

Have in mind that many people are not developpers and need simple answers to simple questions.

Again : is there any special codification of Closed Caption for US DVDs ?

Rgds

 

> Message du 05/05/20 18:30
> De : "Carl Eugen Hoyos"
> A : "FFmpeg user questions"
> Copie à :
> Objet : Re: [FFmpeg-user] Closed Captions for zone 1 DVD
>
> Am Di., 5. Mai 2020 um 17:41 Uhr schrieb PPRJ01
: > I don't understand why neither ffmpeg nor ffprobe detect presence of closed captions within MP4/H.264 in some video streams when VLC does. > > Let me explain this... In the past 20 years, I have been working in several countries over the world and I bought official DVDs. Not duplicates ;-) I ripped them first to VOB and recently converted them to MP4/H.264 with ffmpeg without using the "-a53cc" option. > > Reminder : when running ffmpeg and ffprobe, a few lines are written first to stderr. The words "Closed Captions", when present, indicate that the video stream contains closed captions. > > ==> The point is that ffmpeg/ffprobe do not show closed captions existence for MP4/H.264 files that come from ZONE 1 DVDs but VLC does and displays them. > > ==> Conversely, for zone 2 DVD, ffmpeg/ffprobe work properly. > > ==> Do you know why this happens ??? > > I am currently using a Windows 10 version of ffmpeg/ffprobe. Please see the details below with a DVD, bought in zone 1, that contains closed captions. > ________________________________________ > > ffprobe version 4.1 Copyright (c) 2007-2018 the FFmpeg developers Please test current FFmpeg git head before reporting issues on this mailing list. For future questions: Please understand that your subject is maximally misleading, please try to improve... Finally: Please confirm that this happens for files where the first closed captions appear later in the stream and retry with (very) large values for -analyzeduration and -probesize. Carl Eugen _______________________________________________ ffmpeg-user mailing list [hidden email] https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Closed Captions for zone 1 DVD

Carl Eugen Hoyos-2
Am Di., 5. Mai 2020 um 23:12 Uhr schrieb PPRJ01 <[hidden email]>:

> I tried adding large values with options "-analyzeduration" and
> "probesize" but this does NOT work for Closed Captions even
> if it works properly for regular subtitle streams.

> Please understand that I am not a beginner.

Very bad try.

Please provide a sample, Carl Eugen

And please consider using a sane mail client...
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Closed Captions for zone 1 DVD

PPRJ01
In reply to this post by PPRJ01
Hello Carl Eugen,

Please find attached a short sample file named "2005.mp4". This is the result of command :

ffmpeg -ss 99 -to 103 -i 2005.VOB 2005.mp4

Additional information can be :
- ffprobe says that file 2005.VOB contains Closed Captions
- ffprobe says that file 2005.mp4 does NOT contain Closed Captions
- VLC software fully displays all Closed Captions from both files 2005.VOB and 2005.mp4

In my understanding ffmpeg does copy the Closed Captions to the output video stream itself but do not set any metadata tag in the output file.

The output of the "ffmpeg -ss 99 -to 103 -i 2005.VOB 2005.mp4" command is below.
 
Rgds
______

Input #0, mpeg, from '2005.VOB':
  Duration: 02:12:51.14, start: 0.028833, bitrate: 4568 kb/s
    Stream #0:0[0x1bf]: Data: dvd_nav_packet
    Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, progressive), 720x480 [SAR 32:27 DAR 16:9], Closed Captions, 29.08 fps, 59.94 tbr, 90k tbn, 59.94 tbc
    Stream #0:2[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (mpeg2video (native) -> h264 (libx264))
  Stream #0:2 -> #0:1 (ac3 (native) -> aac (native))
Press [q] to stop, [?] for help
[ac3 @ 0000022d59f5ccc0] frame sync error
Error while decoding stream #0:2: Invalid data found when processing input
[aac @ 0000022d59fc5680] Using a PCE to encode channel layout "5.1(side)"
[libx264 @ 0000022d5a4c1040] using SAR=32/27
[libx264 @ 0000022d5a4c1040] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0000022d5a4c1040] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 0000022d5a4c1040] 264 - core 157 r2935 545de2f - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '2005.mp4':
  Metadata:
    encoder         : Lavf58.20.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 720x480 [SAR 32:27 DAR 16:9], q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc58.35.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1(side), fltp, 394 kb/s
    Metadata:
      encoder         : Lavc58.35.100 aac
frame=   51 fps=0.0 q=29.0 size=       0kB time=00:00:01.64 bitrate=   0.2kbits/s dup=10 drop=0 speed=3.22x   
frame=   65 fps= 52 q=29.0 size=       0kB time=00:00:02.13 bitrate=   0.2kbits/s dup=13 drop=0 speed= 1.7x   
frame=   83 fps= 47 q=29.0 size=       0kB time=00:00:02.70 bitrate=   0.1kbits/s dup=16 drop=0 speed=1.53x   
frame=   96 fps= 42 q=29.0 size=       0kB time=00:00:03.15 bitrate=   0.1kbits/s dup=19 drop=0 speed=1.39x   
frame=  120 fps= 43 q=29.0 size=     256kB time=00:00:03.94 bitrate= 531.5kbits/s dup=24 drop=0 speed= 1.4x   
frame=  121 fps= 30 q=-1.0 Lsize=     431kB time=00:00:04.01 bitrate= 881.3kbits/s dup=24 drop=0 speed=1.01x   
video:232kB audio:194kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.338844%
[libx264 @ 0000022d5a4c1040] frame I:1     Avg QP:20.52  size: 29187
[libx264 @ 0000022d5a4c1040] frame P:32    Avg QP:21.69  size:  5208
[libx264 @ 0000022d5a4c1040] frame B:88    Avg QP:23.81  size:   467
[libx264 @ 0000022d5a4c1040] consecutive B-frames:  0.8%  5.0%  5.0% 89.3%
[libx264 @ 0000022d5a4c1040] mb I  I16..4: 18.2% 71.7% 10.1%
[libx264 @ 0000022d5a4c1040] mb P  I16..4:  0.4%  0.5%  0.0%  P16..4: 29.5%  7.9%  7.6%  0.0%  0.0%    skip:54.1%
[libx264 @ 0000022d5a4c1040] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8: 21.0%  0.5%  0.1%  direct: 0.4%  skip:77.8%  L0:40.0% L1:55.7% BI: 4.4%
[libx264 @ 0000022d5a4c1040] 8x8 transform intra:67.2% inter:77.3%
[libx264 @ 0000022d5a4c1040] coded y,uvDC,uvAC intra: 54.8% 61.3% 33.9% inter: 5.6% 7.3% 1.0%
[libx264 @ 0000022d5a4c1040] i16 v,h,dc,p: 43% 38% 13%  6%
[libx264 @ 0000022d5a4c1040] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 24% 30%  3%  2%  5%  3%  5%  8%
[libx264 @ 0000022d5a4c1040] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 23% 15%  4%  4%  6%  5%  5%  8%
[libx264 @ 0000022d5a4c1040] i8c dc,h,v,p: 52% 26% 18%  5%
[libx264 @ 0000022d5a4c1040] Weighted P-Frames: Y:3.1% UV:0.0%
[libx264 @ 0000022d5a4c1040] ref P L0: 54.8% 11.9% 23.1%  9.9%  0.2%
[libx264 @ 0000022d5a4c1040] ref B L0: 76.2% 17.9%  5.9%
[libx264 @ 0000022d5a4c1040] ref B L1: 92.6%  7.4%
[libx264 @ 0000022d5a4c1040] kb/s:469.54
[aac @ 0000022d59fc5680] Qavg: 189.273


____________________________________________________________
 
Am Di., 5. Mai 2020 um 23:12 Uhr schrieb PPRJ01
:

> I tried adding large values with options "-analyzeduration" and
> "probesize" but this does NOT work for Closed Captions even
> if it works properly for regular subtitle streams.

> Please understand that I am not a beginner.

Very bad try.

Please provide a sample, Carl Eugen

And please consider using a sane mail client...
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
 

 

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

2005.mp4 (590K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Closed Captions for zone 1 DVD

Carl Eugen Hoyos-2



> Am 08.05.2020 um 22:28 schrieb PPRJ01 <[hidden email]>:
>
>
> Please find attached a short sample file named "2005.mp4". This is the result of command :
>
> ffmpeg -ss 99 -to 103 -i 2005.VOB 2005.mp4

Never provide output files (unless specifically requested), please provide an input sample that allows to reproduce.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Closed Captions for zone 1 DVD

PPRJ01
In reply to this post by PPRJ01
Hello Carl Eugen,

Please note that this case is now closed for me. I found this workaround :

    ffmpeg -t 180 -i INPUT.mp4 -c copy TMP.mp4
    ffmpeg -f lavfi -i "movie=TMP.mp4[out0+subcc]" -map s OUTPUT.srt -v warning

When there are no Closed Captions within the first 3 minutes of the video stream, ffmpeg displays a warning : Output file is empty ...

The drawback is that this is a very slow procedure.


Actually, my initial objective was to remove the Closed Captions from all my movies.

I finally found how to do it, in a fast and efficient way, even if the video stream does NOT contain CC :

    ffmpeg -i INPUT.mp4 -c copy -bsf:v filter_units=remove_types=6 OUTPUT.mp4

Thank you for your help

Best Rgds

 

Pascal

 

--------------------------------------------

Message du 08/05/20 22:54

De : "Carl Eugen Hoyos"

A : "FFmpeg user questions"

Copie à :

Objet : Re: [FFmpeg-user] Closed Captions for zone 1 DVD

 

 

> Am 08.05.2020 um 22:28 schrieb PPRJ01
:
>
>
> Please find attached a short sample file named "2005.mp4". This is the result of command :
>
> ffmpeg -ss 99 -to 103 -i 2005.VOB 2005.mp4

Never provide output files (unless specifically requested), please provide an input sample that allows to reproduce.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Closed Captions for zone 1 DVD

Carl Eugen Hoyos-2
Am Di., 12. Mai 2020 um 13:16 Uhr schrieb PPRJ01 <[hidden email]>:

> Actually, my initial objective was to remove the Closed Captions from all my movies.

Isn't this easiest with "-a53cc 0", since you are re-encoding
somewhere in your pipeline?

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".