Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

ATTEMPT #1 on a mp3 laced avi file:

I want to splice the first part of a movie I have. Here is the command I used:

ffmpeg -i file.avi -ss 0 -t 90 -acodec copy -vcodec copy output-4.avi

Here is the result of the command:

FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --extra-version=4:0.5.1-1ubuntu1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 1 / 52.20. 1
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    0. 4. 0 /  0. 4. 0
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Mar  4 2010 12:35:30, gcc: 4.4.3
[NULL @ 0x92e0570]Invalid and inefficient vfw-avi packed B frames detected

Seems stream 0 codec frame rate differs from container frame rate: 29.98 (65535/2186) -> 29.97 (2997/100)
Input #0, avi, from 'file.avi':
  Duration: 01:30:57.84, start: 0.000000, bitrate: 1075 kb/s
    Stream #0.0: Video: mpeg4, yuv420p, 512x288 [PAR 1:1 DAR 16:9], 29.97 tbr, 29.97 tbn, 29.98 tbc
    Stream #0.1: Audio: mp3, 48000 Hz, stereo, s16, 32 kb/s
File 'output-4.avi' already exists. Overwrite ? [y/N] y
Output #0, avi, to 'output-4.avi':
    Stream #0.0: Video: mpeg4, yuv420p, 512x288 [PAR 1:1 DAR 16:9], q=2-31, 90k tbn, 29.97 tbc
    Stream #0.1: Audio: 0x0055, 48000 Hz, stereo, s16, 32 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 2698 fps=  0 q=-1.0 Lsize=    8995kB time=90.02 bitrate= 818.5kbits/s    
video:7342kB audio:1490kB global headers:0kB muxing overhead 1.847673%

There is an inconsistency. The output of the audio is 0x0055 whereas the input is mp3. Why is this so? So I not have the proper mp3 package?

When I open the video, the audio is clearly messed up as it sounds very distorted, like conjoined channels of audio. The video seems intact.

ATTEMPT #2 on a mp2 laced mpg file:

As a comparison, I was able to splice an mpeg that had mp2 audio fine:

Original command:

ffmpeg -i file.mpg -ss 15 -t 60 -acodec copy -vcodec copy output-2.mpg

Result:

FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --extra-version=4:0.5.1-1ubuntu1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 1 / 52.20. 1
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    0. 4. 0 /  0. 4. 0
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Mar  4 2010 12:35:30, gcc: 4.4.3
Input #0, mpeg, from 'file.mpg':
  Duration: 00:15:36.76, start: 0.339000, bitrate: 1394 kb/s
    Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 352x240 [PAR 200:219 DAR 880:657], 1150 kb/s, 29.97 tbr, 90k tbn, 29.97 tbc
    Stream #0.1[0x1c0]: Audio: mp2, 44100 Hz, stereo, s16, 224 kb/s
File 'output-2.mpg' already exists. Overwrite ? [y/N] y
Output #0, mpeg, to 'output-2.mpg':
    Stream #0.0: Video: mpeg1video, yuv420p, 352x240 [PAR 200:219 DAR 880:657], q=2-31, 1150 kb/s, 90k tbn, 29.97 tbc
    Stream #0.1: Audio: mp2, 44100 Hz, stereo, s16, 224 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
[mpeg @ 0x8b0a1a0]buffer underflow i=1 bufi=0 size=731
frame= 1799 fps=  0 q=-1.0 Lsize=   10154kB time=75.42 bitrate=1103.0kbits/s    
video:8429kB audio:1651kB global headers:0kB muxing overhead 0.724915%

EDIT #1: As per fedeli here is the output of ffmpeg -formats | grep mp3:

ffmpeg -formats | grep mp3
FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --extra-version=4:0.5.1-1ubuntu1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 1 / 52.20. 1
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    0. 4. 0 /  0. 4. 0
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Mar  4 2010 12:35:30, gcc: 4.4.3
 DE mp3             MPEG audio layer 3
 D A    mp3             MP3 (MPEG audio layer 3)
 D A    mp3adu          ADU (Application Data Unit) MP3 (MPEG audio layer 3)
 D A    mp3on4          MP3onMP4
 text2movsub remove_extra noise mov2textsub mp3decomp mp3comp mjpegadump imxdump h264_mp4toannexb dump_extra
share|improve this question
    
What is the output of ffmpeg -formats | grep mp3? –  fideli Oct 17 '10 at 21:43
    
updated question with output. –  meder Oct 17 '10 at 21:44
    
can you select mp3 as an output stream? –  rogerdpack Dec 16 '10 at 17:58

1 Answer 1

up vote 2 down vote accepted

You'd actually want the output from:

ffmpeg -codecs | grep libmp3lame

if it's not there you're most likely going to have to recompile and add the missing:

--enable-libmp3lame

and for good measure:

--enable-gpl --enable-version3

Instead of -acodec copy etc... what happens if you simply do:

ffmpeg -i file.avi -t 90 output.avi
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.