Ticket #726 (open enhancement)

Opened 18 months ago

Last modified 6 months ago

support for copying SMPTE 436M caption tracks

Reported by: dericed Owned by:
Priority: wish Component: undetermined
Version: git-master Keywords: cc mxf
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

This is a part 2 to http://ffmpeg.org/trac/ffmpeg/ticket/682.

I'm working with media from XDCam discs which contain an MXF with mpeg2 video, 8 pcm audio tracks, and a caption track using SMPTE 436M. I just need to cut these files given an in point and duration and copy all tracks to a new file (using -map 0 -c copy).

For XDCam MXF files the caption track is not recognized:

[mxf @ 0x101893800] track 9: could not find essence container ul, codec not currently supported in container

and subsequently the copy fails with

Could not write header for output file #0 (incorrect codec parameters ?)

I need the preserve the captions but would also like to use ffmpeg to this task.

Full output (first 5MB of a sample attached):

ffmpeg -ss 300 -t 30 -i ELCO0378.mxf -map 0 -c copy trimmed.mxf
ffmpeg version N-31468-g31c55c5, Copyright (c) 2000-2011 the FFmpeg developers
  built on Dec  8 2011 08:46:52 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 --cc=/usr/bin/gcc-4.2 --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libxvid --disable-ffplay
  libavutil    51. 30. 0 / 51. 30. 0
  libavcodec   53. 41. 2 / 53. 41. 2
  libavformat  53. 24. 0 / 53. 24. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 51. 0 /  2. 51. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[mxf @ 0x10180f200] could not resolve sub descriptor strong ref
[mxf @ 0x10180f200] source track 11: stream 9, no descriptor found
Input #0, mxf, from 'ELCO0378.mxf':
  Duration: 00:28:50.89, start: 0.000000, bitrate: 60317 kb/s
    Stream #0:0: Video: mpeg2video (4:2:2), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], 50000 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 59.94 tbc
    Stream #0:1: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
    Stream #0:2: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
    Stream #0:3: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
    Stream #0:4: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
    Stream #0:5: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
    Stream #0:6: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
    Stream #0:7: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
    Stream #0:8: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
    Stream #0:9: Data: none
[mxf @ 0x101893800] track 9: could not find essence container ul, codec not currently supported in container
Output #0, mxf, to 'trimmed.mxf':
  Metadata:
    encoder         : Lavf53.24.0
    Stream #0:0: Video: mpeg2video, yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 50000 kb/s, 29.97 fps, 29.97 tbn, 29.97 tbc
    Stream #0:1: Audio: pcm_s24le, 48000 Hz, 1 channels, 1152 kb/s
    Stream #0:2: Audio: pcm_s24le, 48000 Hz, 1 channels, 1152 kb/s
    Stream #0:3: Audio: pcm_s24le, 48000 Hz, 1 channels, 1152 kb/s
    Stream #0:4: Audio: pcm_s24le, 48000 Hz, 1 channels, 1152 kb/s
    Stream #0:5: Audio: pcm_s24le, 48000 Hz, 1 channels, 1152 kb/s
    Stream #0:6: Audio: pcm_s24le, 48000 Hz, 1 channels, 1152 kb/s
    Stream #0:7: Audio: pcm_s24le, 48000 Hz, 1 channels, 1152 kb/s
    Stream #0:8: Audio: pcm_s24le, 48000 Hz, 1 channels, 1152 kb/s
    Stream #0:9: Data: none
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
  Stream #0:2 -> #0:2 (copy)
  Stream #0:3 -> #0:3 (copy)
  Stream #0:4 -> #0:4 (copy)
  Stream #0:5 -> #0:5 (copy)
  Stream #0:6 -> #0:6 (copy)
  Stream #0:7 -> #0:7 (copy)
  Stream #0:8 -> #0:8 (copy)
  Stream #0:9 -> #0:9 (copy)
