[FFmpeg-user] Problem with mpeg copy and start position

Jean-Paul van de Plasse jeanpaul at i-serve.nl
Thu Apr 5 11:31:41 CEST 2012


Hello,

Recently updated my ffmpeg install and now I have a problem, before this worked correctly.
I trim video's for later processing with other software, so i use -ss and -t to give the startpoint and duration.
But the resulting file seems to mis a correct header.

ffmpeg -i input.mpg 
ffmpeg version N-39538-gfa1f92a Copyright (c) 2000-2012 the FFmpeg developers
  built on Apr  5 2012 11:09:18 with gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
  configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=generic -fasynchronous-unwind-tables' --enable-avfilter --enable-libdirac --enable-libfaac --enable-libgsm --enable-libmp3lame --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3
  libavutil      51. 44.100 / 51. 44.100
  libavcodec     54. 12.100 / 54. 12.100
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 66.101 /  2. 66.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 10.100 /  0. 10.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mpeg, from 'input.mpg':
  Duration: 00:03:14.47, start: 0.164600, bitrate: 15634 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 15000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s
At least one output file must be specified

ffmpeg -i input.mpg -ss 1 -acodec copy -vcodec copy -t 182 output-with-ss.mpg
ffmpeg version N-39538-gfa1f92a Copyright (c) 2000-2012 the FFmpeg developers
  built on Apr  5 2012 11:09:18 with gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
  configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=generic -fasynchronous-unwind-tables' --enable-avfilter --enable-libdirac --enable-libfaac --enable-libgsm --enable-libmp3lame --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3
  libavutil      51. 44.100 / 51. 44.100
  libavcodec     54. 12.100 / 54. 12.100
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 66.101 /  2. 66.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 10.100 /  0. 10.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mpeg, from 'input.mpg':
  Duration: 00:03:14.47, start: 0.164600, bitrate: 15634 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 15000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s
Output #0, mpeg, to 'output-with-ss.mpg':
  Metadata:
    encoder         : Lavf54.3.100
    Stream #0:0: Video: mpeg2video, yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 15000 kb/s, 25 fps, 90k tbn, 25 tbc
    Stream #0:1: Audio: mp2, 48000 Hz, stereo, 384 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 4546 fps= 73 q=-1.0 Lsize=  342798kB time=00:03:02.00 bitrate=15429.7kbits/s    
video:332959kB audio:8531kB global headers:0kB muxing overhead 0.383069%

ffmpeg -i output-with-ss.mpg 
ffmpeg version N-39538-gfa1f92a Copyright (c) 2000-2012 the FFmpeg developers
  built on Apr  5 2012 11:09:18 with gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
  configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=generic -fasynchronous-unwind-tables' --enable-avfilter --enable-libdirac --enable-libfaac --enable-libgsm --enable-libmp3lame --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3
  libavutil      51. 44.100 / 51. 44.100
  libavcodec     54. 12.100 / 54. 12.100
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 66.101 /  2. 66.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 10.100 /  0. 10.100
  libpostproc    52.  0.100 / 52.  0.100
[mp3 @ 0xae389e0] Header missing
    Last message repeated 952 times
[mpeg @ 0xae325c0] decoding for stream 0 failed
[mpeg @ 0xae325c0] Could not find codec parameters (Audio: mp1, 0 channels, s16)
Input #0, mpeg, from 'output-with-ss.mpg':
  Duration: 00:03:01.99, start: 1.008000, bitrate: 15430 kb/s
    Stream #0:0[0x1e0]: Audio: mp1, 0 channels, s16
    Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s
At least one output file must be specified

ffmpeg -i input.mpg  -acodec copy -vcodec copy -t 182 output-without-ss.mpg
ffmpeg version N-39538-gfa1f92a Copyright (c) 2000-2012 the FFmpeg developers
  built on Apr  5 2012 11:09:18 with gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
  configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=generic -fasynchronous-unwind-tables' --enable-avfilter --enable-libdirac --enable-libfaac --enable-libgsm --enable-libmp3lame --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3
  libavutil      51. 44.100 / 51. 44.100
  libavcodec     54. 12.100 / 54. 12.100
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 66.101 /  2. 66.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 10.100 /  0. 10.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mpeg, from 'input.mpg':
  Duration: 00:03:14.47, start: 0.164600, bitrate: 15634 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 15000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s
Output #0, mpeg, to 'output-without-ss.mpg':
  Metadata:
    encoder         : Lavf54.3.100
    Stream #0:0: Video: mpeg2video, yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 15000 kb/s, 25 fps, 90k tbn, 25 tbc
    Stream #0:1: Audio: mp2, 48000 Hz, stereo, 384 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 4551 fps= 75 q=-1.0 Lsize=  343140kB time=00:03:02.00 bitrate=15445.1kbits/s    
video:333297kB audio:8532kB global headers:0kB muxing overhead 0.383468%

ffmpeg -i output-without-ss.mpg 
ffmpeg version N-39538-gfa1f92a Copyright (c) 2000-2012 the FFmpeg developers
  built on Apr  5 2012 11:09:18 with gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
  configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=generic -fasynchronous-unwind-tables' --enable-avfilter --enable-libdirac --enable-libfaac --enable-libgsm --enable-libmp3lame --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3
  libavutil      51. 44.100 / 51. 44.100
  libavcodec     54. 12.100 / 54. 12.100
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 66.101 /  2. 66.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 10.100 /  0. 10.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mpeg, from 'output-without-ss.mpg':
  Duration: 00:03:02.04, start: 1.000000, bitrate: 15441 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 15000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s
At least one output file must be specified


Maybe something changed in the syntax that I should change my command line, but any help is appreciated.

Regards,

Jean-Paul van de Plasse


More information about the ffmpeg-user mailing list