Opened 13 years ago

Closed 12 years ago

#846 closed enhancement (fixed)

Closed Captioning in mov

Reported by: dave rice Owned by:
Priority: wish Component: avformat
Version: git-master Keywords: mov cc
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description (last modified by Carl Eugen Hoyos)

My source video is here: http://www.capsubservices.com/files/Webcast%20--%20New%20Media%20Files/Test%20for%20Quicktime%20608%20CC%20file.mov

I'm testing copying all streams from the input to the output with -map 0 -c copy. The output plays ok in VLC, but when opened in QuickTime I get a 'An invalid public movie atom was found in the movie' error.

ffmpeg started on 2011-12-29 at 01:39:35
Report written to "ffmpeg-20111229-013935.log"
Command line:
ffmpeg -y -report -i "Test for Quicktime 608 CC file.mov" -map 0 -c: copy out.mov
ffmpeg version N-32546-g6071e4d, Copyright (c) 2000-2011 the FFmpeg developers
  built on Dec 28 2011 21:57:53 with gcc 4.2.1 (Apple Inc. build 5666) (dot 3)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-libopenjpeg --cc=/usr/bin/gcc-4.2 --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libfreetype
  libavutil      51. 33.100 / 51. 33.100
  libavcodec     53. 49.100 / 53. 49.100
  libavformat    53. 29.100 / 53. 29.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 55.100 /  2. 55.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  5.100 /  0.  5.100
  libpostproc    51.  2.100 / 51.  2.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fd1b8826e00] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fd1b8826e00] ISO: File Type Major Brand: qt  
[h264 @ 0x7fd1b882f400] err{or,}_recognition separate: 1; 1
[h264 @ 0x7fd1b882f400] err{or,}_recognition combined: 1; 10001
[aac @ 0x7fd1b8840c00] err{or,}_recognition separate: 1; 1
[aac @ 0x7fd1b8840c00] err{or,}_recognition combined: 1; 10001
[aac @ 0x7fd1b8840c00] Unsupported bit depth: 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fd1b8826e00] max_analyze_duration 5000000 reached at 5015510

Seems stream 0 codec frame rate differs from container frame rate: 5994.00 (5994/1) -> 29.97 (2997/100)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Test for Quicktime 608 CC file.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2010-11-04 17:28:46
  Duration: 00:00:28.39, start: 0.000000, bitrate: 1603 kb/s
    Stream #0:0(eng), 135, 1/2997: Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360, 1485 kb/s, 29.97 fps, 29.97 tbr, 2997 tbn, 5994 tbc
    Metadata:
      creation_time   : 2010-11-04 17:28:46
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng), 218, 1/44100: Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 109 kb/s
    Metadata:
      creation_time   : 2010-11-04 17:28:46
      handler_name    : Apple Alias Data Handler
    Stream #0:2(eng), 122, 1/2997: Subtitle: none (c608 / 0x38303663)
    Metadata:
      creation_time   : 2010-11-04 17:28:46
      handler_name    : Apple Alias Data Handler
Output #0, mov, to 'out.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2010-11-04 17:28:46
    encoder         : Lavf53.29.100
    Stream #0:0(eng), 0, 1/2997: Video: h264 (avc1 / 0x31637661), yuv420p, 640x360, q=2-31, 1485 kb/s, 29.97 fps, 2997 tbn, 2997 tbc
    Metadata:
      creation_time   : 2010-11-04 17:28:46
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng), 0, 1/44100: Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, 109 kb/s
    Metadata:
      creation_time   : 2010-11-04 17:28:46
      handler_name    : Apple Alias Data Handler
    Stream #0:2(eng), 0, 1/2997: Subtitle: none (c608 / 0x38303663)
    Metadata:
      creation_time   : 2010-11-04 17:28:46
      handler_name    : Apple Alias Data Handler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
  Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
frame=  851 fps=  0 q=-1.0 Lsize=    5571kB time=00:00:27.62 bitrate=1651.8kbits/s    
video:5147kB audio:379kB global headers:0kB muxing overhead 0.808748%

Change History (5)

comment:1 by Carl Eugen Hoyos, 13 years ago

Description: modified (diff)
Keywords: mov cc added

Isn't this a feature request for reading CC in mov?
I may be wrong but I suspect that writing unknown codecs to mov is not guaranteed to work.

Or is the problem also reproducible with -sn (or not reproducible with -acodec aac -vcodec mpeg4 -scodec copy)?

comment:2 by dave rice, 13 years ago

Then perhaps two requests.

  1. bug, FFmpeg produces a QuickTime file with invalid public movie atom
  2. request, FFmpeg support reading or copying c608 subtitle tracks.

With "-map 0 -sn -c: copy" the output file works fine in QuickTime though though without the subtitle/caption track.
With "-map 0 -c:a aac -c:v mpeg4 -c:s copy" I get similar results to my initial output and the same invalid atom error.

ffmpeg started on 2011-12-29 at 19:35:21
Report written to "ffmpeg-20111229-193521.log"
Command line:
ffmpeg -y -report -i "Test for Quicktime 608 CC file.mov" -map 0 -c:a libfaac -c:v mpeg4 -c:s copy out.mov
ffmpeg version N-32546-g6071e4d, Copyright (c) 2000-2011 the FFmpeg developers
  built on Dec 28 2011 21:57:53 with gcc 4.2.1 (Apple Inc. build 5666) (dot 3)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-libopenjpeg --cc=/usr/bin/gcc-4.2 --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libfreetype
  libavutil      51. 33.100 / 51. 33.100
  libavcodec     53. 49.100 / 53. 49.100
  libavformat    53. 29.100 / 53. 29.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 55.100 /  2. 55.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  5.100 /  0.  5.100
  libpostproc    51.  2.100 / 51.  2.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9661826e00] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9661826e00] ISO: File Type Major Brand: qt  
