PDA

View Full Version : FFmpeg FLV no sound


johnbanks
07-19-06, 05:44 AM
I have installed ffmpeg installed on my server.
Converting works perfect, but now my movies dont have sound.
Is there a setting that I forgot or may be a stupid thought, but does it needs that a server has to have an audio card? :confused:
Never heard of this but read something about this.
May be any of you are familiar with this issue.

antonyf
04-10-07, 12:44 PM
This is how i did it on my Debian Server and Mac OS X client. I hope it works for you!

/ Antony Fernandez

tophat
04-25-07, 05:22 PM
you need to install lame on your server.

http://lame.sourceforge.net/index.php

Lain
05-02-07, 01:29 AM
I'm also having the same problem and I've installed lame.
When I use this command

[root@ser001 Video]# ffmpeg -acodec mp3 -i Picture052.avi output.flv
FFmpeg version SVN-r8863, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-libfaac --enable-xvid --enable-libmp3lame --enable-libogg --enable-libvorbis --disable-mmx --enable-shared
libavutil version: 49.4.0
libavcodec version: 51.40.4
libavformat version: 51.12.1
built on May 2 2007 13:01:26, gcc: 4.1.1 20070105 (Red Hat 4.1.1-51)
Input #0, avi, from 'Picture052.avi':
Duration: 00:01:07.7, start: 0.000000, bitrate: 2307 kb/s
Stream #0.0: Video: mjpeg, yuvj422p, 320x240, 15.00 fps(r)
Stream #0.1: Audio: pcm_u8, 11024 Hz, mono, 88 kb/s
File 'output.flv' already exists. Overwrite ? [y/N] y
Output #0, flv, to 'output.flv':
Stream #0.0: Video: flv, yuv420p, 320x240, q=2-31, 200 kb/s, 15.00 fps(c)
Stream #0.1: Audio: 0x0000, 11024 Hz, mono, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
[flv @ 0x51f564]removing common factors from framerate
Unsupported codec for output stream #0.1

If I don't use -acodec, it converted fine but with no audio

[root@ser001 Video]# ffmpeg -i Picture052.avi output.flv
FFmpeg version SVN-r8863, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-libfaac --enable-xvid --enable-libmp3lame --enable-libogg --enable-libvorbis --disable-mmx --enable-shared
libavutil version: 49.4.0
libavcodec version: 51.40.4
libavformat version: 51.12.1
built on May 2 2007 13:01:26, gcc: 4.1.1 20070105 (Red Hat 4.1.1-51)
Input #0, avi, from 'Picture052.avi':
Duration: 00:01:07.7, start: 0.000000, bitrate: 2307 kb/s
Stream #0.0: Video: mjpeg, yuvj422p, 320x240, 15.00 fps(r)
Stream #0.1: Audio: pcm_u8, 11024 Hz, mono, 88 kb/s
File 'output.flv' already exists. Overwrite ? [y/N] y
Output #0, flv, to 'output.flv':
Stream #0.0: Video: flv, yuv420p, 320x240, q=2-31, 200 kb/s, 15.00 fps(c)
Stream mapping:
Stream #0.0 -> #0.0
[flv @ 0x51f564]removing common factors from framerate
Press [q] to stop encoding
frame= 1015 fps=421 q=6.5 Lsize= 1787kB time=67.7 bitrate= 216.3kbits/s
video:1771kB audio:0kB global headers:0kB muxing overhead 0.905871%

I have spent one full day to search for every possible answer in google but still no luck so far. Can anyone please help? I'm basically stuck and wanting to bang my head on the desk :mad:

TRicciardi
06-18-07, 01:38 PM
This is how i did it on my Debian Server and Mac OS X client. I hope it works for you!

http://www.antony.se/2007/4/10/ffmpeg-and-lame-on-debian-and-os-x

/ Antony Fernandez

Did what Antony sugested on my CentOS server and it worked.

Now i need to try php integration..
Btw should i force options like -ar 44100 in my php code? coz the source file may have a flash incompatible sampling rate.

ludlow
07-16-07, 11:13 PM
Hi. I've been having the same problems and I'm not sure what else I can do. I have installed Lame and configured ffmpeg to use the libraries (or it should be anyways). Here are my resulting outputs:

If I just do a very basic ffmpeg command:


[root@localhost videos]# ffmpeg -y -i cimg3456.avi -acodec mp3 -f flv cimg3456.flvFFmpeg version SVN-r9708, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-libmp3lame --enable-static --disable-vhook
libavutil version: 49.4.1
libavcodec version: 51.40.4
libavformat version: 51.12.1
built on Jul 16 2007 22:03:39, gcc: 4.1.2 20070502 (Red Hat 4.1.2-12)

Seems stream 0 codec frame rate differs from container frame rate: 30000.00 (30000/1) -> 29.97 (30000/1001)
Input #0, avi, from 'cimg3456.avi':
Duration: 00:00:39.6, start: 0.000000, bitrate: 3960 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 640x480, 29.97 fps(r)
Stream #0.1: Audio: adpcm_ima_wav, 44100 Hz, mono, 177 kb/s
Output #0, flv, to 'cimg3456.flv':
Stream #0.0: Video: flv, yuv420p, 640x480, q=2-31, 200 kb/s, 29.97 fps(c)
Stream #0.1: Audio: 0x0000, 44100 Hz, mono, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Unsupported codec for output stream #0.1


