PDA

View Full Version : [ubuntu] .wmv to .flv conversion with sound?



garyed
July 20th, 2009, 06:57 PM
I'm trying to convert wmv files to flv with no success.
I can get the video converted but I can't get the sound.
The code I'm using is:

ffmpeg -i first.wmv -vcodec flv first.flv

Tman5293
July 20th, 2009, 07:10 PM
Is there an important reason for doing this???

Yvan300
July 20th, 2009, 07:46 PM
There is a very handy script that will allow you to convert your video. You can download it from here http://gnome-look.org/content/show.php/Audio%2BVideo%2BImage%2BText%2BISO+Convert?content =92533

It will make life easier for you.

garyed
July 20th, 2009, 09:36 PM
Is there an important reason for doing this???

I want to put some flash movies on a web page.

garyed
July 20th, 2009, 10:15 PM
There is a very handy script that will allow you to convert your video. You can download it from here http://gnome-look.org/content/show.php/Audio%2BVideo%2BImage%2BText%2BISO+Convert?content =92533

It will make life easier for you.

Thanks for the link but I'm affraid I still have the same problem even with that script.
The flv file it creates has no sound either.

FakeOutdoorsman
July 20th, 2009, 10:18 PM
I'm trying to convert wmv files to flv with no success.
I can get the video converted but I can't get the sound.
The code I'm using is:

ffmpeg -i first.wmv -vcodec flv first.flv

Show the complete FFmpeg output.

garyed
July 20th, 2009, 10:33 PM
Here's the output & the command:


mey@my-desktop:~/downloads$ ffmpeg -i lock1.wmv -vcodec flv lock1.flvFFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 .....
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm --enable-dc1394 --disable-debug --enable-shared --prefix=/usr
libavutil version: 1d.49.3.0
libavcodec version: 1d.51.38.0
libavformat version: 1d.51.10.0
built on Jul 23 2008 22:38:24, gcc: 4.2.3 (Ubuntu 4.2.3-2ubuntu7)

Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 29.92 (359/12)
Input #0, asf, from 'lock1.wmv':
Duration: 00:02:49.7, start: 5.000000, bitrate: 318 kb/s
Stream #0.0: Audio: wmav2, 44100 Hz, stereo, 64 kb/s
Stream #0.1: Video: wmv3, yuv420p, 352x240, 29.92 fps(r)
Output #0, flv, to 'lock1.flv':
Stream #0.0: Video: flv, yuv420p, 352x240, q=2-31, 200 kb/s, 29.92 fps(c)
Stream mapping:
Stream #0.1 -> #0.0
Press [q] to stop encoding
frame= 5064 q=5.4 Lsize= 4421kB time=169.3 bitrate= 214.0kbits/s
video:4330kB audio:0kB global headers:0kB muxing overhead 2.108244%

FakeOutdoorsman
July 20th, 2009, 10:55 PM
Are you using Ubuntu 8.04 Hardy Heron? FFmpeg from the Ubuntu repository doesn't support restricted encoders, but you can use FFmpeg from the Medibuntu repository. You will need to remove FFmpeg first:

sudo apt-get remove ffmpeg
and then install FFmpeg from the Medibuntu repository and is explained here in option "D":

HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoding in FFmpeg (http://ubuntuforums.org/showthread.php?t=1117283)

You may also want to install flvtool2 to make sure your flv will play correctly in some web players such as JW Player or flowplayer:

sudo apt-get install flvtool2
flvtool2 -U outputfromffmpeg.flv

Alternatively, you could encode to H.264 video and will give you much better quality, but you would have to compile FFmpeg yourself. This is also explained in the link above.

garyed
July 20th, 2009, 11:38 PM
Are you using Ubuntu 8.04 Hardy Heron? FFmpeg from the Ubuntu repository doesn't support restricted encoders, but you can use FFmpeg from the Medibuntu repository. You will need to remove FFmpeg first:
.......

I uninstalled first & then used the mediubuntu commands in the links & still the same problem. I tried a couple different command but when I used

-acodec libmp3lame -ab 128k
I get a message: "Unknown codec 'libmp3lame' "
By the way I am running Hardy.

FakeOutdoorsman
July 21st, 2009, 01:13 AM
Medibuntu FFmpeg uses older syntax for some encoder names. Try this:

ffmpeg -i input.wmv -acodec mp3 -ar 44100 output.flv

garyed
July 21st, 2009, 01:24 AM
Medibuntu FFmpeg uses older syntax for some encoder names. Try this:

ffmpeg -i input.wmv -acodec mp3 -ar 44100 output.flv

When I do I get a message: "unsupported codec for output stream #0.1" which is the number of the audio stream.

FakeOutdoorsman
July 21st, 2009, 02:48 AM
That's odd. My tests on Hardy ran without any issues, but maybe I'm missing something obvious. Show the complete output of:

ffmpeg -formats | grep mp3

garyed
July 21st, 2009, 03:58 AM
Here is my output:


FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm --enable-dc1394 --disable-debug --enable-libmp3lame --enable-libfaadbin --enable-libfaad --enable-libfaac --enable-xvid --enable-x264 --enable-liba52 --enable-amr_nb --enable-amr_wb --enable-shared --prefix=/usr
libavutil version: 1d.49.3.0
libavcodec version: 1d.51.38.0
libavformat version: 1d.51.10.0
built on Mar 17 2009 21:37:49, gcc: 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
DE mp3 MPEG audio layer 3
D A mp3
D A mp3adu
D A mp3on4

FakeOutdoorsman
July 21st, 2009, 07:35 PM
I must admit that I don't understand why this isn't working for you. I get the following:

FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm --enable-dc1394 --disable-debug --enable-libmp3lame --enable-libfaadbin --enable-libfaad --enable-libfaac --enable-xvid --enable-x264 --enable-liba52 --enable-amr_nb --enable-amr_wb --enable-shared --prefix=/usr
libavutil version: 1d.49.3.0
libavcodec version: 1d.51.38.0
libavformat version: 1d.51.10.0
built on Mar 17 2009 21:37:49, gcc: 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
DE mp3 MPEG audio layer 3
DEA mp3
D A mp3adu
D A mp3on4
I assumed Medibuntu FFmpeg would always have access to the mp3 encoder. Maybe I'm wrong because I never use Medibuntu. You could try compiling FFmpeg yourself. It's not hard, but takes a few minutes and also I don't know what else to suggest. If you want to try that, first remove Medibuntu FFmpeg as shown at the bottom of the first link I gave you and then follow:

HOWTO: Install and use the latest FFmpeg and x264 (http://ubuntuforums.org/showthread.php?t=786095)

Update: You can try installing libavcodec1d from Medibuntu before trying to compile FFmpeg yourself. It probably should have been installed with Medibuntu FFmpeg, but perhaps there is a conflict. I believe this is the package that should allow Medibuntu FFmpeg to encode to mp3.

jerome1232
July 21st, 2009, 07:38 PM
Maybe this has changed but I thought we didn't have a decoder for wmav2, only wmav1.

FakeOutdoorsman
July 21st, 2009, 07:48 PM
Maybe this has changed but I thought we didn't have a decoder for wmav2, only wmav1.
Good point, but:

$ ffmpeg -formats | grep wmav2
DEA wmav2
DEA = Decoder available, Encoder available, wmav2 is an Audio format