[FFmpeg-user] Subtitles when converting .m2ts to .m4v

shashchatterjee at aim.com shashchatterjee at aim.com
Sun Jan 27 01:26:09 CET 2013


Hi,

I get the error "Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted" when converting PGS subtitle streams from a source .m2ts file to an output .m4v file.  Converting to a .mkv works fine for the subtitles, so at least the source file is OK.

Thanks in advance for the help!

Shash



Here's the input file:

Input #0, mpegts, from 'myvideo.m2ts':
  Duration: 02:50:15.29, start: 599.958300, bitrate: 36238 kb/s
  Program 1 
    Stream #0:0[0x1011]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
    Stream #0:1[0x1100](eng): Audio: truehd (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), s32
    Stream #0:2[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 640 kb/s
    Stream #0:3[0x1101](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 640 kb/s
    Stream #0:4[0x1200](eng): Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:5[0x1201](eng): Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:6[0x1202](jpn): Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:7[0x1203](jpn): Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:8[0x1204](jpn): Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)

Here's the command I used:

ffmpeg -i myvideo.m2ts -map 0:0 -map 0:2 -map 0:4 -map 0:5 -c:v copy -c:a libfaac -c:s dvdsub myvideo.m4v

The following error relates to the subtitles, since if I remove the -map 0:4 and -map 0:5 options from the command, the problem goes away:

ffmpeg version git-2013-01-20-6136b98 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jan 20 2013 10:45:30 with gcc 4.7.2 (GCC) 20120921 (Red Hat 4.7.2-2)
  configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-libvpx --enable-librtmp --enable-libxvid --prefix=/usr/local
  libavutil      52. 15.100 / 52. 15.100
  libavcodec     54. 89.100 / 54. 89.100
  libavformat    54. 61.101 / 54. 61.101
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 32.101 /  3. 32.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[mpegts @ 0x3306f20] max_analyze_duration 5000000 reached at 5000000 microseconds
[mpegts @ 0x3306f20] Could not find codec parameters for stream 4 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x3306f20] Could not find codec parameters for stream 5 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x3306f20] Could not find codec parameters for stream 6 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x3306f20] Could not find codec parameters for stream 7 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x3306f20] Could not find codec parameters for stream 8 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[NULL @ 0x330d480] start time is not set in estimate_timings_from_pts
[NULL @ 0x330de60] start time is not set in estimate_timings_from_pts
[NULL @ 0x330e8c0] start time is not set in estimate_timings_from_pts
[NULL @ 0x3357060] start time is not set in estimate_timings_from_pts
[NULL @ 0x335d300] start time is not set in estimate_timings_from_pts
Input #0, mpegts, from 'myvideo.m2ts':
  Duration: 02:50:15.29, start: 599.958300, bitrate: 36238 kb/s
  Program 1 
    Stream #0:0[0x1011]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
    Stream #0:1[0x1100](eng): Audio: truehd (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), s32
    Stream #0:2[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 640 kb/s
    Stream #0:3[0x1101](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 640 kb/s
    Stream #0:4[0x1200](eng): Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:5[0x1201](eng): Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:6[0x1202](jpn): Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:7[0x1203](jpn): Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:8[0x1204](jpn): Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
[ipod @ 0x33585c0] track 2: could not find tag, codec not currently supported in container
Output #0, ipod, to 'myvideo.m4v':
  Metadata:
    encoder         : Lavf54.61.101
    Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 90k tbn, 90k tbc
    Stream #0:1: Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, s16, 128 kb/s
    Stream #0:2(eng): Subtitle: dvd_subtitle
    Stream #0:3(eng): Subtitle: dvd_subtitle
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:2 -> #0:1 (ac3 -> libfaac)
  Stream #0:4 -> #0:2 (pgssub -> dvdsub)
  Stream #0:5 -> #0:3 (pgssub -> dvdsub)
Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted



More information about the ffmpeg-user mailing list