views:

4473

answers:

7

Hi everybody,

If I don't make a mistake, Safari currently need MP4 (H.264/AAC) video encoded for the HTML5 <video> element.

So I tried to convert a video to this format with ffmpeg. However when I enter the shell command ffmpeg -i video.flv video.mp4, the returned error is :

Seems stream 0 codec frame rate differs from container frame rate: 2000.00 (2000/1) -> 29.92 (359/12) Input #0, flv, from 'video.flv':
Duration: 00:05:01.20, start: 0.000000, bitrate: 66 kb/s Stream #0.0: Video: h264, yuv420p, 320x240 [PAR 1:1 DAR 4:3], 66 kb/s, 29.92 tbr, 1k tbn, 2k tbc Stream #0.1: Audio: aac, 22050 Hz, stereo, s16 Output #0, mp4, to 'video.mp4': Stream #0.0: Video: mpeg4, yuv420p, 320x240 [PAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 90k tbn, 29.92 tbc Stream #0.1: Audio: 0x0000, 22050 Hz, stereo, s16, 64 kb/s Stream mapping: Stream #0.0 -> #0.0
Stream #0.1 -> #0.1 Unsupported codec for output stream #0.1

An AAC codec is required but I'm quite newbie with ubuntu and I dont really now how to fix this problem. I'm using Ubuntu 9.10 Karmik Koala (for amd64).

Thank you very much. :)

A: 

You need to compile ffmpeg with an AAC encoder. You can find one at AudioCoding.

mouviciel
I've installed FAAC 1.28 as said in the INSTALL file but I always have the same error as above. :(
+1  A: 

You can also try adding the Motumedia PPA to your apt sources and update your ffmpeg packages.

axel_c
+4  A: 

Software patents led Debian/Ubuntu to disable the H.264 and AAC encoders in ffmpeg. See /usr/share/doc/ffmpeg/README.Debian.gz.

So go install x264, mplayer/mencoder, and Nero's AAC encoder. (Or, if you want to use all Free software, and don't care so much about audio quality, then sudo aptitude install faac.)

I don't remember if the medibuntu package of mencoder includes x264 vid encoding, since I build my own from git x264 and svn mplayer sources. (x264 is very actively developed, with significant quality and speed improvements frequently added.) http://git.videolan.org/?p=x264.git;a=summary

x264 is also packaged, but you should check that it's up to date enough to include weightp with recent bugfixes, and even more recent speed improvements...

Or if you're already willing to convert from .flv, instead of going from the high-quality source the flv was made from, then probably whatever recent version of x264 you can find will be fine.

Peter Cordes
+1  A: 

I think this link could be useful: http://ubuntuforums.org/showthread.php?t=786095

Maciek Sawicki
A: 

Or use the version of FFmpeg that gets installed with Xuggler: http://www.xuggle.com/xuggler/downloads/

The version on that home page has X264 compiled in (which makes that version GPL)

Xuggle
+1  A: 

http://handbrake.fr is a nice high level tool with a lot of useful presets for mp4 for iPod, PS3, ... with both GUI and CLI interfaces for Linux, Windows and Mac OS X.

It comes with its own dependencies as a single staticly linked fat binary so you have all the x264 / aac codecs included.

  $ HandBrakeCLI -Z Universal -i myinputfile.mov -o myoutputfile.mp4

To list all the available presets:

  $ HandBrakeCLI -z
ogrisel
A: 

I have a imoviesoft total video converter, it can help me convert almost any video format with excellent conversion speed and quality, such as converting WMV to MP4, WMV to MPEG, MKV to AVI, WMV to AVI, AVI to MPEG, etc.. Furthermore, it can easily convert video files to popular audio files like converting WMV to MP3, AVI to WMA, MKV to AAC, MP4 to MP3, etc. You can learn more details here: http://www.imoviesoft.com/products/total-video-converter.html