Could not write header for output file #0 (incorrect codec parameters ?)

Attachments

AALE0021_first2_5MB.mxf Download (2.4 MB) - added by dericed 18 months ago.
first 2.5 MB of an MXF file with SMPTE 436M caption track
_0002-G17010201.Stream Download (2.2 MB) - added by dericed 18 months ago.
extract of smpte 436M vbi caption track extracted from an XDCam disc's MXF with mxfsplit

Change History

Changed 18 months ago by dericed

first 2.5 MB of an MXF file with SMPTE 436M caption track

comment:1 Changed 18 months ago by cehoyos

Isn't this first of all a request to be able to read the caption track?

comment:2 Changed 18 months ago by dericed

Sure. Reading captions via ffmpeg would be ideal. I assume that having a smpte 436m encoder/decoder would be a lot of work. At this time I only have a use case for copying 436m captions from one MXF to another MXF, which I hope is a simpler request. :)

comment:3 Changed 18 months ago by reimar

To support this we would at least have to know what format that is, to at least give it the correct name.
Your sample does not contain enough data to figure out much, except that it is not the VBI format that e.g. MXFLib supports.

Changed 18 months ago by dericed

extract of smpte 436M vbi caption track extracted from an XDCam disc's MXF with mxfsplit

comment:4 Changed 18 months ago by dericed

I realized that the MXF sample I sent was too short to contain the caption track. I just attached an extract of the caption track extracted with mxfsplit. You'll see the textual part of the caption start at 0x46D9E. This sample uses 92 bytes per frame.

comment:5 Changed 17 months ago by dericed

I uploaded a full sample file to  http://www.archive.org/download/xdcam_sample_with_caption_track/C0001.MXF.

ffmpeg started on 2011-12-20 at 11:40:58
Report written to "ffmpeg-20111220-114058.log"
Command line:
ffmpeg -y -report -ss 50 -t 20 -i C0001.MXF -map 0 -c copy C0001_trim.mxf
ffmpeg version N-32346-g62b5197, Copyright (c) 2000-2011 the FFmpeg developers
  built on Dec 15 2011 11:51:15 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-libfreetype --enable-nonfree --enable-hardcoded-tables --cc=/usr/bin/gcc-4.2 --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libxvid
  libavutil    51. 32. 0 / 51. 32. 0
  libavcodec   53. 45. 0 / 53. 45. 0
  libavformat  53. 25. 0 / 53. 25. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 53. 0 /  2. 53. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[mxf @ 0x7faed3049800] Format mxf probed with size=2048 and score=100
[mxf @ 0x7faed3049800] could not resolve sub descriptor strong ref
[mxf @ 0x7faed3049800] source track 11: stream 9, no descriptor found
[mpeg2video @ 0x7faed3077000] err{or,}_recognition separate: 1; 1
[mpeg2video @ 0x7faed3077000] err{or,}_recognition combined: 1; 10001
[pcm_s24le @ 0x7faed304fa00] err{or,}_recognition separate: 1; 1
[pcm_s24le @ 0x7faed304fa00] err{or,}_recognition combined: 1; 10001
[pcm_s24le @ 0x7faed3096200] err{or,}_recognition separate: 1; 1
[pcm_s24le @ 0x7faed3096200] err{or,}_recognition combined: 1; 10001
[pcm_s24le @ 0x7faed3050000] err{or,}_recognition separate: 1; 1
[pcm_s24le @ 0x7faed3050000] err{or,}_recognition combined: 1; 10001
[pcm_s24le @ 0x7faed30aec00] err{or,}_recognition separate: 1; 1
[pcm_s24le @ 0x7faed30aec00] err{or,}_recognition combined: 1; 10001
[pcm_s24le @ 0x7faed3050600] err{or,}_recognition separate: 1; 1
[pcm_s24le @ 0x7faed3050600] err{or,}_recognition combined: 1; 10001
[pcm_s24le @ 0x7faed3050c00] err{or,}_recognition separate: 1; 1
[pcm_s24le @ 0x7faed3050c00] err{or,}_recognition combined: 1; 10001
[pcm_s24le @ 0x7faed3051200] err{or,}_recognition separate: 1; 1
[pcm_s24le @ 0x7faed3051200] err{or,}_recognition combined: 1; 10001
[pcm_s24le @ 0x7faed3051800] err{or,}_recognition separate: 1; 1
[pcm_s24le @ 0x7faed3051800] err{or,}_recognition combined: 1; 10001
[mpeg2video @ 0x7faed3077000] Unsupported bit depth: 0

