no sound using ffmpeg


I’m using this command to create a single mpeg file from two:

cat orig1.mpg orig2.mpg | ffmpeg -f mpeg -i - -vcodec copy -acodec copy

Unfortunately my result mpeg has no sound…

I’m using OpenSuse10.3

Any idea???

P.S. lame is installed…

try this:

mencoder orig1.mpg orig2.mpg -of mpeg -ovc copy -oac copy -o output.mpg

you need the MPlayer package installed to obtain MEncoder

GREAT! :slight_smile: It works! :slight_smile:

Although the first minute (total 35min) I can’t see/listen… There were a lot of errors like this one:

ERROR: scr 52.404, dts 0.000, pts 51.664

ERROR: scr 52.406, dts 51.640, pts 51.760
Pos:  52.0s   1303f ( 3%) 651.50fps Trem:   0min 995mb  A-V:0.041 [4974:192]]
ERROR: scr 52.527, dts 0.000, pts 51.760

ERROR: scr 52.570, dts 0.000, pts 51.824

ERROR: scr 52.662, dts 0.000, pts 51.920

ERROR: scr 52.717, dts 52.000, pts 52.120

ERROR: scr 52.720, dts 0.000, pts 51.984

ERROR: scr 52.786, dts 0.000, pts 52.080

ERROR: scr 52.852, dts 0.000, pts 52.176

ERROR: scr 52.910, dts 0.000, pts 52.240

ERROR: scr 52.912, dts 52.240, pts 52.360
Pos:  52.6s   1318f ( 3%) 652.15fps Trem:   0min 990mb  A-V:0.049 [4977:192]]

But this can be a result of the bad input file… Who knows…

Second (and last) step is now to convert into an flv file. mencoder can do it too?

yes, mencoder can convert it into an FLV file… you can use for example

mencoder inputfile -of lavf -lavfopts format=flv -ovc lavc -lavcopts vcodec=flv:vmax_b_frames=0:vbitrate=1000 -oac mp3lame -lameopts cbr:br=128 -o output.flv

when you use the lavf muxer with mencoder, make sure that you don’t use any B-Frames for encoding since the lavf muxer is currently broken and places incorrect timestamps when using B-Frames. Like in the example above, set the vmax_b_frames option to 0


I get this error:

Writing header...
[NULL @ 0x887d290]video codec not compatible with flv

What’s wrong? No other possibilities?

you need to use vcodec=flv instead of mpeg4 (my fault sorry)


I’ve used it and you wrote it too!


this is very strange as it works here. Copy this command line into your terminal and try again. Change only the “inputfile” at the beginning.

mencoder inputfile -of lavf -lavfopts format=flv -ovc lavc -lavcopts vcodec=flv:vmax_b_frames=0:vbitrate=1500:mbd=2:cmp=2:subcmp=2:trell -oac mp3lame -lameopts cbr:br=128 -o output.flv -af resample=44100 -srate 44100

Alternatively you can use ffmpeg to convert your file to FLV, however I have no idea how to do it with ffmpeg. I’m a mencoder user

Great! :slight_smile:

Now it works fine - EVERYTHING works fine!!! :slight_smile:

Thanks a lot…

I’m happy to be of assistance :slight_smile:
Great to hear it’s working!

I have been working on this as well and I have found a solution to my problem. I am using a Windows PC with Ubuntu installed as a second OS but Ubuntu functions very well for me. I have download lots of packages and even some restricted packages. (They are not really restricted, that’s what *** was named). Having said that, I don’t know if the downloads helped fix my problem or not. They are to many for me to discuss. Anyway, when I started working with ffmpeg I found two codes. One for video and one for audio. The one for audio is ffmpeg -f alsa -acodec pcm_s16le -ac 2 -ar 48000 -ab 1536k -i hw:0,0 /home/clarence/ffmpegaudio/myaudio1.wav where /home/clarence/ffmpegaudio/myaudio1.wav is where I want to send the output and the file name to send it to. The second code was for video, ffmpeg -r 30 -s 1680x1050 -f x11grab -i :0.0 -vcodec msmpeg4v2 -qscale 2 vieditor.avi where vieditor.avi is the file name and it will go to the x263 directory. To get sound and video, I simply combined the two codes:ffmpeg -f alsa -acodec pcm_s16le -ac 2 -ar 48000 -ab 1536k -i hw:0,0 -r 30 -s 1680x1050 -f x11grab -i :0.0 -vcodec msmpeg4v2 -qscale 2 movie5.avi and it works perfectly on both of my systems. I would like to be able to adjust the sound level using ffmpeg on one of my systems, it’s pretty good on the other. I hope this helps.