You can see from the output it's utilizing the libmp3lame library. If I do the most basic of commands (essentially leaving out the audio codec):


[root@localhost videos]# ffmpeg -y -i cimg3456.avi -f flv cimg3456.flv
FFmpeg version SVN-r9708, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-libmp3lame --enable-static --disable-vhook
libavutil version: 49.4.1
libavcodec version: 51.40.4
libavformat version: 51.12.1
built on Jul 16 2007 22:03:39, gcc: 4.1.2 20070502 (Red Hat 4.1.2-12)

Seems stream 0 codec frame rate differs from container frame rate: 30000.00 (30000/1) -> 29.97 (30000/1001)
Input #0, avi, from 'cimg3456.avi':
Duration: 00:00:39.6, start: 0.000000, bitrate: 3960 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 640x480, 29.97 fps(r)
Stream #0.1: Audio: adpcm_ima_wav, 44100 Hz, mono, 177 kb/s
Output #0, flv, to 'cimg3456.flv':
Stream #0.0: Video: flv, yuv420p, 640x480, q=2-31, 200 kb/s, 29.97 fps(c)
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
frame= 1186 fps=150 q=31.0 Lsize= 1877kB time=39.6 bitrate= 388.5kbits/s
video:1858kB audio:0kB global headers:0kB muxing overhead 1.007290%


You can see that it actually works, but with NO AUDIO. :(

Any thoughts, comments, or obscene gestures are welcome.

ludlow
07-16-07, 11:16 PM
...for the record, I'm on a dual AMD Opteron 64 board running Fedora 7.

Additionally, I can get this to work flawlessly using OSX (but I need to automate this process for my server).

ludlow
07-17-07, 06:34 PM
Okay - well I didn't actually get any replies *unfortunately*, but I WAS able to finally get this thing working after a solid day of work. So here's basically what I did and the problems that I ran into along the way. I hope this helps someone:

The first problem(s) essentially came from not having the right libraries installed. I assumed FFMPEG took care of this, but I assumed incorrectly.

The final FFMPEG configuration I FINALLY got to work was this one:

./configure --enable-gpl --enable-pp --enable-libvorbis --enable-libogg --enable-liba52 --enable-libmp3lame --enable-libfaad --enable-libfaac

So - I would recommend starting with just the first enable. It only takes a moment to figure out if you have the libraries installed or not. If it works, move on to the next one. Essentially we're just trying to figure out what you DON'T have installed. In my case, I had problems with the liba52, libfaad, and libfaac. Please also note if you haven't already installed LAME, you'll want to do that first. It's pretty easy to do and there are hundreds of threads explaining how.

The three libraries I was missing I conveniently found here:
http://atrpms.net/dist/f7/a52dec/
http://atrpms.net/dist/f7/faac/
http://atrpms.net/dist/f7/faad2/

Find your processor type and download the RPMs. There should be 3 or 4 files for each processor type and you'll need all of them. Also, you need to get them in order as they depend on one another as well.

As you save them to your local server, install the RPM packages.

rpm -ivh <filename>.rpm

If it fails, you probably went out of order. Read what it says and the RPM info should probably display the missing dependency.

Once these have been installed, you'll want to CLEANLY rebuild FFMPEG.

Run the following commands in order:

./configure --enable-gpl --enable-pp --enable-libvorbis --enable-libogg --enable-liba52 --enable-libmp3lame --enable-libfaad --enable-libfaac

make clean

make

make install

It should take quite a bit longer than you may have been noticing if you keep rebuilding it. That's simply because you probably weren't running the MAKE CLEAN first.

Now go back and give it a go. I used the following to test:
[root@localhost videos]# ffmpeg -y -i cimg3456.avi -f flv cimg3456.flv

Unfortunately, after running this one I had the following error:

ffmpeg: error while loading shared libraries: libmp3lame.so.0: cannot open shared object file: No such file or directory

Another pain in the *** (who stars out the word a s s???). After much searching, I found the following solution:

Add /usr/local/lib to /etc/ld.so.conf

I noticed a lot of forums simply said to add '/usr/local/lib' but don't really explain how to do it. If you don't know what to do, just edit the file with your favorite editor.

vim /etc/ld.so.conf

In the end, mine looked like this:

include ld.so.conf.d/*.conf
/usr/local/lib

I only added the second line in there.

Finally, run ldconfig:

/sbin/ldconfig

After that I went to test it and everything FINALLY worked. The FLV was made, the audio worked, etc. etc.

Hope this helps someone. :)

mezzanine
10-07-07, 03:03 PM
Ludlow: I owe you my life.

Thank you! I've been banging my head up against this for quite some time now, not sure which part of your explanation helped but it did the job!

Configured with:

./configure --enable-gpl --enable-pp --enable-libmp3lame

I didn't need the three libs stated above, nor did I need ogg or vorbis - but I assume you will if you're going to use those codecs.

Note: A lot of guides will tell you to use --enable-mp3lame, I can only assume this is an old switch as it's no longer valid. --enable-libmp3lame worked a treat, along with Ludlow's help!