[h264 @ 0x7f966182f400] err{or,}_recognition separate: 1; 1
[h264 @ 0x7f966182f400] err{or,}_recognition combined: 1; 10001
[aac @ 0x7f9661840c00] err{or,}_recognition separate: 1; 1
[aac @ 0x7f9661840c00] err{or,}_recognition combined: 1; 10001
[aac @ 0x7f9661840c00] Unsupported bit depth: 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9661826e00] max_analyze_duration 5000000 reached at 5015510

Seems stream 0 codec frame rate differs from container frame rate: 5994.00 (5994/1) -> 29.97 (2997/100)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Test for Quicktime 608 CC file.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2010-11-04 17:28:46
  Duration: 00:00:28.39, start: 0.000000, bitrate: 1603 kb/s
    Stream #0:0(eng), 135, 1/2997: Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360, 1485 kb/s, 29.97 fps, 29.97 tbr, 2997 tbn, 5994 tbc
    Metadata:
      creation_time   : 2010-11-04 17:28:46
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng), 218, 1/44100: Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 109 kb/s
    Metadata:
      creation_time   : 2010-11-04 17:28:46
      handler_name    : Apple Alias Data Handler
    Stream #0:2(eng), 122, 1/2997: Subtitle: none (c608 / 0x38303663)
    Metadata:
      creation_time   : 2010-11-04 17:28:46
      handler_name    : Apple Alias Data Handler
[buffer @ 0x7f9661415ec0] w:640 h:360 pixfmt:yuv420p tb:1/1000000 sar:0/1 sws_param:
[mpeg4 @ 0x7f966182c400] err{or,}_recognition separate: 1; 1
[mpeg4 @ 0x7f966182c400] err{or,}_recognition combined: 1; 10001
[mpeg4 @ 0x7f966182c400] intra_quant_bias = 0 inter_quant_bias = -64
[libfaac @ 0x7f966183e400] err{or,}_recognition separate: 1; 1
[libfaac @ 0x7f966183e400] err{or,}_recognition combined: 1; 10001
[h264 @ 0x7f966182f400] err{or,}_recognition separate: 1; 10001
[h264 @ 0x7f966182f400] err{or,}_recognition combined: 1; 10001
[aac @ 0x7f9661840c00] err{or,}_recognition separate: 1; 10001
[aac @ 0x7f9661840c00] err{or,}_recognition combined: 1; 10001
[aac @ 0x7f9661840c00] Unsupported bit depth: 0
Output #0, mov, to 'out.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2010-11-04 17:28:46
    encoder         : Lavf53.29.100
    Stream #0:0(eng), 0, 1/2997: Video: mpeg4 (mp4v / 0x7634706D), yuv420p, 640x360, q=2-31, 200 kb/s, 2997 tbn, 29.97 tbc
    Metadata:
      creation_time   : 2010-11-04 17:28:46
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng), 0, 1/44100: Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 128 kb/s
    Metadata:
      creation_time   : 2010-11-04 17:28:46
      handler_name    : Apple Alias Data Handler
    Stream #0:2(eng), 0, 1/2997: Subtitle: none (c608 / 0x38303663)
    Metadata:
      creation_time   : 2010-11-04 17:28:46
      handler_name    : Apple Alias Data Handler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mpeg4)
  Stream #0:1 -> #0:1 (aac -> libfaac)
  Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
frame=  135 fps=  0 q=12.4 size=     276kB time=00:00:04.07 bitrate= 555.8kbits/s    
frame=  277 fps=276 q=17.8 size=     513kB time=00:00:08.97 bitrate= 468.6kbits/s    
frame=  405 fps=270 q=14.0 size=     707kB time=00:00:13.41 bitrate= 432.0kbits/s    
frame=  555 fps=277 q=17.3 size=     902kB time=00:00:18.08 bitrate= 408.4kbits/s    
frame=  684 fps=273 q=20.0 size=    1076kB time=00:00:22.48 bitrate= 392.0kbits/s    
frame=  826 fps=275 q=22.5 size=    1268kB time=00:00:27.46 bitrate= 378.3kbits/s    
frame=  851 fps=275 q=31.0 Lsize=    1347kB time=00:00:27.62 bitrate= 399.5kbits/s    
video:967kB audio:335kB global headers:0kB muxing overhead 3.450898%

comment:3 by Carl Eugen Hoyos, 13 years ago

Priority: normalwish
Reproduced by developer: set
Status: newopen
Summary: 'invalid public movie atom' when copying streams into a QuickTime fileClosed Captioning in mov
Type: defectenhancement

comment:4 by reimar, 12 years ago

Seems I forgot to update this. Recognizing and demuxer CC data in Quicktime is supported (as can be verified with e.g. MPlayer), however neither decoding it (e.g. into text) nor muxing it into anything at all is implemented yet.

comment:5 by Carl Eugen Hoyos, 12 years ago

Component: undeterminedavformat
Resolution: fixed
Status: openclosed

Remuxing CC is now supported (interestingly, it improves / fixes the timing with MPlayer) as is playback with MPlayer.

Note: See TracTickets for help on using tickets.