Seems stream 0 codec frame rate differs from container frame rate: 59.94 (60000/1001) -> 29.97 (60000/2002)
Input #0, mxf, from 'C0001.MXF':
  Duration: 00:01:10.27, start: 0.000000, bitrate: 60357 kb/s
    Stream #0:0, 1, 1001/30000: Video: mpeg2video (4:2:2), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], 50000 kb/s, 29.97 tbr, 29.97 tbn, 59.94 tbc
    Stream #0:1, 1, 1001/30000: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
    Stream #0:2, 1, 1001/30000: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
    Stream #0:3, 1, 1001/30000: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
    Stream #0:4, 1, 1001/30000: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
    Stream #0:5, 1, 1001/30000: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
    Stream #0:6, 1, 1001/30000: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
    Stream #0:7, 1, 1001/30000: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
    Stream #0:8, 1, 1001/30000: Audio: pcm_s24le, 48000 Hz, 1 channels, s32, 1152 kb/s
    Stream #0:9, 0, 1001/30000: Data: none
[mxf @ 0x7faed30c7c00] track 9: could not find essence container ul, codec not currently supported in container
Output #0, mxf, to 'C0001_trim.mxf':
  Metadata:
    encoder         : Lavf53.25.0
    Stream #0:0, 0, 1001/30000: Video: mpeg2video, yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 50000 kb/s, 29.97 tbn, 29.97 tbc
    Stream #0:1, 0, 1/48000: Audio: pcm_s24le, 48000 Hz, 1 channels, 1152 kb/s
    Stream #0:2, 0, 1/48000: Audio: pcm_s24le, 48000 Hz, 1 channels, 1152 kb/s
    Stream #0:3, 0, 1/48000: Audio: pcm_s24le, 48000 Hz, 1 channels, 1152 kb/s
    Stream #0:4, 0, 1/48000: Audio: pcm_s24le, 48000 Hz, 1 channels, 1152 kb/s
    Stream #0:5, 0, 1/48000: Audio: pcm_s24le, 48000 Hz, 1 channels, 1152 kb/s
    Stream #0:6, 0, 1/48000: Audio: pcm_s24le, 48000 Hz, 1 channels, 1152 kb/s
    Stream #0:7, 0, 1/48000: Audio: pcm_s24le, 48000 Hz, 1 channels, 1152 kb/s
    Stream #0:8, 0, 1/48000: Audio: pcm_s24le, 48000 Hz, 1 channels, 1152 kb/s
    Stream #0:9, 0, 1/90000: Data: none
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
  Stream #0:2 -> #0:2 (copy)
  Stream #0:3 -> #0:3 (copy)
  Stream #0:4 -> #0:4 (copy)
  Stream #0:5 -> #0:5 (copy)
  Stream #0:6 -> #0:6 (copy)
  Stream #0:7 -> #0:7 (copy)
  Stream #0:8 -> #0:8 (copy)
  Stream #0:9 -> #0:9 (copy)
Could not write header for output file #0 (incorrect codec parameters ?)
 

comment:6 Changed 6 months ago by cehoyos

  • Keywords cc added
  • Status changed from new to open
  • Reproduced by developer set

comment:7 Changed 6 months ago by cehoyos

  • Keywords mxf added
Note: See TracTickets for help on using tickets.