PDA

View Full Version : HOWTO: Install and use the latest FFmpeg and x264



Pages : 1 2 3 4 [5] 6 7 8 9 10

alexcckll
May 2nd, 2010, 10:22 AM
Umm - I don't get it.
What I have basically done is buy preinstalled Linux laptops from Linux Emporium - and iPlayer works.
What is this brokenness people talk about?

FakeOutdoorsman
May 3rd, 2010, 07:52 PM
Hi Fakeoutdoorsman,

I think the privilege of making the 1,000th post in your incredible guide belongs to you :). Thanks for introducing me to FFmpeg in the first place!

All the very best,

Andrew


The thanks goes to you and andrew, now for all my LTS Lucid installs, every month I can upgrade to latest FFMPEG, x264 and mplayer thanks to both your hard work. So for next three years, I and many others are all set.

Thank you. I am glad this guide has been useful to others and helped spread the word about such useful tools.

Meccano
May 7th, 2010, 11:14 PM
Hi all,

Thanks for this great tutorial.

I followed each and every step and I get this message after the last command :
bash: hash: ffmpeg: not found

I don't know it this is a problem or not since I'm a total noob to this. Tried googling around and searching the forum but got nowhere... :(

Any ideas ? Did I miss something ? Should I uninstall and try to reinstall the whole thing (that's probably what I'm gonna try to do in the meantime...).

Thanks in advance for the help.

Ubuntu Lucid Lynx fresh install on AMD64.

Meccano
May 7th, 2010, 11:45 PM
Hi again,

Just did what I said in my last post. Uninstalled and reinstalled and it all went smooooth (don't ask me what happened the first time...).

Well, I can now join the happy campers club here and say : Thanks a bunch, FakeOutdoorsman !!!! :-)

Now, I'll get to work ;-)

the hoplite
May 10th, 2010, 03:08 PM
Great. Really. Thanks!

mrfreen
May 10th, 2010, 08:09 PM
Hmm... I've followed all these instructions, but whenever I try to convert a PNG sequence to a movie file I get the message
"Error opening filters!"

What does this mean?

Bachstelze
May 10th, 2010, 08:13 PM
whenever I try to convert a PNG sequence to a movie file I get the message
"Error opening filters!"

What is the command you're trying to run?

FakeOutdoorsman
May 10th, 2010, 08:17 PM
Hmm... I've followed all these instructions, but whenever I try to convert a PNG sequence to a movie file I get the message
"Error opening filters!"

What does this mean?

Also can you show the complete FFmpeg output from your command?

n.hinton
May 10th, 2010, 10:42 PM
Hi mrfreen,

From ffmpeg faq:

3.2 How do I encode single pictures into movies?

First, rename your pictures to follow a numerical sequence. For example, img1.jpg, img2.jpg, img3.jpg,... Then you may run:

ffmpeg -f image2 -i img%d.jpg /tmp/a.mpg

Notice that `%d' is replaced by the image number.

`img%03d.jpg' means the sequence `img001.jpg', `img002.jpg', etc...

If you have large number of pictures to rename, you can use the following command to ease the burden. The command, using the bourne shell syntax, symbolically links all files in the current directory that match *jpg to the `/tmp' directory in the sequence of `img001.jpg', `img002.jpg' and so on.

x=1; for i in *jpg; do counter=$(printf %03d $x); ln "$i" /tmp/img"$counter".jpg; x=$(($x+1)); done

If you want to sequence them by oldest modified first, substitute $(ls -r -t *jpg) in place of *jpg.

Then run:

ffmpeg -f image2 -i /tmp/img%03d.jpg /tmp/a.mpg

The same logic is used for any image format that ffmpeg reads.

mrfreen
May 11th, 2010, 02:16 PM
Thanks! I was trying to use wildcards (e.g. *.png instead of %04d.png).

Working now. Thanks again!


Hmmm... new problem...
Now it's segfaulting when I try to make an x264 file.
Here's what I'm sending it:

ffmpeg -y -shortest -r 24 -i PNG/480/%08d.png -i audio.wav -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre slow -crf 22 -threads 0 mp4/sintel_trailer-480p.mp4and here's what it's giving me:

FFmpeg version SVN-r23085, Copyright (c) 2000-2010 the FFmpeg developers
built on May 11 2010 14:30:24 with gcc 4.4.3
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab
libavutil 50.15. 2 / 50.15. 2
libavcodec 52.67. 0 / 52.67. 0
libavformat 52.62. 0 / 52.62. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.20. 0 / 1.20. 0
libswscale 0.10. 0 / 0.10. 0
libpostproc 51. 2. 0 / 51. 2. 0
[image2 @ 0x143c470]MAX_READ_SIZE:5000000 reached
Input #0, image2, from 'PNG/480/%08d.png':
Duration: 00:00:52.20, start: 0.000000, bitrate: N/A
Stream #0.0: Video: png, rgb24, 854x480, 24 fps, 24 tbr, 24 tbn, 24 tbc
[wav @ 0x143df40]max_analyze_duration reached
[wav @ 0x143df40]Estimating duration from bitrate, this may be inaccurate
Input #1, wav, from 'audio.wav':
Duration: 00:00:54.07, bitrate: 1535 kb/s
Stream #1.0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
[ffmpeg_output @ 0x14dcd70]auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
[scale @ 0x14e5fe0]w:854 h:480 fmt:rgb24 -> w:854 h:480 fmt:yuv420p flags:a0000004
[libx264 @ 0x14c3710]using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
[libx264 @ 0x14c3710]profile High, level 3.0
[libx264 @ 0x14c3710]264 - core 94 r1583 7608d73 - H.264/MPEG-4 AVC codec - Copyleft 2003-2010 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=crf mbtree=1 crf=22.0 qcomp=0.60 qpmin=10 qpmax=51 qpstep=4 ip_ratio=1.41 aq=1:1.00
Output #0, mp4, to 'mp4/sintel_trailer-480p.mp4':
Metadata:
encoder : Lavf52.62.0
Stream #0.0: Video: libx264, yuv420p, 854x480, q=10-51, 200 kb/s, 24 tbn, 24 tbc
Stream #0.1: Audio: aac, 48000 Hz, 2 channels, s16, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #1.0 -> #0.1
Press [q] to stop encoding
Segmentation fault


When I remove the -vpre argument it says:

[libx264 @ 0x23331c0]broken ffmpeg default settings detected
[libx264 @ 0x23331c0]use an encoding preset (vpre)

... and doesn't segfault, but doesn't do anything, either...

prupert
May 11th, 2010, 05:42 PM
After much stress, I have written an ffmpeg progress indicator in Bash. It was a right pain in the ****, due to the way ffmpeg prints out its updates without the proper use of Carriage Returns.

I have written it up here:http://www.prupert.co.uk/2010/05/11/finally-a-bash-progress-indicator-for-ffmpeg-that-works/

UPDATE:

I have now added an ETA indicator (in hours mins and seconds) to show how long there is left, as well as some better error checking to deal with how ffmpeg prints out its updates.
I plan to convert it to Python, to make it more powerful and flexible and cross platform. As well add a GUI for those command-line hating types, it might even turn into YAFF (yet another ffmpeg frontend - which is what I'll call it once it is big enough).

prupert
May 14th, 2010, 05:42 PM
For those that are intersted. I have updated my scripts, so that they use a config file after first running the ffmpegupv1.4.sh script. This means that in future, the script can be run with no user interaction. So it can be called by cron if you want ;)

Updates can be found here:
http://code.google.com/p/x264-ffmpeg-up-to-date/

towerboy
May 17th, 2010, 08:50 AM
Hello, I made it through the install and tried it on my first AVI. I am running a fresh install of Ubuntu 10.04 x64. I used your "One-pass CRF" command and I changed my input filename but that is all:

ffmpeg -i IMGP7721.AVI -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre slow -crf 22 -threads 0 output.mp4
This is the output that I get:

FFmpeg version SVN-r23149, Copyright (c) 2000-2010 the FFmpeg developers
built on May 16 2010 23:31:18 with gcc 4.4.3
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab
libavutil 50.15. 2 / 50.15. 2
libavcodec 52.67. 1 / 52.67. 1
libavformat 52.62. 0 / 52.62. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.20. 0 / 1.20. 0
libswscale 0.10. 0 / 0.10. 0
libpostproc 51. 2. 0 / 51. 2. 0
Input #0, avi, from 'IMGP7721.AVI':
Metadata:
ISFT :
Duration: 00:00:10.99, start: 0.000000, bitrate: 23891 kb/s
Stream #0.0: Video: mjpeg, yuvj422p, 1280x720, 30 tbr, 30 tbn, 30 tbc
Stream #0.1: Audio: pcm_u8, 8000 Hz, 1 channels, u8, 64 kb/s
[ffmpeg_output @ 0x272eef0]auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
[scale @ 0x272f1b0]w:1280 h:720 fmt:yuvj422p -> w:1280 h:720 fmt:yuv420p flags:a0000004
[libx264 @ 0x270f160]using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.1 Cache64
[libx264 @ 0x270f160]profile High, level 3.2
[libx264 @ 0x270f160]264 - core 94 r1583 7608d73 - H.264/MPEG-4 AVC codec - Copyleft 2003-2010 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 sliced_threads=0 nr=0 decimate=1 interlaced=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=crf mbtree=1 crf=22.0 qcomp=0.60 qpmin=10 qpmax=51 qpstep=4 ip_ratio=1.41 aq=1:1.00
[libfaac @ 0x270f7d0]libfaac doesn't support this output format!
Output #0, mp4, to 'output.mp4':
Stream #0.0: Video: libx264, yuv420p, 1280x720, q=10-51, 200 kb/s, 90k tbn, 30 tbc
Stream #0.1: Audio: aac, 8000 Hz, 2 channels, s16, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Error while opening encoder for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height
I am very new at this and am not sure what my options are that I can use.
My AVI is from straight from a Pentax Optio W80 and the properties of the video are listed below...
Video:

Dimensions: 1280 x 720
Codec: Motion JPEG
Framerate: 30 FPS
Bitrate: N/A

Audio:

Codec: Uncompressed 8-bit PCM audio
Channels: Mono
Sample Rate: 8000 Hz
Bitrate: N/A

Thanks for your time and effort.
-Jeremy

prupert
May 17th, 2010, 09:43 AM
The important error message is:


[libfaac @ 0x270f7d0]libfaac doesn't support this output format!

and more information is given as well:


Stream #0.1: Audio: aac, 8000 Hz, 2 channels, s16, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Error while opening encoder for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height

The first quote is telling you that libfaac is the codec used to create the audio stream, in this case aac and that the settings chosen aren't supported in the output format (mp4) that has been chosen.

The second quote is giving you more info, telling you that stream 0.1 is the Audio stream and what options you chose. It then says when ffmpeg tried to open the encoder you chose for that stream, it failed.

So, essentially, the settings chosen for the aac audio encoder don't work!

This is important, and fakeoutdoorsman will have to check to see why it doesn't work - I have no avi files to check it out on. I've just checked the command on a VOB file, and it seems to work fine. So I am wondering if it is to do with the AVI file you are using....

Sorry, not much help, but I thought I'd explain the error message a little more. Hopefully fakeoutdoorsman can shed some more light....

andrew.46
May 17th, 2010, 09:55 AM
Hi towerboy,

Does adding -ar 44100 to your aac options help?

Andrew

prupert
May 17th, 2010, 10:42 AM
I was hoping someone with knowledge of compilation can help here. I have asked on the ffmpeg lists, but thought I'd ask here as well.

I am writing my own little bash transcoder script, that I want to be able to distribute to anyone that wishes to use it. One of the features I want it to have, is to always use the latest versions of ffmpeg and x264. I was thinking, what I'd like to do is download the source and compile x264 and ffmpeg in a local folder, but not to install it. So the script uses these most recent versions, but they don't get installed on the system so as not to mess up any other installs of ffmpeg on the system (and also meaning that the script doesn't need to run as root after the initial run).

I can compile x264 on its own, but if I want to compile ffmpeg to use x264, how can I tell it where the libx264 sources are located, if I haven't installed them? I have had a look through the ffmpeg configure option and there seems to be no such option. Is what I am trying to do impossible?

towerboy
May 17th, 2010, 09:24 PM
Hi towerboy,

Does adding -ar 44100 to your aac options help?

Andrew

Hey Andrew,
Thanks for that little bit of info. It did convert the file but it wouldn't play smoothly on my netbook so I had to use "-s 640x360" and it plays just fine. When it did convert it though it gave this warning:

Warning, using s16 intermediate sample format for resampling
I'm not sure if that's good or bad so if anyone knows and can let me know, thanks. Again, thank you Andrew for your help!

-Jeremy

FakeOutdoorsman
May 17th, 2010, 11:15 PM
Thanks! I was trying to use wildcards (e.g. *.png instead of %04d.png).

Working now. Thanks again!


Hmmm... new problem...
Now it's segfaulting when I try to make an x264 file.
Here's what I'm sending it:
and here's what it's giving me:


When I remove the -vpre argument it says:

... and doesn't segfault, but doesn't do anything, either...

Late reply. I've been out of town for a week. Did you ever resolve this issue?

qyot27
May 18th, 2010, 04:08 AM
I was hoping someone with knowledge of compilation can help here. I have asked on the ffmpeg lists, but thought I'd ask here as well.

I am writing my own little bash transcoder script, that I want to be able to distribute to anyone that wishes to use it. One of the features I want it to have, is to always use the latest versions of ffmpeg and x264. I was thinking, what I'd like to do is download the source and compile x264 and ffmpeg in a local folder, but not to install it. So the script uses these most recent versions, but they don't get installed on the system so as not to mess up any other installs of ffmpeg on the system (and also meaning that the script doesn't need to run as root after the initial run).

I can compile x264 on its own, but if I want to compile ffmpeg to use x264, how can I tell it where the libx264 sources are located, if I haven't installed them? I have had a look through the ffmpeg configure option and there seems to be no such option. Is what I am trying to do impossible?
That's what --extra-cflags and --extra-ldflags are for (--extra-cflags is also used to perform C code optimization for the given CPU*). --extra-cflags points to the /include folder for the install, --extra-ldflags points to the /lib directory. Also, x264 and FFMS2's PKG_CONFIG_PATH variables allow for this too, in reference to FFMS2 finding a stripped-down version of ffmpeg and x264 finding both that same ffmpeg and FFMS2.

The other point, is that 'make install', despite 'install' being in the command, doesn't mean one has to be root or that it mucks with the system libs/apps/etc. For instance, when you compile x264,

./configure --prefix=$HOME/x264_build
make
make install
because you specified $HOME/x264_build as the prefix, the 'make install' step will install x264 to $HOME/x264_build instead of the system. Now, when compiling ffmpeg, you would do,

./configure --prefix=$HOME/x264_build [other options] --enable-libx264 --extra-cflags="-I$HOME/x264_build/include" --extra-ldflags="-L$HOME/x264_build/lib"
make
make install
which should allow ffmpeg to find the x264 stuff you just installed AND install ffmpeg to $HOME/x264_build as well. You'd find the ffmpeg executable in $HOME/x264_build/bin, and need to run it by cd-ing into the directory and calling it like so:

./ffmpeg
The ./ is required because the executable is not on the system PATH.

None of that requires root access.



*Using --extra-cflags for CPU optimization looks like this (for a Pentium 3 and other P3-family CPUs, like the Celeron Coppermine I have in my computer; change this depending on what CPU/family you use - the list of possible options is available in the documentation for GCC (http://gcc.gnu.org/onlinedocs/gcc-4.4.4/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options)):

--extra-cflags="-march=pentium3"
If you wanted to double this up, like with ffmpeg finding x264's files, it looks like this:

--extra-cflags="-I$HOME/x264_build/include -march=pentium3"

poltr1
May 18th, 2010, 12:54 PM
Just adding my voice to the choir of satisfied FFmpeg and x264 users. I installed it last night on my Compaq Presario M2000 laptop running Lucid. it took a while, but it was worth the wait. Sound Converter can now create mp3 files.

Thank you, FakeOutdoorsman!

avollmerhaus
May 19th, 2010, 10:57 AM
Hello folks.

At first, a big thank to FakeOutdoorsman for the excellent guide.
Compiling and installing worked flawless.

However, i have to call ffmpeg trough transcode, which in turn gets called by dvd::rip.

I´m getting this when i try to encode something:


export_ffmpeg.so Using FFMPEG codec 'h264' (FourCC 'h264', H264 (avc)).
export_ffmpeg.so No profile selected
export_ffmpeg.sowarning: Error opening configuration file ./ffmpeg.cfg: No such file or directory
export_ffmpeg.so Starting 1 thread(s)
export_ffmpeg.so Set display aspect ratio to input
[libx264 @ 0x230d940]broken ffmpeg default settings detected
[libx264 @ 0x230d940]use an encoding preset (vpre)
export_ffmpeg.so warning: could not open FFMPEG codec
encoder.cwarning video export module error: init failed
transcode critical: failed to init encoder

I´m really stuck on this. Would writing an ffmpeg.cfg help?
If so, what to put in there?

verb3k
May 23rd, 2010, 09:37 PM
Hi FakeOutdoorsman,

I've been meaning to ask this for some time. Why doesn't the guide build with libvorbis?

FakeOutdoorsman
May 23rd, 2010, 11:14 PM
Hi FakeOutdoorsman,

I've been meaning to ask this for some time. Why doesn't the guide build with libvorbis?

Good question. I don't remember why I removed it (or if I even had it there previously), but I put it back for the Lucid guide. I'll add it for the older releases in a few days probably. My test run worked fine:

ffmpeg -i IronMan.mkv -vn -acodec libvorbis -aq 5 ironman.ogg
The FFmpeg devs usually recommend using -acodec libvorbis instead of the native -acodec vorbis encoder due to output quality differences, but I've never tested the difference myself.

FakeOutdoorsman
May 24th, 2010, 05:38 AM
I'm planning on making a FFmpeg version of andrew.46's Top 10 Tricks and Tips for the svn MPlayer (http://ubuntuforums.org/showthread.php?t=1154431). I just need to organize my ~/ffmpegjunk file into something useful for a general audience. I would also like submissions from other forum members. Some tips I have include: changing the speed of a video, trimming, looking at the FFmpeg svn log, checking out a specific FFmpeg revision, piping to or from FFmpeg, and several others.

Could be an interesting guide.

nicolargo
May 24th, 2010, 10:15 AM
Hi all,

i write a simple shell script to install (ffmpeginstall.sh (http://svn.nicolargo.com/ubuntupostinstall/trunk/ffmpeginstall.sh)) and update (ffmpegupdate.sh (http://svn.nicolargo.com/ubuntupostinstall/trunk/ffmpegupdate.sh)) all the stuffs: FFMPEG, X264...

Tested on Ubuntu 10.04 Lucid.

Waiting for feedbacks...

wingnux
May 24th, 2010, 04:31 PM
Your script works great! Thanks for sharing it.

FakeOutdoorsman
May 24th, 2010, 06:06 PM
Hi all,

i write a simple shell script to install (ffmpeginstall.sh (http://svn.nicolargo.com/ubuntupostinstall/trunk/ffmpeginstall.sh)) and update (ffmpegupdate.sh (http://svn.nicolargo.com/ubuntupostinstall/trunk/ffmpegupdate.sh)) all the stuffs: FFMPEG, X264...

Tested on Ubuntu 10.04 Lucid.

Waiting for feedbacks...

You could add -y to the apt-get install commands to have fewer prompts for the user, but that my not be desired by everyone.

Because your script is for Lucid, I recommend adding something that will make sure the script runs only on Lucid. Maybe something like:

if [ "echo lsb_release -cs" != "lucid" ]; then
echo "You are not using Ubuntu Lucid 10.04. Exiting."
exit
fi

Adding set -e as the first command could be useful allowing the script to exit upon any errors instead of continuing blindly. However, running make distclean in an already clean directory when using set -e may cause the script to exit. I'm not sure how to deal with that.

Jart44
May 24th, 2010, 07:43 PM
Greetings,
Re: Uninstall Instructions

In Synaptic Manager when I try to uninstall current ffmpeg I notice that it warns that all other video such as Avidemux, SMPlayer and other devices will be disabled. Does this mean I will have to recompile these also? Or is it done automatically when I enter the new script?

Thanks

mc4man
May 24th, 2010, 10:01 PM
when I try to uninstall current ffmpeg I notice that it warns that all other video such as Avidemux, SMPlayer and other devices will be disabled

That's very atypical, the list of apps that depend on ffmpeg itself is very short and none you've mentioned.

you could run this and post (answer no if a lot is to be removed


sudo apt-get remove ffmpeg

Jart44
May 26th, 2010, 01:10 AM
Thanks,
Terminal input> sudo apt-get remove ffmpeg
did the trick. Now I'll move on to the install.
Kudos

mahela007
May 31st, 2010, 02:42 PM
Isn't there a way around building from source? Other instructions I have read say that ffmpeg (with all the proprietary codes) should be available in the universe (or multiverse) repository. It could have been mentioned in this thread but it is a hundred pages long...

NEVERMIND.. I found the answer in post #1

Tybion
June 1st, 2010, 09:54 AM
Should you add the (optional) step -
sudo apt-get install libgpac-dev
before running ./configure ?

Only after I did this, configure reported -
MP4 output: Yes

FakeOutdoorsman
June 1st, 2010, 08:30 PM
Should you add the (optional) step -
sudo apt-get install libgpac-dev
before running ./configure ?

Only after I did this, configure reported -
MP4 output: Yes

You only need libgpac-dev if you want to directly use x264 to output to .mp4.

andrew.46
June 3rd, 2010, 12:38 AM
Looks like the FFmpeg developers are really getting close to the cutting edge of x264 now:


enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 -lm &&
{ check_cpp_condition x264.h "X264_BUILD >= 98" ||
die "ERROR: libx264 version must be >= 0.98."; }

Andrew

qyot27
June 3rd, 2010, 07:26 AM
My guess is because it's probably a major enough bugfix/change to warrant it.

http://git.ffmpeg.org/?p=ffmpeg;a=commit;h=4cb7dfdb79fab67484e789d40e9f6 4b953a701e8


Properly initialize x264_picture_t in libx264.

Bump libx264 version requirement accordingly.

I'm simply assuming that x264_picture_t is a critical function.

@H.264
June 4th, 2010, 03:46 PM
I'm having problem regarding x264 with ffms support.
Can someone help me out how to install ffmpeg and x264 with ffms support?

FakeOutdoorsman
June 4th, 2010, 06:32 PM
I'm having problem regarding x264 with ffms support.
Can someone help me out how to install ffmpeg and x264 with ffms support?

What have you tried so far and what kind of problems are you experiencing? What version of Ubuntu are you using?

qyot27
June 4th, 2010, 06:52 PM
I'm having problem regarding x264 with ffms support.
Can someone help me out how to install ffmpeg and x264 with ffms support?
http://ubuntuforums.org/showpost.php?p=8916353&postcount=900

The only thing that needs changing is to take out the --disable-filters option in the first FFmpeg compile. And of course adding any additional decoding/encoding libraries you might want to the relevant FFmpeg (only decoders for the first one, decoders and encoders for the second).

Works on Karmic and Lucid, or should (I migrate up to the next version immediately, so I know it works on Lucid; it worked on Karmic when I wrote those steps back in March).

verb3k
June 5th, 2010, 12:16 AM
Now it is possible to produce a WebM-compliant file with latest ffmpeg SVN if you build with libvpx and libvorbis. It can be as simple as:

ffmpeg -i input output.webm
Plays nicely in Firefox's WebM build.
The only problem is that I can't find how to disable frame dropping of libvpx. Libvpx drops frames by default so your video might be choppy in some high motion areas.

FakeOutdoorsman
June 5th, 2010, 12:30 AM
Now it is possible to produce a WebM-compliant file with latest ffmpeg SVN if you build with libvpx and libvorbis. It can be as simple as:

ffmpeg -i input output.webm
Plays nicely in Firefox's WebM build.
The only problem is that I can't find how to disable frame dropping of libvpx. Libvpx drops frames by default so your video might be choppy in some high motion areas.

I plan on adding a libvpx section to the guide soon. I was waiting for the muxer to be finished. Yeah, that's my excuse:

$ svn log -l 24 svn://svn.mplayerhq.hu/ffmpeg/trunk
------------------------------------------------------------------------
r23474 | conrad | 2010-06-04 14:40:54 -0800 (Fri, 04 Jun 2010) | 3 lines

Add WebM muxer

Patch by James Zern <jzern at google>
------------------------------------------------------------------------

As requested through a PM, I will also add qt-faststart installation instructions once I can figure out an elegant package management solution. It's tasks like this that make me especially admire the ports-like capable systems such as Arch and Slackware (amirite, andrew.46? da.). This little FFmpeg tool moves the moov atom to the beginning of a file so it can start playing before it is completely downloaded. Useful for web videos. Usage: qt-faststart input.foo output.foo.

Update: I added a qt-faststart section to the Lucid guide. It's a somewhat messy way of doing it, but I can't make myself use checkinstall more than I have to. Anyone have a better method that works with Ubuntu package management, or is this Good Enough?

verb3k
June 5th, 2010, 01:09 AM
EDIT:wrong post.

FakeOutdoorsman
June 5th, 2010, 02:46 AM
Preliminary libvpx Installation Instructions

I quickly came up with a libvpx guide, tested on Lucid 64-bit, but I didn't get to mess with it as much as I wanted before other, less interesting things got in the way.

1. Install x264. Not required, but I added this to keep up with the first page of this guide.

2. Install libvpx from git.

cd
git clone git://review.webmproject.org/libvpx.git
cd libvpx
./configure
make
sudo checkinstall --pkgname=libvpx --pkgversion="`date +%Y%m%d%k%M`-git" --backup=no --nodoc --default

3. Install FFmpeg. Make sure to add:

--enable-libvpx
The --enable-nonfree may not be required once the license gets cleared up. libvpx is now under a (L)GPL-compatible license.

4. Encode to .webm:

ffmpeg -i input.foo -threads 4 output.webm
Replace -threads 4 with a value appropriate for your CPU or omit --threads.

Update: These instructions have been moved to the first page (http://ubuntuforums.org/showthread.php?t=786095) of the guide and will be kept up to date there.

verb3k
June 5th, 2010, 02:58 AM
Nice instructions. libvpx supports 2-pass encoding which results in much better quality than 1-pass. Until now -b -pass and -threads are the only optinos I use with libvpx. I wonder if there are any other. Also, if you could look into the framedrop issue and how to disable it, I would be very grateful.

Thanks.

Locke_99GS
June 5th, 2010, 06:00 AM
I've never used checkinstall before, I generally compile and package debianized source with dpkg-buildpackage, and debianize if needed with dh_make. Sometime dh_make is flakey.

Going purely by your instructions, checkinstall fails after a good make.



locke@locke-desktop:~/Build/libvpx$ sudo checkinstall --pkgname libvpx --pkgversion `date +%Y%m%d%k%M`-git --backup=no --nodoc --default

checkinstall 1.6.1, Copyright 2002 Felipe Eduardo Sanchez Diaz Duran
This software is released under the GNU GPL.


The package documentation directory ./doc-pak does not exist.
Should I create a default set of package docs? [y]: n

*****************************************
**** Debian package creation selected ***
*****************************************

This package will be built according to these values:

0 - Maintainer: [ root@locke-desktop ]
1 - Summary: [ library for VP8 ]
2 - Name: [ libvpx ]
3 - Version: [ 20100605 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ checkinstall ]
7 - Architecture: [ amd64 ]
8 - Source location: [ libvpx ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ libvpx ]

Enter a number to change any of them or press ENTER to continue:

Installing with 057-git...Installing with --backup=no...Installing with --nodoc...Installing with --default...

========================= Installation results ===========================
/var/tmp/tmp.w1jKmKcH6i/installscript.sh: 4: 057-git: not found

**** Installation failed. Aborting package creation.

Cleaning up...OK

Bye.


Ideas?

FakeOutdoorsman
June 5th, 2010, 06:25 AM
I've never used checkinstall before, I generally compile and package debianized source with dpkg-buildpackage, and debianize if needed with dh_make. Sometime dh_make is flakey.
I haven't used dpkg-buildpackage or dh_make before. I'll take a look at those. One of these days I should attempt to learn how to properly wrangle Debian type package management, but it's fairly low on the todo list.


Going purely by your instructions, checkinstall fails after a good make.


Installing with 057-git...Installing with --backup=no...Installing with --nodoc...Installing with --default...

========================= Installation results ===========================
/var/tmp/tmp.w1jKmKcH6i/installscript.sh: 4: 057-git: not found

Ideas?

Looks like it may not have liked the --pkgversion. Try changing it to a simple number. What version of Ubuntu are you using? I should have mentioned that I tested it only on Lucid 64-bit.

Update: I realized I forgot to put quotes around the pkgversion, although I'm fairly sure it worked for me before. I'm away from my Ubuntu machine, so I can't test now. I updated the checkinstall command in my libvpx post.

Locke_99GS
June 5th, 2010, 07:20 AM
Heh, I just figured it out. :) To tell you the truth, after cutting and pasting your instructions and seeing the no-go, I just moved on to other things.

In post 1042, your checkinstall arguments include --pkgname libvpx, when in fact it should be --pkgname=libvpx. A simple typographical error, it looks like. After adding the equals sign where appropriate, checkinstall appears to have done its thing.

Time to recompile ffmpeg :)


edit: Not that it matters now, but I am also using Lucid 64bit.

TBerk
June 5th, 2010, 08:08 AM
Looks like the FFmpeg developers are really getting close to the cutting edge of x264 now:


enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 -lm &&
{ check_cpp_condition x264.h "X264_BUILD >= 98" ||
die "ERROR: libx264 version must be >= 0.98."; }

Andrew

This is where I too grind to a halt. I've read the rest of the post to date (Midnight, GMT -8) but I don't see a fix to enabling support for x264.

(I press because support for x264 is one of the main things I'm doing this for.)


ERROR: libx264 version must be >= 0.98.


Help Mr. Wizard!


TBerk
================

OK, I went back and deleted the ffmpeg and x264 directories (and the contents there of) and tried again. As I type this update it seems to be working, re: running "make".

OK, it's 12:40 in the morning and I seem to have a good install. Key point was to remove the directories I had left from the 1st time I did this install prior to the 'new' install.
<end>

mc4man
June 6th, 2010, 12:47 AM
As far as libvpx -
one thing to keep in mind is it is/will start showing up on ubuntu installs depending on which and or if certain ppa's are enabled

It's included in 10.10, and provided in karmic and or lucid by the gstreamer-devs ppa ( updated regularly ), and the chromium-daily ppa ( not a quick as the gst-dev's

So it may be worth seeing if any of the above libvpx and libvpx-dev do the job, or keep in mind if building.

https://launchpad.net/~gstreamer-developers/+archive/ppa/+packages

andrew.46
June 6th, 2010, 07:11 AM
Hi Fakeoutdoorsman,

I will admit that I am still between Ubuntu installations but certainly on my other distro I added in the compiler flags on the ./configure string as follows for 32bit:


./configure --target=x86-linux-gcc

and I presume the following would work with 64bit:


./configure --target=x86_64-linux-gcc

but I confess I will not be testing to see if this is required under Ubuntu as I have no short-term plans to reinstall :(.

Another short note: I have not investigated extensively to see the exact reason but I suspect if you run make with sudo the html docs will be built.

All the best,

Andrew

FakeOutdoorsman
June 6th, 2010, 07:22 PM
Hi Fakeoutdoorsman,

I will admit that I am still between Ubuntu installations but certainly on my other distro I added in the compiler flags on the ./configure string as follows for 32bit:


./configure --target=x86-linux-gcc

and I presume the following would work with 64bit:


./configure --target=x86_64-linux-gcc

but I confess I will not be testing to see if this is required under Ubuntu as I have no short-term plans to reinstall :(.
Hi Andrew,

I also did this when I first tested libvpx a week or two ago, but this time I tried it and I think it automatically detected the proper target on Lucid x86_64. I had to rush through this and maybe it actually didn't. I'll have to test this later tonight.


Another short note: I have not investigated extensively to see the exact reason but I suspect if you run make with sudo the html docs will be built.

All the best,

Andrew
I added --disable-install-docs because the readme mentioned PHP and doxygen (or something like that) as doc dependencies (or something like that). Wow, I can't remember anything if it isn't directly in front of me. I'll try it without this next time and see what happens.

Looks like libvpx now has a (L)GPL-compatible license (http://git.ffmpeg.org/?p=ffmpeg;a=commit;h=c79ad3522baaf203f5b8937462329 8fb6a84d215) which probably makes --enable-nonfree unnecessary for libvpx.

FakeOutdoorsman
June 6th, 2010, 07:25 PM
As far as libvpx -
one thing to keep in mind is it is/will start showing up on ubuntu installs depending on which and or if certain ppa's are enabled

It's included in 10.10, and provided in karmic and or lucid by the gstreamer-devs ppa ( updated regularly ), and the chromium-daily ppa ( not a quick as the gst-dev's

So it may be worth seeing if any of the above libvpx and libvpx-dev do the job, or keep in mind if building.

https://launchpad.net/~gstreamer-developers/+archive/ppa/+packages

Thanks. I'll keep this in mind if libvpx becomes annoying to build, but I usually avoid PPAs. Might be useful for some users though.

FakeOutdoorsman
June 7th, 2010, 05:12 AM
Nice instructions. libvpx supports 2-pass encoding which results in much better quality than 1-pass. Until now -b -pass and -threads are the only optinos I use with libvpx. I wonder if there are any other. Also, if you could look into the framedrop issue and how to disable it, I would be very grateful.

Thanks.

I didn't figure out how to disable frame droppings, but this patch will probably be applied soon:

[FFmpeg-devel] [PATCH] libvpx: Disable frame dropping as rate control method (https://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2010-June/090152.html)

kamatschka
June 10th, 2010, 12:21 AM
Thank you for this Tutorial.
I used it for Carmic and now for Lucid.

With Carmic I got no errors on KDEnlive rendering MPEG4 or DivX etc. but now I cannot render into the most formats.

Here the screenshots of the error which I get at KDEnlive whith the installation of ffmpeg and x264.

"Nicht unterstützter" means "Not supported"

http://img444.imageshack.us/img444/3752/bildschirmfotorendern.png_http://img808.imageshack.us/img808/2548/bildschirmfotorendern1.png
http://img28.imageshack.us/img28/9927/bildschirmfotorendern4.png_http://img813.imageshack.us/img813/9009/bildschirmfotorendern3.png

Executing "ffmpeg -formats |grep aac:" in terminal gets:

FFmpeg version SVN-r23548, Copyright (c) 2000-2010 the FFmpeg developers
built on Jun 9 2010 11:41:56 with gcc 4.4.3
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab
libavutil 50.18. 0 / 50.18. 0
libavcodec 52.75. 1 / 52.75. 1
libavformat 52.68. 0 / 52.68. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.20. 0 / 1.20. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0




Is there something which I could done wrong following your tutorial?. It compiled and installed propperly..
Does anyone have a clue how to resolve this issue?


Thank you very much. Greetings from germany as you can see from the screenshots! :D ):P

andrew.46
June 11th, 2010, 01:50 AM
Hi,

Fakeoutdoorsman's guide lured me to FFmpeg a long time ago but it might be of interest for some to hear that it is now possible to use presets to transcode with x264 in the latest svn MEncoder...

Andrew

mocha
June 13th, 2010, 07:47 AM
Hi,

Fakeoutdoorsman's guide lured me to FFmpeg a long time ago but it might be of interest for some to hear that it is now possible to use presets to transcode with x264 in the latest svn MEncoder...

Andrew

As my Russian computer science professor used to say, "how to do?" Please enlighten us Andrew.46.

cor2y
June 17th, 2010, 02:08 AM
Thank you for this Tutorial.
I used it for Carmic and now for Lucid.

With Carmic I got no errors on KDEnlive rendering MPEG4 or DivX etc. but now I cannot render into the most formats.

Here the screenshots of the error which I get at KDEnlive whith the installation of ffmpeg and x264.

"Nicht unterstützter" means "Not supported"

http://img444.imageshack.us/img444/3752/bildschirmfotorendern.png_http://img808.imageshack.us/img808/2548/bildschirmfotorendern1.png
http://img28.imageshack.us/img28/9927/bildschirmfotorendern4.png_http://img813.imageshack.us/img813/9009/bildschirmfotorendern3.png

Executing "ffmpeg -formats |grep aac:" in terminal gets:




Is there something which I could done wrong following your tutorial?. It compiled and installed propperly..
Does anyone have a clue how to resolve this issue?


Thank you very much. Greetings from germany as you can see from the screenshots! :D ):P

You need to combine both the kdenlive compiling ffmpeg tutorial and fakeoutdoorsman's.
Thats what worked for me.

cmay4
June 20th, 2010, 07:49 PM
Trying to do an update (it's been a while), and I get the following on the configure step:


~/src/ffmpeg$ ./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
Unknown option "--enable-libfaad".The faad option is totally gone. I tested by looking at all the options:


~/src/ffmpeg$ ./configure --help | grep faa
--enable-libfaac enable FAAC support via libfaac [no]I removed the option an am compiling fine now. Any idea why that option no longer exists? Do the main instructions need to be updated?

mc4man
June 20th, 2010, 08:33 PM
Probably this - (r23652 )

doug@doug-desktop:~/ffmpeg$ svn log --limit 20 |grep libfaad
ChangeLog: note libfaad wrapper removal
Remove libfaad wrapper

cmay4
June 20th, 2010, 08:39 PM
I guess that means that it isn't needed anymore.i suppose the docs should be updated then.

verb3k
June 20th, 2010, 08:49 PM
I guess that means that it isn't needed anymore.i suppose the docs should be updated then.

It's not needed anymore because FFmpeg's native AAC decoder now supports all features of AAC.

cmay4
June 20th, 2010, 08:50 PM
It's not needed anymore because FFmpeg's native AAC decoder now supports all AAC features.

Awesome. Thanks!

FakeOutdoorsman
June 20th, 2010, 08:55 PM
Guide updated by removing libfaad as a dependency. It's nice to see fewer external libraries needed. Thanks for letting me know. I'm out of town and haven't been keeping up with FFmpeg developments.

verb3k
June 20th, 2010, 09:07 PM
Native VP8 decoder underway already :)
http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2010-June/090751.html

prupert
June 23rd, 2010, 12:00 PM
Guide updated by removing libfaad as a dependency. It's nice to see fewer external libraries needed. Thanks for letting me know. I'm out of town and haven't been keeping up with FFmpeg developments.

So, did you just remove the --enable-libfaad option from ffmpeg ./configure or where there more changes?

Cheers.

FakeOutdoorsman
June 23rd, 2010, 06:45 PM
So, did you just remove the --enable-libfaad option from ffmpeg ./configure or where there more changes?

Cheers.

I also removed libfaad-dev from the Install the Dependencies and the Reverting Changes Made by This Guide sections.

meklu
June 23rd, 2010, 07:13 PM
# Ignore. I had accidentally installed x264 from the repos.

prupert
June 23rd, 2010, 09:15 PM
I also removed libfaad-dev from the Install the Dependencies and the Reverting Changes Made by This Guide sections.

Of course, cool, cheers - updating my script to reflect the changes.

Bachstelze
June 25th, 2010, 08:14 AM
So, finally, here's how to make kosher ffmpeg packages. :) Note that this is only for the ffmpeg source package so far, and therefore does not build the -unstripped versions of the libraries yet (those are in the ffmpeg-extras source package). I'll do ffmpeg-extras later, probably after the RMLL.

For the impatient, the result is here (ftp://iori.fkraiem.org/pub/ffmpeg/r23766/). Testing is of course welcome.

So here's a quick howto. First get the source. We use svn export instead of svn checkout so as to not be bothered by the svn metadata. Of course, this means that you will not be able to just svn update your tree. Fine with me, Internet is fast nowadays.


svn export svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg

It's probably a good idea (though not required) to rename the created ffmpeg directory with the revision number, something like


mv ffmpeg ffmpeg-r23767

Then you must create your original source tarball


tar czvf ffmpeg_0.svn.r23767.orig.tar.gz ffmpeg-r23767

This is the version numbering scheme I use: 0.svn.rXXXXX-1firasX. It is of course totally arbitrary, and you can use another one if you don't like it (but it would be nice to not have over 9000 of them, so that people can seamlessly upgrade packages built by someone with packages built by someone else). The part after the hyphen can be customized at will, but it needs to start with a number (it will probably not be necessary to set it higher than 1, I don't think there will be many different packagings of the same revision).

Move in the source directory, and create the debian/ directory, that will be used for packaging. You probably don't want to create it from scratch yourself, so you can use mine:


cd ffmpeg-r2376
wget ftp://iori.fkraiem.org/pub/ffmpeg/r23766/ffmpeg_0.svn.r23766-1firas1.diff.gz -O - | gunzip | patch -p1

It will create the debian/ dir. You still have some work to do, though. ;) So get in there


cd debian

First thing is to edit the changelog to reflect your changes and increase the version number:


vim changelog

Add an entry usng my last one as a model. Normally you'll need at least a "new upstream snapshot" line, possibly some API bumps (there were two in mine, more about that later), your new version number, name, email address and the current date in RFC2822 format (as given by date -R), so something like:


ffmpeg (5:0.svn.r23767-1chucknorris1) lucid; urgency=low

* new upstream snapshot

-- Chuck Norris <chuck@norris.org> Fri, 25 Jun 2010 08:46:38 +0200

Note that normally, you need a GPG key with that name and email address, that will be used to sign your source package. It's always a good idea to have one as it is required if you want to put your packages on a PPA on Launchpad for example, but it is not an absolute requirement (your packages will still build fine without one). If you want to get one but don't know how, see for example this guide (http://www.gentoo.org/doc/en/gnupg-user.xml).

Also change the Maintainer field in the control file.

Now for the only really tricky part: checking for API bumps and updating the debian/ dir if there is one. I'll take the example of libavutil. In the debian/ dir, you have:


% ls libavutil*
libavutil50.install libavutil50.lintian-overrides libavutil-dev.install


You check for the current libavutil version with


% grep VERSION_MAJOR ../libavutil/avutil.h
#define LIBAVUTIL_VERSION_MAJOR 50
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
#define LIBAVUTIL_VERSION AV_VERSION(LIBAVUTIL_VERSION_MAJOR, \


libavutil is still at version 50, good. If it were at version 51, you'd have to do two things: first rename the libavutil50* files to libavutil51*


rename s/50/51/ libavutil50*

and then change all occurrences of libavutil50 to libavutil51 in control:


sed -i 's/libavutil50/libavutil51/g;s/libavutil-extra-50/libavutil-extra-51/g' control

Do the same for all libraries.

Hopefully, that's all you need so you can build your packages:


cd ..
debuild

Optionally, if you want to add moar configure flags, you must: add the flags to debian/confflags under "# Common configuration flags" and if a new confflag adds a dependency on another library, add the package for that library in the Build-Depends section of debian/control. It is probably possible to add all the libraries you need there, which will render the -unstripped versions useless.

prupert
June 25th, 2010, 09:23 AM
So, finally, here's how to make kosher ffmpeg packages. :)

Out of interest, why would someone want to do this - what are the advantages??

dannyboy79
June 25th, 2010, 07:36 PM
i am going to ask the same question also. i am having a huge mess trying to get --enable-shared working because of external libraries or something like that. all my library files in /usr/local/lib/ are empy so when i run ldconfig it fails with the following
sudo ldconfig
/sbin/ldconfig.real: File /usr/lib/libavutil.so.49 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/libavformat.so.52 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/libavfilter.so.0 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/libavfilter.so.0.4.0 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/libavdevice.so.52.1.0 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/libavdevice.so.52 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/libavformat.so.52.31.0 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/libavutil.so.49.15.0 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/libavcodec.so.52 is empty, not checked.
/sbin/ldconfig.real: File /usr/lib/libavcodec.so.52.20.1 is empty, not checked.



and my ffmpeg doesn't work because it says this

-bash: /sbin/ldconfig.real:: No such file or directory
root@core2duo:/home/daniel# /sbin/ldconfig.real: File /usr/lib/libavfilter.so.0 is empty, not checked.
-bash: /sbin/ldconfig.real:: No such file or directory

so, i am asking what is the main advantage of compileing ffmpeg with the --enable-shared option? I only want to make videos (edit, add transitions, and music) from captured files using kino and firewire so that i can upload them to youtube. do i even need --enable-shared?
thanks for any help anyone can provide?

qyot27
June 25th, 2010, 08:32 PM
It is not necessary to compile ffmpeg with --enable-shared, but if you want updated versions of libav[format/codec/util/etc] in programs that do read said shared libraries, it probably works as an update for them. I never compile it shared. Static compilation (which is the default) is far less trouble, IMO.


Out of interest, why would someone want to do this - what are the advantages??
Because checkinstall doesn't always complete successfully, and I'm not sure if checkinstall-produced builds are acceptable for repository submission. I assume they aren't, though.

Bachstelze
June 25th, 2010, 08:44 PM
Also, it allows to use programs in the repos with newer ffmpeg without recompiling the program. A lot of people in this thread hated the fact that some package depended on a particular libav* package, but their checkinstall'ed ffmpeg didn't provide it.

mc4man
June 25th, 2010, 09:36 PM
You should probably remove from orig. diff
+# there is no libfaad in ubuntu/main, on in ubuntu/multiverse
+gpl_confflags += $(call cond_enable,/usr/include/faad.h,libfaad)
or make adjustment before build in confflags file

The value of newer shared ffmpeg libs may depend of what your use of them is. - I've always done it at least once per install since hardy though some apps will require a re-build against. Overall the value is limited from what I've seen, less now than in hardy.

Would be interested in hearing of any specific gains in dependent apps (without a re-build

verb3k
June 25th, 2010, 10:40 PM
Thanks Firas. I've been looking into this just yesterday. :D It really bothers me that anything from the repo that depended on ffmpeg tried to install libav* while I already have them.

Peace be with you.

Stoneface
June 27th, 2010, 02:13 PM
Doing the 10.04 ffmpeg + x264 tutorial on Ubuntu 10.10 Maverick:
me@ubuntu:/etc$ cat lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.10
DISTRIB_CODENAME=maverick
DISTRIB_DESCRIPTION="Ubuntu maverick (development branch)" and get stuck in the end as it seems not to be able to find x264 even though I followed all steps:

me@ubuntu:~$ cd ffmpeg
me@ubuntu:~/ffmpeg$ ./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
ERROR: libx264 not found

If you think configure made a mistake, make sure you are using the latest
version from SVN. If the latest version fails, report the problem to the
ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem.

Read http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2009-June/021190.html and reading http://ubuntuforums.org/showthread.php?p=8818886 . Maybe user prefix should be added during x264 configuration?

Stoneface
June 27th, 2010, 02:39 PM
Found one error during the x264 installation:
~/x264$ sudo checkinstall --pkgname=libvpx --pkgversion="`date +%Y%m%d%k%M`-git" --backup=no --nodoc --default

checkinstall 1.6.2, Copyright 2009 Felipe Eduardo Sanchez Diaz Duran
This software is released under the GNU GPL.



*****************************************
**** Debian package creation selected ***
*****************************************

*** Warning: The package version "20100627 637-git" is not a
*** Warning: debian policy compliant one. Please specify an alternate one

This package will be built according to these values:

0 - Maintainer: [ root@ubuntu ]
1 - Summary: [ Package created with checkinstall 1.6.2 ]
2 - Name: [ libvpx ]
3 - Version: [ 0 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ checkinstall ]
7 - Architecture: [ i386 ]
8 - Source location: [ x264 ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ libvpx ]
12 - Conflicts: [ ]
13 - Replaces: [ ]

Enter a number to change any of them or press ENTER to continue:

Installing with make install...

========================= Installation results ===========================
install -d /usr/local/bin
install -d /usr/local/include
install -d /usr/local/lib
install -d /usr/local/lib/pkgconfig
install: cannot change permissions of `/usr/local/lib/pkgconfig': No such file or directory
make: *** [install] Error 1

**** Installation failed. Aborting package creation.

Cleaning up...OK

Bye.


The culprit seems to be:
install: cannot change permissions of `/usr/local/lib/pkgconfig': No such file or directory So I did:
sudo mkdir /usr/local/lib/pkgconfig and tried to install x264 again and did so successfully. But I still got the same error installing ffmpeg: ERROR: libx264 not found:

~/ffmpeg$ ./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
ERROR: libx264 not found

If you think configure made a mistake, make sure you are using the latest
version from SVN. If the latest version fails, report the problem to the
ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem.

Cleaned all started all over again. added --prefix=/user to configuration of ffmpeg:
./configure --prefix=/usr --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab

and that worked:


install prefix /usr
source path /home/me/ffmpeg
C compiler gcc
ARCH x86 (generic)
big-endian no
runtime cpu detection no
yasm yes
MMX enabled yes
MMX2 enabled yes
3DNow! enabled yes
3DNow! extended enabled yes
SSE enabled yes
SSSE3 enabled yes
CMOV enabled no
CMOV is fast no
EBX available yes
EBP available no
10 operands supported yes
debug symbols yes
strip symbols yes
optimizations yes
static yes
shared no
postprocessing support yes
new filter support yes
filters using lavformat no
network support yes
threading support pthreads
SDL support yes
Sun medialib support no
AVISynth enabled no
libdc1394 support no
libdirac enabled no
libfaac enabled yes
libgsm enabled no
libmp3lame enabled yes
libnut enabled no
libopencore-amrnb support yes
libopencore-amrwb support yes
libopenjpeg enabled no
librtmp enabled no
libschroedinger enabled no
libspeex enabled no
libtheora enabled yes
libvorbis enabled yes
libvpx enabled yes
libx264 enabled yes
libxvid enabled yes
zlib enabled yes
bzlib enabled no

Enabled decoders:
aac dxa mpegvideo
aasc eac3 msmpeg4v1
ac3 eacmv msmpeg4v2
adpcm_4xm eamad msmpeg4v3
adpcm_adx eatgq msrle
adpcm_ct eatgv msvideo1
adpcm_ea eatqi mszh
adpcm_ea_maxis_xa eightbps nellymoser
adpcm_ea_r1 eightsvx_exp nuv
adpcm_ea_r2 eightsvx_fib pam
----------- cut -----

License: nonfree and unredistributable
Creating config.mak and config.h...
Which did the trick for that particular step. then make (compiling) and installation went well

Bachstelze
June 27th, 2010, 02:48 PM
Also, --pkgversion="`date +%Y%m%d%k%M`-git" should be --pkgversion="`date +%Y%m%d%H%M`-git". Otherwise it inserts a space if the hour is < 10, which as the warning says makes a non-compliant version number.

mc4man
June 27th, 2010, 03:54 PM
checkinstall 1.6.2, (used now on maverick), has some issues as currently built, one is it can fail to create some dirs and or dir. tree's
(when doing totem-xine I needed to create several) - 1.6.1 doesn't have this issue

Mr_bleu
June 27th, 2010, 07:47 PM
Cannot read log file '/home/djr/video/dp.log-0.log' for pass-2 encoding: No such file or directory


Help. I've finally gotten ffmpeg running again and I get that error when I click convert using winff.

mc4man
June 27th, 2010, 11:23 PM
As far as Maverick - don't see any issues as mentioned in post 1076 with the exception of checkinstall 1.6.2 failing to create a dir. for x264 install. (/pkgconfig

All of the commands in post 1 are fine as is.

(note that Stoneface was using the checkinstall command for libvpx on x264 build -

There is no need to use a --prefix for ffmpeg, though certainly one could if desired.
(again noting libx264 was probably installed as libvpx initially, and would have caused ffmpeg config error

edit
bug report on ckinstall (https://bugs.launchpad.net/ubuntu/+source/checkinstall/+bug/599163) if anyone wants to test and confirm

FakeOutdoorsman
June 28th, 2010, 12:39 AM
Just got back from a two week trip. Time to re-compile!


So, finally, here's how to make kosher ffmpeg packages. :)...
Thanks for posting this. Interesting stuff.


Also, --pkgversion="`date +%Y%m%d%k%M`-git" should be --pkgversion="`date +%Y%m%d%H%M`-git". Otherwise it inserts a space if the hour is < 10, which as the warning says makes a non-compliant version number.
Guide updated. I didn't know %k would create a space, but now I see that it does in the man page. %H makes more sense anyway.


Cannot read log file '/home/djr/video/dp.log-0.log' for pass-2 encoding: No such file or directory


Help. I've finally gotten ffmpeg running again and I get that error when I click convert using winff.
Which version of WinFF are you using and which preset did you choose?


bug report on ckinstall (https://bugs.launchpad.net/ubuntu/+source/checkinstall/+bug/599163) if anyone wants to test and confirm
I have yet to even download Maverick, but I'll get it and try to confirm this.

qyot27
June 28th, 2010, 02:23 AM
Considering the checkinstall error relates to pkgconfig data getting installed, my gut impulse would be that the problem is simply that pkg-config itself isn't installed. x264 uses pkg-config to find ffmpeg and FFMS2 (which also uses pkg-config to find ffmpeg during its compile process).

Perhaps the problem is A) attempting to use a pre-packaged ffmpeg or FFMS without also installing pkg-config, A2) ffmpeg hasn't been completely purged (sudo apt-get purge ffmpeg, or Synaptic's 'Completely Remove' option) from the system before x264 gets compiled, resulting in pkgconfig erroring out, or B) x264 is trying to use pkg-config by default, and something concerning the lack of said package is causing the error.

If the above is indeed true, it's easily resolved:

sudo apt-get install pkg-config

Should be all that's required to fix it. Also remembering to always use sudo apt-get purge for uninstalling apps instead of sudo apt-get remove, since remove leaves configuration files behind and purge doesn't.

Mr_bleu
June 28th, 2010, 02:49 AM
Just got back from a two week trip. Time to re-compile!


Thanks for posting this. Interesting stuff.


Guide updated. I didn't know %k would create a space, but now I see that it does in the man page. %H makes more sense anyway.


Which version of WinFF are you using and which preset did you choose?


I have yet to even download Maverick, but I'll get it and try to confirm this.

version 1.2 according to help. I've tried ipod, psp, and mp4 presets.

FakeOutdoorsman
June 28th, 2010, 03:12 AM
install: cannot change permissions of `/usr/local/lib/pkgconfig': No such file or directory

You can avoid this error by adding --fstrans=no to your x264 checkinstall line on Ubuntu Maverick Meerkat 10.10 (or at least on Alpha 1). This was also required on an earlier Ubuntu version (either Jaunty or Intrepid).

mc4man
June 28th, 2010, 03:15 AM
Considering the checkinstall error relates to pkgconfig data getting installed, ...
Actually it's a pkgconfig dir. being created in /urs/local/lib, but as previously mentioned it happens with other dir/subdir as well with other builds.
(not all though, I've seen it create some.

If one had built to /usr/local previously and had a pkgconfig dir previously created then it wouldn't come up.

(pkg-config is part of the default install


You can avoid this error by adding --fstrans=no to your checkinstall lines on Ubuntu Maverick Meerkat 10.10 (or at least on Alpha 1). This was also required on an earlier Ubuntu version (either Jaunty or Intrepid).

I guess I'll have to go back to that ...
Tested on another build with half a dozen errors - fixed as well.

What is a bit of a pita is the config output for ffmpeg - started a ways back for shared builds - from maverick


ubuntu@ubuntu:~$ ffmpeg
FFmpeg version 0.6-4:0.6-1ubuntu1, Copyright (c) 2000-2010 the FFmpeg developers
built on Jun 22 2010 18:44:51 with gcc 4.4.4
configuration: --extra-version=4:0.6-1ubuntu1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
WARNING: library configuration mismatch
libavutil configuration: --extra-version=4:0.6-1ubuntu1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-x11grab --enable-libdc1394 --shlibdir=/usr/lib/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay
ect
ect
ect.
repeated for all shared libs


Maybe there's a way to clean that up

FakeOutdoorsman
June 28th, 2010, 04:08 AM
version 1.2 according to help. I've tried ipod, psp, and mp4 presets.

I installed WinFF 1.2 on Lucid, but I don't see any PSP or MP4 presets. The iPod presets I did see however are archaic and did not work for FFmpeg SVN:

[NULL @ 0x1ad6460] [Eval @ 0x7fffcd45bab0] Invalid chars 'b' at the end of expression '112kb'
[NULL @ 0x1ad6460] Unable to parse option value "112kb"
Invalid value '112kb' for option 'ab'
In this case, the b is superfluous and 112kb in the preset should be changed to 112k.

I'm not very familiar with WinFF. Perhaps a new thread on this issue will receive a better answer.

qyot27
June 28th, 2010, 05:20 AM
Actually it's a pkgconfig dir. being created in /urs/local/lib, but as previously mentioned it happens with other dir/subdir as well with other builds.
Yes, that's the normal behavior. The pkgconfig directory is created in the prefix's /lib directory, and the relevant data is then copied there. It happens when using custom prefixes as well (such as the case for the stripped-down ffmpeg recommended for FFMS2 compilation, since users shouldn't install such a crippled version to system; it's why I use $HOME/ffms2_build as a staging area).


(pkg-config is part of the default install
Strange, I distinctly remember having to install it from the repos myself.

mc4man
June 28th, 2010, 06:09 AM
Strange, I distinctly remember having to install it from the repos myself.
Maybe in an older install - never paid much mind.
Due to temp unavailability of my desktop maverick install am using a live cd this weekend - from a fresh boot -


ubuntu@ubuntu:~$ sudo apt-get remove pkg-config
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
gstreamer0.10-plugins-base-apps gstreamer0.10-tools pkg-config
ubuntu-desktop
0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
After this operation, 614kB disk space will be freed.

Locke_99GS
June 28th, 2010, 12:57 PM
gcc -o x264 x264.o input/timecode.o input/yuv.o input/y4m.o output/raw.o output/matroska.o output/matroska_ebml.o output/flv.o output/flv_bytestream.o input/thread.o libx264.a -lm -lpthread -s
/usr/bin/ld.bfd.real: libx264.a(cabac-a.o): relocation R_X86_64_32 against `x264_cabac_range_lps' can not be used when making a shared object; recompile with -fPIC
libx264.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [x264] Error 1


Hmmm. I wonder what I did that caused x264 to fail all of a sudden. Has been failing for me for a few revisions.

anafshalom
June 28th, 2010, 03:21 PM
FFmpeg is a versatile tool to encode and decode a multitude of video and audio formats. x264 encodes high-quality video superior to other popular encoders.

Although FFmpeg and x264 are available in the Ubuntu repositories, you may need to compile from source. For example, the ffmpeg-user mailing list (http://lists.mplayerhq.hu/pipermail/ffmpeg-user/) requires that you use the latest FFmpeg before asking for help. You may also like to have the bleeding-edge for encoding videos. Also, FFmpeg in the Ubuntu repository may not support necessary encoders, decoders, and formats.

Note: Those who are uncomfortable compiling can still enable restricted encoders in the repository FFmpeg:
HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoding in FFmpeg (http://ubuntuforums.org/showthread.php?t=1117283)

Choose your Ubuntu
0.The instructions on the page are for Ubuntu Lucid Lynx 10.04. Separate instructions are also available for older releases:

Install FFmpeg and x264 on Ubuntu Karmic Koala 9.10 (http://ubuntuforums.org/showpost.php?p=9114176&postcount=967)
Install FFmpeg and x264 on Ubuntu Jaunty Jackalope 9.04 (http://ubuntuforums.org/showpost.php?p=8345112&postcount=636)
Install FFmpeg and x264 on Ubuntu Intrepid Ibex 8.10 (http://ubuntuforums.org/showpost.php?p=8345112&postcount=636)
Install FFmpeg and x264 on Ubuntu Hardy Heron 8.04 LTS (http://ubuntuforums.org/showpost.php?p=6963607&postcount=360)
Install FFmpeg and x264 on Ubuntu Dapper Drake 6.06 LTS (http://ubuntuforums.org/showpost.php?p=6566863&postcount=287) (unsupported)


Install the Dependencies
1. Uninstall x264, libx264-dev, and ffmpeg if they are already installed. Open a terminal and run the following:

sudo apt-get remove ffmpeg x264 libx264-dev
2. Next, get all of the packages you will need to install FFmpeg and x264 (you may need to enable the universe and multiverse repositories (https://help.ubuntu.com/community/Repositories/Ubuntu#head-5bbef89639d9a7d93fe38f6356dc17847d373096)):

sudo apt-get update
sudo apt-get install build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libvorbis-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev


Install x264
3. Get the most current source files, compile, and install. You can run "./configure --help" to see what additional features you can enable/disable. Daily source tarballs (ftp://ftp.videolan.org/pub/videolan/x264/snapshots/) are also available, and forum member Bachstelze (http://ubuntuforums.org/member.php?u=51114) provides x264 Ubuntu packages (ftp://iori.fkraiem.org/pub/x264/) for anyone who doesn't want to compile.

cd
git clone git://git.videolan.org/x264.git
cd x264
./configure
make
sudo checkinstall --pkgname=x264 --pkgversion "2:0.`grep X264_BUILD x264.h -m1 | cut -d' ' -f3`.`git rev-list HEAD | wc -l`+git`git rev-list HEAD -n 1 | head -c 7`" --backup=no --default

Note: Ubuntu Maverick Meerkat 10.10 users will have to add --fstrans=no to the above checkinstall line.

Install libvpx (optional)
5. This is used to encode and decode VP8 video. If you skip this, remove --enable-libvpx from step 6.

cd
git clone git://review.webmproject.org/libvpx.git
cd libvpx
./configure
make
sudo checkinstall --pkgname=libvpx --pkgversion="`date +%Y%m%d%H%M`-git" --backup=no --nodoc --default

Install FFmpeg
6. Get the most current source files from the official FFmpeg SVN, compile, and install. Run "./configure --help" to see what features you can enable/disable. Nightly FFmpeg snapshots (http://ffmpeg.mplayerhq.hu/releases/ffmpeg-checkout-snapshot.tar.bz2) are also available.


cd
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
make
sudo checkinstall --pkgname=ffmpeg --pkgversion "4:SVN-r`svn info | grep Revision | awk '{ print $NF }'`" --backup=no --default
hash x264 ffmpeg ffplay

Install qt-faststart (optional)
7. This is a useful tool included with FFmpeg that rearranges a file with H.264 video, "such that the moov atom is in front of the data, thus facilitating network streaming". Basically, it allows web movies to start playing before they are completely downloaded. Usage: qt-faststart input.foo output.foo.

cd ~/ffmpeg
make tools/qt-faststart
sudo checkinstall --pkgname=qt-faststart --pkgversion "4:SVN-r`svn info | grep Revision | awk '{ print $NF }'`" --backup=no --default install -D -m755 tools/qt-faststart /usr/local/bin/qt-faststart
That's it for installation. You can keep the ~/x264 and ~/ffmpeg directories if you later want to update the source files to a new revision. See Updating FFmpeg and x264 below for more details.


Using FFmpeg and x264
The easiest method for high quality video encoding is by using the libx264 presets that are included with FFmpeg. I recommend reading the FFmpeg x264 encoding guide (http://rob.opendot.cl/index.php/useful-stuff/ffmpeg-x264-encoding-guide/) before trying these presets so you have a better idea of what to use. You can add options such as frame size (for example: -s 640x480) or tweak my examples to customize your encode. You can see a current list of all libx264 presets (http://git.ffmpeg.org/?p=ffmpeg;a=tree;f=ffpresets) (such as ipod or lossless) or after installation look in the /usr/local/share/ffmpeg directory.

One-pass CRF (Constant Rate Factor) using the slow preset. One-pass CRF is good for general encoding and is what I use most often. Adjust -crf to change the quality. Lower numbers mean higher quality and a larger output file size. A sane range is 18 to 28.

ffmpeg -i input.avi -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre slow -crf 22 -threads 0 output.mp4
Two-Pass encode using the fast presets. Two-pass encoding is used when you are targeting a specific bitrate and/or final output file size:

ffmpeg -i input.avi -pass 1 -vcodec libx264 -vpre fast_firstpass -b 512k -bt 512k -threads 0 -f rawvideo -an -y /dev/null && ffmpeg -i input.avi -pass 2 -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre fast -b 512k -bt 512k -threads 0 output.mp4
iPod 640x480 using the slow and ipod640 presets:

ffmpeg -i input.avi -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre slow -vpre ipod640 -crf 26 -threads 0 output.mp4


Updating FFmpeg and x264
Development of FFmpeg and x264 is active and an occasional update can give you new features and bug fixes. To update FFmpeg and x264 you will need to remove the packages, make distclean, update the source, recompile, and install. To update x264:

sudo apt-get remove ffmpeg x264 libx264-dev
cd ~/x264
make distclean
git pull
Now compile x264 as shown earlier in the guide starting with the x264 ./configure line. Now FFmpeg:

cd ~/ffmpeg
make distclean
svn update
Now continue with the installation starting with the FFmpeg ./configure line.


Reverting Changes Made by This Guide
To remove FFmpeg/x264 and other packages added for this guide:

sudo apt-get remove x264 ffmpeg qt-faststart build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libmp3lame-dev libsdl1.2-dev libtheora-dev libvorbis-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev
Lastly, delete the ffmpeg and x264 directories in your home folder.

Additional Resources

HOWTO: Proper Screencasting on Linux (http://ubuntuforums.org/showthread.php?t=1392026)
x264-ffmpeg-up-to-date (http://code.google.com/p/x264-ffmpeg-up-to-date/) - bash script to update x264 and ffmpeg
FFmpeg x264 encoding guide (http://rob.opendot.cl/index.php/useful-stuff/ffmpeg-x264-encoding-guide/)
x264 - a free h264/avc encoder (http://www.videolan.org/developers/x264.html)
x264 changelog (http://mirror01.x264.nl/x264/changelog.txt)
FFmpeg.org (http://ffmpeg.org/)
FFmpeg revision log (http://git.ffmpeg.org/?p=ffmpeg;a=summary)


If You Need Help
Feel free to ask your questions here and I'll try to answer you. Helpful information includes your Ubuntu version, names of any third-party repositories or PPA (https://help.launchpad.net/Packaging/PPA)s you are using, FFmpeg command, and the complete FFmpeg output if applicable.

Recent Tutorial Updates

2010-06-27: Changed libvpx pkgversion as suggested by Bachstelze in thread #1077 (http://ubuntuforums.org/showpost.php?p=9517087&postcount=1077).
2010-06-20: Removed libfaad-dev as dependency. Not used by FFmpeg now that the native AAC decoder can support HE-AAC v2.
2010-06-10: Added libvpx support for Lucid version of this guide.
Is there a way to do a batch of files with one input command?

Reuven

prupert
June 28th, 2010, 04:00 PM
Is there a way to do a batch of files with one input command?

Reuven

Are you any good at bash? Since that is the easiest way to do it.

This is how I do it. Create two files, once called trans.sh and one called ffmpeg.sh.

In trans.sh put the following:



#!/bin/bash
echo trans started on `date "+%m/%d/%y %l:%M:%S %p"` > ~/trans.log

find /path/to/your/videos -name "*.$1" -exec ~/ffmpeg.sh "{}" \;

echo ffmpeg stopped on `date "+%m/%d/%y %l:%M:%S %p"` >> ~/trans.log

Then in ffmpeg.sh put the following:



#!/bin/bash
#CUSTOMISE THE FOLLOWING
#change the ffmpeg command here to whatever you want, keeping "$1" as your input and output file names
#FYI this command seems to produce fairly decent files from .mpg transport streams recorded from MythTV
trans() {
ffmpeg -deinterlace -y -i "$1" -vcodec libx264 -level 41 -vpre normal -crf 24 -threads 0 -sn -acodec libfaac -ab 128k -ac 2 -ar 48000 -vsync 1 -async 1000 -map 0.0:0.0 -map 0.1:0.1 "$1".mkv
}

echo conversion of "$1" started on `date "+%m/%d/%y %l:%M:%S %p"` > ~/trans.log
#call the conversion and fork it
trans "$1" &>> ~/ffmpeg.log &
#get the PID of the conversion
pid=$!
echo "ffmpeg PID = $pid" >> ~/trans.log
echo "ffmpeg PID = $pid"
#this is a simple progress indicator
while ps |grep $pid &>/dev/null; do
echo -n "."
echo -en "\b-"
sleep 1
echo -en "\b\\"
sleep 1
echo -en "\b|"
sleep 1
echo -en "\b/"
sleep 1
done

echo ffmpeg stopped on `date "+%m/%d/%y %l:%M:%S %p"` >> ~/trans.log

exit


Save both these files in your home folder and make them executable. You can do this from the command line:


chmod a+x ffmpeg.sh trans.sh

Edit trans.sh where is says "/path/to/your/videos" and put in the path to your folder full of video files. Edit ffmpeg.sh to use the ffmpeg command you want to use, make sure that you keep "trans() {" before the comand and "}" after it as in my example. Also, make sure you keep "$1" as your input filename and "$1".mkv as your output filename, but change the extension if you want.

Then, finally, to convert the files. Put all the files you want to convert in a folder. Then, to run all this, open a Terminal window and type:


./trans.sh MPG

Replace MPG with the file extension of the video files you are converting. It should then go off and do it's thing, with a little progress bar that shows you something is happening (it doesn't give an ETA of the file conversion, since that is such a b!tch to get right).

This is probobly all far too complicated there are easy ways of doing it. Such as:


find /path/to/your/videos -name "*.MPG" -exec ~/ffmpeg -deinterlace -y -i "{}" -vcodec libx264 -level 41 -vpre normal -crf 24 -threads 0 -sn -acodec libfaac -ab 128k -ac 2 -ar 48000 -vsync 1 -async 1000 -map 0.0:0.0 -map 0.1:0.1 "{}".mkv \;

Typing all that into one line of a command line will search for all .MPG files in /path/to/your/videos and convert them using the FFmpeg command as written.

anafshalom
June 28th, 2010, 04:58 PM
Are you any good at bash? Since that is the easiest way to do it.

This is how I do it. Create two files, once called trans.sh and one called ffmpeg.sh.

In trans.sh put the following:



#!/bin/bash
echo trans started on `date "+%m/%d/%y %l:%M:%S %p"` > ~/trans.log

find /path/to/your/videos -name "*.$1" -exec ~/ffmpeg.sh "{}" \;

echo ffmpeg stopped on `date "+%m/%d/%y %l:%M:%S %p"` >> ~/trans.log

Then in ffmpeg.sh put the following:



#!/bin/bash
#CUSTOMISE THE FOLLOWING
#change the ffmpeg command here to whatever you want, keeping "$1" as your input and output file names
#FYI this command seems to produce fairly decent files from .mpg transport streams recorded from MythTV
trans() {
ffmpeg -deinterlace -y -i "$1" -vcodec libx264 -level 41 -vpre normal -crf 24 -threads 0 -sn -acodec libfaac -ab 128k -ac 2 -ar 48000 -vsync 1 -async 1000 -map 0.0:0.0 -map 0.1:0.1 "$1".mkv
}

echo conversion of "$1" started on `date "+%m/%d/%y %l:%M:%S %p"` > ~/trans.log
#call the conversion and fork it
trans "$1" &>> ~/ffmpeg.log &
#get the PID of the conversion
pid=$!
echo "ffmpeg PID = $pid" >> ~/trans.log
echo "ffmpeg PID = $pid"
#this is a simple progress indicator
while ps |grep $pid &>/dev/null; do
echo -n "."
echo -en "\b-"
sleep 1
echo -en "\b\\"
sleep 1
echo -en "\b|"
sleep 1
echo -en "\b/"
sleep 1
done

echo ffmpeg stopped on `date "+%m/%d/%y %l:%M:%S %p"` >> ~/trans.log

exit


Save both these files in your home folder and make them executable. You can do this from the command line:


chmod a+x ffmpeg.sh trans.sh

Edit trans.sh where is says "/path/to/your/videos" and put in the path to your folder full of video files. Edit ffmpeg.sh to use the ffmpeg command you want to use, make sure that you keep "trans() {" before the comand and "}" after it as in my example. Also, make sure you keep "$1" as your input filename and "$1".mkv as your output filename, but change the extension if you want.

Then, finally, to convert the files. Put all the files you want to convert in a folder. Then, to run all this, open a Terminal window and type:


./trans.sh MPG

Replace MPG with the file extension of the video files you are converting. It should then go off and do it's thing, with a little progress bar that shows you something is happening (it doesn't give an ETA of the file conversion, since that is such a b!tch to get right).

This is probobly all far too complicated there are easy ways of doing it. Such as:


find /path/to/your/videos -name "*.MPG" -exec ~/ffmpeg -deinterlace -y -i "{}" -vcodec libx264 -level 41 -vpre normal -crf 24 -threads 0 -sn -acodec libfaac -ab 128k -ac 2 -ar 48000 -vsync 1 -async 1000 -map 0.0:0.0 -map 0.1:0.1 "{}".mkv \;

Typing all that into one line of a command line will search for all .MPG files in /path/to/your/videos and convert them using the FFmpeg command as written.
I've never used bash, but I'll give it a try when I have a chance.

Thanks

FakeOutdoorsman
June 29th, 2010, 01:02 AM
gcc -o x264 x264.o input/timecode.o input/yuv.o input/y4m.o output/raw.o output/matroska.o output/matroska_ebml.o output/flv.o output/flv_bytestream.o input/thread.o libx264.a -lm -lpthread -s
/usr/bin/ld.bfd.real: libx264.a(cabac-a.o): relocation R_X86_64_32 against `x264_cabac_range_lps' can not be used when making a shared object; recompile with -fPIC
libx264.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [x264] Error 1


Hmmm. I wonder what I did that caused x264 to fail all of a sudden. Has been failing for me for a few revisions.

I just compiled x264 on x86_64 Ubuntu Lucid with no problems. Did you follow the guide word-for-word, or did you customize it at all? Did you forget to make distclean as shown in the Updating FFmpeg and x264 section of this guide? What version of Ubuntu are you using?

EkoBR
June 29th, 2010, 01:36 AM
[ 74%] Building CXX object src/highgui/CMakeFiles/highgui.dir/grfmt_imageio.o
Linking CXX shared library ../../lib/libhighgui.so
/usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32S against `av_destruct_packet_nofree' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libavcodec.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: ** [lib/libhighgui.so.2.1.0] Erro 1
make[1]: ** [src/highgui/CMakeFiles/highgui.dir/all] Erro 2
make: ** [all] Erro 2


:confused:

FakeOutdoorsman
June 29th, 2010, 01:51 AM
[ 74%] Building CXX object src/highgui/CMakeFiles/highgui.dir/grfmt_imageio.o
Linking CXX shared library ../../lib/libhighgui.so
/usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32S against `av_destruct_packet_nofree' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libavcodec.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: ** [lib/libhighgui.so.2.1.0] Erro 1
make[1]: ** [src/highgui/CMakeFiles/highgui.dir/all] Erro 2
make: ** [all] Erro 2


:confused:

I can not duplicate this on Lucid. What step of the installation process did this error occur? Did you follow the guide word-for-word, or did you customize it at all? What version of Ubuntu are you using?

Update: Lots of guess work here and little information to work from. Is this an OpenCV error? I know nothing of OpenCV. Please create a new thread if this is for OpenCV as it is outside of the scope of this guide.

EkoBR
June 29th, 2010, 02:53 AM
I can not duplicate this on Lucid. What step of the installation process did this error occur? Did you follow the guide word-for-word, or did you customize it at all? What version of Ubuntu are you using?

Update: Lots of guess work here and little information to work from. Is this an OpenCV error? I know nothing of OpenCV. Please create a new thread if this is for OpenCV as it is outside of the scope of this guide.

Ubuntu 10.04
But yes, is an OpenCV compilation error.

I will search a correct thread, Thanks.

Update: Now I try compile ffmpeg with --enable-shared and...

LD libavcodec/libavcodec.so.52
/usr/bin/ld: /usr/local/lib/libvpx.a(vpx_codec.c.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libvpx.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: ** [libavcodec/libavcodec.so.52] Erro 1

How I compile with -fPIC ??

qyot27
June 29th, 2010, 07:38 AM
Ubuntu 10.04
But yes, is an OpenCV compilation error.

I will search a correct thread, Thanks.

Update: Now I try compile ffmpeg with --enable-shared and...

LD libavcodec/libavcodec.so.52
/usr/bin/ld: /usr/local/lib/libvpx.a(vpx_codec.c.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libvpx.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: ** [libavcodec/libavcodec.so.52] Erro 1

How I compile with -fPIC ??
--enable-pic

You'll probably need to use it on libvpx, and ffmpeg. And x264, et al. According to the Gentoo Wiki (http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3) at least, on AMD64 all shared builds must be position independent, meaning they have to use the --enable-pic option (or equivalent, since parameters can differ).

Locke_99GS
June 29th, 2010, 01:42 PM
I just compiled x264 on x86_64 Ubuntu Lucid with no problems. Did you follow the guide word-for-word, or did you customize it at all? Did you forget to make distclean as shown in the Updating FFmpeg and x264 section of this guide? What version of Ubuntu are you using?

Ubuntu Lucid 64bit.

I did make distclean, and everything is according to the first post here. I compiled it successfully several times before, but hasn't been compiling for a couple weeks for me.

I do have my CFLAGS as "-O3 -pipe -fomit-frame-pointer", which may be different than many, and I acknowledge that I'd be more likely to get errors this way, but these have been my CFLAGS for years and ffmpeg, vpx, and x264 compiled successfully with these cflags previously. I will change my cflags to "-O2" and see if recent code changes aren't playing well with my current CFLAGS.

dannyboy79
June 29th, 2010, 07:20 PM
Are you any good at bash? Since that is the easiest way to do it.

This is how I do it. Create two files, once called trans.sh and one called ffmpeg.sh.

In trans.sh put the following:



#!/bin/bash
echo trans started on `date "+%m/%d/%y %l:%M:%S %p"` > ~/trans.log

find /path/to/your/videos -name "*.$1" -exec ~/ffmpeg.sh "{}" \;

echo ffmpeg stopped on `date "+%m/%d/%y %l:%M:%S %p"` >> ~/trans.log

Then in ffmpeg.sh put the following:



#!/bin/bash
#CUSTOMISE THE FOLLOWING
#change the ffmpeg command here to whatever you want, keeping "$1" as your input and output file names
#FYI this command seems to produce fairly decent files from .mpg transport streams recorded from MythTV
trans() {
ffmpeg -deinterlace -y -i "$1" -vcodec libx264 -level 41 -vpre normal -crf 24 -threads 0 -sn -acodec libfaac -ab 128k -ac 2 -ar 48000 -vsync 1 -async 1000 -map 0.0:0.0 -map 0.1:0.1 "$1".mkv
}

echo conversion of "$1" started on `date "+%m/%d/%y %l:%M:%S %p"` > ~/trans.log
#call the conversion and fork it
trans "$1" &>> ~/ffmpeg.log &
#get the PID of the conversion
pid=$!
echo "ffmpeg PID = $pid" >> ~/trans.log
echo "ffmpeg PID = $pid"
#this is a simple progress indicator
while ps |grep $pid &>/dev/null; do
echo -n "."
echo -en "\b-"
sleep 1
echo -en "\b\\"
sleep 1
echo -en "\b|"
sleep 1
echo -en "\b/"
sleep 1
done

echo ffmpeg stopped on `date "+%m/%d/%y %l:%M:%S %p"` >> ~/trans.log

exit


Save both these files in your home folder and make them executable. You can do this from the command line:


chmod a+x ffmpeg.sh trans.sh

Edit trans.sh where is says "/path/to/your/videos" and put in the path to your folder full of video files. Edit ffmpeg.sh to use the ffmpeg command you want to use, make sure that you keep "trans() {" before the comand and "}" after it as in my example. Also, make sure you keep "$1" as your input filename and "$1".mkv as your output filename, but change the extension if you want.

Then, finally, to convert the files. Put all the files you want to convert in a folder. Then, to run all this, open a Terminal window and type:


./trans.sh MPG

Replace MPG with the file extension of the video files you are converting. It should then go off and do it's thing, with a little progress bar that shows you something is happening (it doesn't give an ETA of the file conversion, since that is such a b!tch to get right).

This is probobly all far too complicated there are easy ways of doing it. Such as:


find /path/to/your/videos -name "*.MPG" -exec ~/ffmpeg -deinterlace -y -i "{}" -vcodec libx264 -level 41 -vpre normal -crf 24 -threads 0 -sn -acodec libfaac -ab 128k -ac 2 -ar 48000 -vsync 1 -async 1000 -map 0.0:0.0 -map 0.1:0.1 "{}".mkv \;

Typing all that into one line of a command line will search for all .MPG files in /path/to/your/videos and convert them using the FFmpeg command as written.

would this command follow symlinks? i use mythrename.pl to make symlinks in human readable form to watch my recordings original xbox with xbmc prior to xbmc having the myth protocol. i'd like to use the symlinks cause i only wanna try to transcode some of my shows instead of all .mpg's. so instead of using "*.MPG", could i use something like "It's*.MPG" which would only transcode my it's always sunny in philedelphia shows? looking to save some space on the server so i want to transcode them down smaller. not to mention, xbox 360 can't play the mpgs that i am sharing from linux using ushare but it can see the avi file, so maybe i could use avi container with xvid and mp3 audio like my other avi movies that xbox 360 can play. thoughts?

braddjwinter
July 2nd, 2010, 10:38 PM
is there a reason why the "Install libvpx (optional)" instructions aren't in the Karmic Koala guide?

FakeOutdoorsman
July 2nd, 2010, 11:06 PM
is there a reason why the "Install libvpx (optional)" instructions aren't in the Karmic Koala guide?

Not a good reason. I meant to add it to Karmic after adding it to Lucid, but it's almost been a month already. I'll test it on Karmic now and add it shortly.

Update: libvpx added to Karmic. Installed successfully on a 32-bit VM.

papapep
July 3rd, 2010, 01:05 AM
What an awesome tutorial, thanks a lot!

Chame_Wizard
July 3rd, 2010, 01:34 AM
sudo aptitude ffmpeg ffmpeg-dbg

Always doing it.:lolflag:

sailor420
July 3rd, 2010, 05:32 PM
I'm getting the following error when compiling ffmpeg:


/home/ravenel/source/ffmpeg/libavformat/libavformat.a(id3v2.o): In function `read_ttag':
/home/ravenel/source/ffmpeg/libavformat/id3v2.c:142: undefined reference to `ff_id3v1_genre_str'
collect2: ld returned 1 exit status
make: *** [ffmpeg_g] Error 1

Any ideas?

FYI, here are the configuration options I passed:


./configure --enable-pthreads --enable-gpl --enable-postproc --enable-memalign-hack --enable-runtime-cpudetect --disable-devices --disable-filters --disable-encoders --disable-muxers --disable-network --disable-outdevs --disable-decoder=aac,ac3,adpcm_*,alac,als,ape,atrac?,cook,d ca,dsicinaudio,dxa,eac3,flac,interplay_dpcm,mlp,mp 1,mp2,mp3,mp3*,mpc?,pcm_*,qcelp,ra_*,sipr,truehd,t ruespeech,tta,vorbis,wavpack,wma*,twinvq --disable-demuxer=aac,ac3,pcm_*,ape,amr,***,au,avs,dts,eac3, flac,mp3,mpc,mpc8,truehd,tta,w64,wav,wv --disable-parser=aac,ac3,dca,mlp,mpegaudio

sailor420
July 3rd, 2010, 07:37 PM
Apparently this is due to a bug in ffmpeg. I retried using source from 6/1 (just a date I picked), and it worked fine.

FakeOutdoorsman
July 3rd, 2010, 09:33 PM
FYI, here are the configuration options I passed:


./configure --enable-pthreads --enable-gpl --enable-postproc --enable-memalign-hack --enable-runtime-cpudetect --disable-devices --disable-filters --disable-encoders --disable-muxers --disable-network --disable-outdevs --disable-decoder=aac,ac3,adpcm_*,alac,als,ape,atrac?,cook,d ca,dsicinaudio,dxa,eac3,flac,interplay_dpcm,mlp,mp 1,mp2,mp3,mp3*,mpc?,pcm_*,qcelp,ra_*,sipr,truehd,t ruespeech,tta,vorbis,wavpack,wma*,twinvq --disable-demuxer=aac,ac3,pcm_*,ape,amr,***,au,avs,dts,eac3, flac,mp3,mpc,mpc8,truehd,tta,w64,wav,wv --disable-parser=aac,ac3,dca,mlp,mpegaudio

I'm curious as to why you are disabling so many options. Have you tried the --disable-everything option? You can use that and then follow it with whatever --enable-foo that you want. Might make your ./configure a little smaller and easier to read.


Apparently this is due to a bug in ffmpeg. I retried using source from 6/1 (just a date I picked), and it worked fine.

r24030 using both the ./configure from the guide and your ./configure compiled fine for me on x86_64 Lucid.

This happens once in a while when compiling FFmpeg SVN. Occasionally a revision will break something, but it is rare when a fix doesn't come quickly. Last time I let the developers in the #ffmpeg-devel IRC channel know that the most recent revision failed to make it was fixed very quickly.

Update: You probably don't need --enable-memalign-hack unless you're cross-compiling for Windows.

sailor420
July 4th, 2010, 03:07 PM
Thanks! I was following a guide from MakeMKV which suggested those options: http://www.makemkv.com/forum2/viewtopic.php?f=6&t=1313&start=0

I talked with the author of that guide, and he found a way to get it running--notably by doing just as you suggested and running --disable-all and then just enabling the things we needed.

Thanks for the informative response, much appreciated. Great guide!

sailor420
July 4th, 2010, 03:08 PM
Updating FFmpeg and x264
Development of FFmpeg and x264 is active and an occasional update can give you new features and bug fixes. To update FFmpeg and x264 you will need to remove the packages, make distclean, update the source, recompile, and install. To update x264:

sudo apt-get remove ffmpeg x264 libx264-dev
cd ~/x264
make distclean
git pull
Now compile x264 as shown earlier in the guide starting with the x264 ./configure line. Now FFmpeg:

cd ~/ffmpeg
make distclean
svn update
Now continue with the installation starting with the FFmpeg ./configure line.


Reverting Changes Made by This Guide
To remove FFmpeg/x264 and other packages added for this guide:

sudo apt-get remove x264 ffmpeg qt-faststart build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libmp3lame-dev libsdl1.2-dev libtheora-dev libvorbis-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev
Lastly, delete the ffmpeg and x264 directories in your home folder.


Many thanks for including this bit. So many guide neglect upgrade and removal instructions, so it's great to see it included. Great guide!

leonidv
July 4th, 2010, 07:35 PM
It's better to add zero step:


LC_LANG="en_US.utf8"

because output of svn info is locale sensitive.

Stoneface
July 5th, 2010, 02:00 PM
Just did a test run converting a .ogv (recordMyDesktop file) to a mp4 using ffmpeg (built using this threads tutorial).
$ ffmpeg -i all-in-one-seo-img-2.ogv -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre slow -crf 22 -threads 0 output.mp4
I must say it went very well and quality seems to be good. Any tips or remarks on the way I converted this file?

FakeOutdoorsman
July 5th, 2010, 10:13 PM
It's better to add zero step:


LC_LANG="en_US.utf8"

because output of svn info is locale sensitive.

Thanks. I didn't know this and will look into it. What happens when a non-en_US.utf8 locale is used and LC_LANG="en_US.utf8" is not set?


Just did a test run converting a .ogv (recordMyDesktop file) to a mp4 using ffmpeg (built using this threads tutorial).
$ ffmpeg -i all-in-one-seo-img-2.ogv -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre slow -crf 22 -threads 0 output.mp4
I must say it went very well and quality seems to be good. Any tips or remarks on the way I converted this file?

Looks good to me, but it depends on what your output is for (portable device, upload to video site, playing on computer, etc). Other things you can try:

Record your next screencast with this guide: HOWTO: Proper Screencasting on Linux (http://ubuntuforums.org/showthread.php?t=1392026). It's a great guide and will probably provide a better quality output than anything from recordMyDesktop.

Encode your audio with neroAacEnc. Many people claim it's a better encoder than libfaac. Example:

ffmpeg -i input.foo -f wav - | neroAacEnc -ignorelength -if - -of audio.mp4
ffmpeg -i input.foo -i audio.mp4 -vcodec copy -acodec copy -map 0:0 -map 1:0 output-combined.mkv

Or simply copy the audio from the original and throw it into a MKV container which handles just about anything:

ffmpeg -i input.foo -acodec copy -vcodec libx264 -vpre slow -crf 22 -threads 0 output.mkv

Or use -aq instead of -ab, such as -aq 100 (the -aq values vary between encoders). From faac --long-help:

Set default variable bitrate (VBR) quantizer quality in percent. (default: 100, averages at approx. 120 kbps VBR for a normal stereo input file with 16 bit and 44.1 kHz sample rate; max. value 500, min. 10).

Try other -vpre presets and change -crf. Increase the CRF value until it reaches an unacceptable quality, and then use the previous value. Add -t 30 to your command to encode just 30 seconds for a test clip that may give you a general idea of how things can look without needing to encode the whole video.

Bachstelze
July 6th, 2010, 05:59 AM
Thanks. I didn't know this and will look into it. What happens when a non-en_US.utf8 locale is used and LC_LANG="en_US.utf8" is not set?


Absolutely nothing, because the output of svn info generally contains only ASCII characters. And most users will have an UTF-8 locale anyway.

leonidv
July 6th, 2010, 06:16 AM
Thanks. I didn't know this and will look into it. What happens when a non-en_US.utf8 locale is used and LC_LANG="en_US.utf8" is not set?

Here are my default svn info output (ru_RU.UTF-8):


<09:12:34> ffmpeg: locale
LANG=ru_RU.utf8
<..skipped...>
<09:12:34> ffmpeg: svn info
Путь: '.'
URL: svn://svn.ffmpeg.org/ffmpeg/trunk
Корень репозитория: svn://svn.ffmpeg.org/ffmpeg
UUID репозитория: 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
Редакция: 24040
Вид узла: каталог
Задано: нормально
Автор последнего изменения: ramiro
Редакция последнего изменения: 24040
Дата последнего изменения: 2010-07-04 21:24:57 +0400 (Вск, 04 Июл 2010)
So,


sudo checkinstall --pkgname=ffmpeg --pkgversion "4:SVN-r`svn info | grep Revision | awk '{ print $NF }'`" --backup=no --default
doesn't work.

leonidv
July 6th, 2010, 06:18 AM
Absolutely nothing, because the output of svn info generally contains only ASCII characters. And most users will have an UTF-8 locale anyway.
UTF-8 is not locale :)

Bachstelze
July 6th, 2010, 07:10 AM
UTF-8 is not locale :)

That's why I said "an UTF-8 locale". I admit I didn't test for exotic locales, though... Anyway, better use C than en_US then, not everyone might have it installed.

flyone
July 10th, 2010, 02:05 PM
The command "sudo checkinstall --pkgname=ffmpeg --pkgversion "5:0.5.1" --backup=no --default" worked for me.
It seems like it is "`svn info | grep Revision | awk '{ print $NF }'`" that made the problem.

Thanks anyway

Hello i got the same problem... change "grep Revision" to "grep Révision"... because we are french we have somme anoying accent...



sorry for my poor english ;)

nothingspecial
July 10th, 2010, 11:56 PM
Do you happen to know how to do this easily on a minimal install without it wanting to pull X in?

Full ffmpeg, no X?

leonidv
July 11th, 2010, 08:22 AM
Hello i got the same problem... change "grep Revision" to "grep Révision"... because we are french we have somme anoying accent...



sorry for my poor english ;)
You can do it before compiling:
http://ubuntuforums.org/showpost.php?p=9547239&postcount=1109
Then all svn messages will be in English.

andrew.46
July 11th, 2010, 10:45 AM
Hi flyone,


Hello i got the same problem... change "grep Revision" to "grep Révision"... because we are french we have somme anoying accent...

I love fiddling with these things:


svn info | sed '5!d' | awk '{ print $NF }'

Would always work unless the number of lines changed, reasonably unlikely... A variation:


svn info | sed -e '5!d' -e 's/^.\{10\}//'

Andrew

Tom Dignan
July 12th, 2010, 12:15 AM
Wow, thanks for making what would otherwise have been a formidable task quite easy. I did have install libopencore-amrnb-dev, which isn't listed in your post as a dependency.

Nom du Clavier
July 12th, 2010, 12:40 AM
hi. i need to convert avi to Sony PSP, 480x272, h264, high quality if possible

i found this on ffmpeg FAQ and edit it.

however, i cant get it to work. what should be the correct command? thanks.

According to mencoder (http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-handheld-psp.html)'s docs:

mencoder -ofps 30000/1001 -af lavcresample=24000 -vf harddup -oac lavc \
-ovc lavc -lavcopts aglobal=1:vglobal=1:vcodec=mpeg4:acodec=libfaac \
-of lavf -lavfopts format=psp \
/home/ubuntu/Desktop/Shrek.avi -o /home/ubuntu/Desktop/Shrek.mp4

Also, you don't need to use sudo in front of ffmpeg in the command you gave. It doesn't need to be run as the root user.

mc4man
July 12th, 2010, 01:22 AM
So, finally, here's how to make kosher ffmpeg packages.....
For those that wish to try/use (post #1068. pg. 107), tried a quick run thru and it works quite well.

Though faad should still be removed from debian/confflags

(# there is no libfaad in ubuntu/main, on in ubuntu/multiverse
gpl_confflags += $(call cond_enable,/usr/include/faad.h,libfaad

If using at some point on maverick I'd probably move the line in blue from the libavcodec52.install file to the ffmpeg.install file to avoid an overwrite issue if upgrading to the new packages

usr/lib/{,*/,*/*/}libavcodec.so.*
usr/share/ffmpeg/*.ffpreset

( was fairly straightforward to adapt the .diff used here to produce extra versions instead, but only a very few apps require them and it's probably easier to just edit the control file in the <app>.deb before installing to accept a non extra name

FakeOutdoorsman
July 12th, 2010, 02:05 AM
Do you happen to know how to do this easily on a minimal install without it wanting to pull X in?

Full ffmpeg, no X?

I am currently out of town, but I run FFmpeg X-less occasionally. I'm not able to check dependencies now, so I'm not sure if anything wants to suck in X related junk, but libx11-dev and libxfixes-dev might be worth investigating. These probably aren't needed for a command-line only system anyway.

FakeOutdoorsman
July 12th, 2010, 02:09 AM
Wow, thanks for making what would otherwise have been a formidable task quite easy. I did have install libopencore-amrnb-dev, which isn't listed in your post as a dependency.

This looks like it's listed on the Lucid guide. Not sure of the others. What Ubuntu version are you using?

qyot27
July 12th, 2010, 11:03 PM
hi sorry for incomplete details.

hi. im trying to emulate this settings from Xilisoft. i need to convert avi to psp with high quality settings. i want to try the performance of this pc in windows and linux converting.

http://i151.photobucket.com/albums/s124/coolboi007/Screenshot-1.png

...

any help in replicating the xilisoft settings. thanks.
The screenshot doesn't tell us anything about the settings used, outside of bitrate. Take an output .mp4 from Xilisoft and use avinaptic to generate the report of what features the stream uses. There is a Linux version of avinaptic, but since you're using Xilisoft through a VM the Windows version would work too. Post the results and someone can probably translate it into x264 or ffmpeg parameters.

Nom du Clavier
July 13th, 2010, 12:30 AM
hi sorry for incomplete details.
....snip....
any help in replicating the xilisoft settings. thanks.

Right, what qyot27 said. I've been playing with transcoding DVD's using mplayer/mencoder myself, but with a bit more info I'm sure one of us here can replicate the settings to use with either ffmpeg or the mplayer stack.

dannyboy79
July 13th, 2010, 03:00 PM
i just want to follow up with my success with FFMPEG and x264 encoding. I am still using a static build of FFMPEG because i don't fully understand the whole sharing of libraries and i don't believe i even need it with the apps i currently use. i can now encode with x264 and aac in kdenlive. i used the google code bash script to install (and 2nd script to upgrade occasionally) svn ffmpeg and x264 from git. the code is here and all credit goes to r.plumridge
http://code.google.com/p/x264-ffmpeg-up-to-date/
I use the following versions of software on my Lucid Lynx setup
Qt: 4.6.2
KDE Development Platform: 4.4.2 (KDE 4.4.2)
Kdenlive: 0.7.7.1
MLT (melt) = 0.5.6
FFmpeg version SVN-r24084, Copyright (c) 2000-2010 the FFmpeg developers
built on Jul 7 2010 09:19:01 with gcc 4.4.3
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab
libavutil 50.20. 0 / 50.20. 0
libavcodec 52.79. 1 / 52.79. 1
libavformat 52.73. 0 / 52.73. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.20. 1 / 1.20. 1
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
FFmpeg SVN-r24084
libavutil 50.20. 0 / 50.20. 0
libavcodec 52.79. 1 / 52.79. 1
libavformat 52.73. 0 / 52.73. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.20. 1 / 1.20. 1
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0

libx264 = not sure how to see what version but it's from git

I can export very nice x264 (8000k bit rate) aac (audio 128kb, 48000) mp4 (container) files from kdenlive. there's one here and it's not bad for standard definition. I am going to try to not scale it down to 640x480 and just try 720x480 and see if i don't get better quality.
http://www.youtube.com/watch?v=Ld4vSLkeTbo

Syed_karim
July 14th, 2010, 10:19 AM
Hi.,

I installed FFMPEG in Ubuntu 10.04LTS 32bit as per your instruction on this thread. I think installation is okay.,

karim@desktop:~$ ls -l /usr/local/include/
total 76
drwxr-xr-x 2 root root 4096 2010-07-14 15:37 libavcodec
drwxr-xr-x 2 root root 4096 2010-07-14 15:37 libavdevice
drwxr-xr-x 2 root root 4096 2010-07-14 15:37 libavfilter
drwxr-xr-x 2 root root 4096 2010-07-14 15:37 libavformat
drwxr-xr-x 2 root root 4096 2010-07-14 15:37 libavutil
drwxr-xr-x 2 root root 4096 2010-07-14 15:37 libpostproc
drwxr-xr-x 2 root root 4096 2010-07-14 15:37 libswscale
drwxr-xr-x 2 root root 4096 2010-07-07 15:47 libusb-1.0
drwxr-xr-x 2 root root 4096 2010-07-08 11:45 SDL
drwxr-xr-x 2 root root 4096 2010-07-14 15:24 vpx
-rw-r--r-- 1 root root 36460 2010-07-14 15:22 x264.h

karim@desktop:~$ ls -l /usr/local/lib/
total 46216
-rw-r--r-- 1 root root 29157798 2010-07-14 15:36 libavcodec.a
-rw-r--r-- 1 root root 481196 2010-07-14 15:36 libavdevice.a
-rw-r--r-- 1 root root 353020 2010-07-14 15:36 libavfilter.a
-rw-r--r-- 1 root root 8756786 2010-07-14 15:36 libavformat.a
-rw-r--r-- 1 root root 285456 2010-07-14 15:36 libavutil.a
-rw-r--r-- 1 root root 79428 2010-07-14 15:36 libpostproc.a
lrwxrwxrwx 1 root root 20 2010-07-08 11:45 libSDL-1.2.so.0 -> libSDL-1.2.so.0.11.3
-rwxr-xr-x 1 root root 2098338 2010-07-08 11:45 libSDL-1.2.so.0.11.3
-rw-r--r-- 1 root root 3313590 2010-07-08 11:45 libSDL.a
-rwxr-xr-x 1 root root 986 2010-07-08 11:45 libSDL.la
-rw-r--r-- 1 root root 3330 2010-07-08 11:45 libSDLmain.a
lrwxrwxrwx 1 root root 20 2010-07-08 11:45 libSDL.so -> libSDL-1.2.so.0.11.3
-rw-r--r-- 1 root root 595136 2010-07-14 15:36 libswscale.a
-rw-r--r-- 1 root root 201874 2010-07-07 15:47 libusb-1.0.a
-rwxr-xr-x 1 root root 955 2010-07-07 15:47 libusb-1.0.la
lrwxrwxrwx 1 root root 19 2010-07-07 15:47 libusb-1.0.so -> libusb-1.0.so.0.0.0
lrwxrwxrwx 1 root root 19 2010-07-07 15:47 libusb-1.0.so.0 -> libusb-1.0.so.0.0.0
-rwxr-xr-x 1 root root 156673 2010-07-07 15:47 libusb-1.0.so.0.0.0
-rw-r--r-- 1 karim karim 765920 2010-07-14 15:23 libvpx.a
-rw-r--r-- 1 root root 1035970 2010-07-14 15:22 libx264.a

Thanks for your effort. But when I tried to compile some samples http://dranger.com/ffmpeg/ffmpeg.html based on ffmpeg libraries, I'm getting linking error. Even I linked the proper libraries in the gcc.

I knew that those samples are little bit outdated. so I did some changes in his samples like
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/avutil.h>

#include <SDL/SDL.h>
#include <SDL/SDL_thread.h> ... etc.

In his sample program he mentioned that how to compile his samples? And some changes in FFMPEG. I followed his instruction., but I'm getting some linking error:

/usr/local/lib/libavformat.a(concat.o): In function `concat_open':
/home/karim/ffmpeg/libavformat/concat.c:67: undefined reference to `av_strstart'
/home/karim/ffmpeg/libavformat/concat.c:99: undefined reference to `av_strlcpy'
/usr/local/lib/libavformat.a(rl2.o): In function `rl2_read_seek':
/home/karim/ffmpeg/libavformat/rl2.c:277: undefined reference to `av_rescale_q'
/usr/local/lib/libavcodec.a(alsdec.o): In function `revert_channel_correlation':
/home/karim/ffmpeg/libavcodec/alsdec.c:1205: undefined reference to `av_log'
/usr/local/lib/libavcodec.a(alsdec.o): In function `read_var_block_data':
/home/karim/ffmpeg/libavcodec/alsdec.c:628: undefined reference to `av_log'
/usr/local/lib/libavcodec.a(alsdec.o): In function `decode_blocks':
/home/karim/ffmpeg/libavcodec/alsdec.c:1111: undefined reference to `av_log'
/usr/local/lib/libavcodec.a(alsdec.o): In function `read_channel_data':
/home/karim/ffmpeg/libavcodec/alsdec.c:1148: undefined reference to `av_log'
/usr/local/lib/libavcodec.a(alsdec.o): In function `read_frame_data':
/home/karim/ffmpeg/libavcodec/alsdec.c:1329: undefined reference to `av_log'
/usr/local/lib/libavcodec.a(alsdec.o):/home/karim/ffmpeg/libavcodec/alsdec.c:1173: more undefined references to `av_log' foll

That message is so big.., so I just pasted few lines. Even I tried

export LD_INCLUDE_PATH=/usr/local/include:$LD_INCLUDE_PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

in .bashrc file, still I'm getting those errors. Do you have any idea about this?

Thanks...

Syed_karim
July 15th, 2010, 08:15 AM
Hi.,

I installed FFMPEG in Ubuntu 10.04LTS 32bit as per your instruction on this thread. I think installation is okay.,

karim@desktop:~$ ls -l /usr/local/include/
total 76
drwxr-xr-x 2 root root 4096 2010-07-14 15:37 libavcodec
drwxr-xr-x 2 root root 4096 2010-07-14 15:37 libavdevice
drwxr-xr-x 2 root root 4096 2010-07-14 15:37 libavfilter
drwxr-xr-x 2 root root 4096 2010-07-14 15:37 libavformat
drwxr-xr-x 2 root root 4096 2010-07-14 15:37 libavutil
drwxr-xr-x 2 root root 4096 2010-07-14 15:37 libpostproc
drwxr-xr-x 2 root root 4096 2010-07-14 15:37 libswscale
drwxr-xr-x 2 root root 4096 2010-07-07 15:47 libusb-1.0
drwxr-xr-x 2 root root 4096 2010-07-08 11:45 SDL
drwxr-xr-x 2 root root 4096 2010-07-14 15:24 vpx
-rw-r--r-- 1 root root 36460 2010-07-14 15:22 x264.h

karim@desktop:~$ ls -l /usr/local/lib/
total 46216
-rw-r--r-- 1 root root 29157798 2010-07-14 15:36 libavcodec.a
-rw-r--r-- 1 root root 481196 2010-07-14 15:36 libavdevice.a
-rw-r--r-- 1 root root 353020 2010-07-14 15:36 libavfilter.a
-rw-r--r-- 1 root root 8756786 2010-07-14 15:36 libavformat.a
-rw-r--r-- 1 root root 285456 2010-07-14 15:36 libavutil.a
-rw-r--r-- 1 root root 79428 2010-07-14 15:36 libpostproc.a
lrwxrwxrwx 1 root root 20 2010-07-08 11:45 libSDL-1.2.so.0 -> libSDL-1.2.so.0.11.3
-rwxr-xr-x 1 root root 2098338 2010-07-08 11:45 libSDL-1.2.so.0.11.3
-rw-r--r-- 1 root root 3313590 2010-07-08 11:45 libSDL.a
-rwxr-xr-x 1 root root 986 2010-07-08 11:45 libSDL.la
-rw-r--r-- 1 root root 3330 2010-07-08 11:45 libSDLmain.a
lrwxrwxrwx 1 root root 20 2010-07-08 11:45 libSDL.so -> libSDL-1.2.so.0.11.3
-rw-r--r-- 1 root root 595136 2010-07-14 15:36 libswscale.a
-rw-r--r-- 1 root root 201874 2010-07-07 15:47 libusb-1.0.a
-rwxr-xr-x 1 root root 955 2010-07-07 15:47 libusb-1.0.la
lrwxrwxrwx 1 root root 19 2010-07-07 15:47 libusb-1.0.so -> libusb-1.0.so.0.0.0
lrwxrwxrwx 1 root root 19 2010-07-07 15:47 libusb-1.0.so.0 -> libusb-1.0.so.0.0.0
-rwxr-xr-x 1 root root 156673 2010-07-07 15:47 libusb-1.0.so.0.0.0
-rw-r--r-- 1 karim karim 765920 2010-07-14 15:23 libvpx.a
-rw-r--r-- 1 root root 1035970 2010-07-14 15:22 libx264.a

Thanks for your effort. But when I tried to compile some samples http://dranger.com/ffmpeg/ffmpeg.html based on ffmpeg libraries, I'm getting linking error. Even I linked the proper libraries in the gcc.

I knew that those samples are little bit outdated. so I did some changes in his samples like
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/avutil.h>

#include <SDL/SDL.h>
#include <SDL/SDL_thread.h> ... etc.

In his sample program he mentioned that how to compile his samples? And some changes in FFMPEG. I followed his instruction., but I'm getting some linking error:

/usr/local/lib/libavformat.a(concat.o): In function `concat_open':
/home/karim/ffmpeg/libavformat/concat.c:67: undefined reference to `av_strstart'
/home/karim/ffmpeg/libavformat/concat.c:99: undefined reference to `av_strlcpy'
/usr/local/lib/libavformat.a(rl2.o): In function `rl2_read_seek':
/home/karim/ffmpeg/libavformat/rl2.c:277: undefined reference to `av_rescale_q'
/usr/local/lib/libavcodec.a(alsdec.o): In function `revert_channel_correlation':
/home/karim/ffmpeg/libavcodec/alsdec.c:1205: undefined reference to `av_log'
/usr/local/lib/libavcodec.a(alsdec.o): In function `read_var_block_data':
/home/karim/ffmpeg/libavcodec/alsdec.c:628: undefined reference to `av_log'
/usr/local/lib/libavcodec.a(alsdec.o): In function `decode_blocks':
/home/karim/ffmpeg/libavcodec/alsdec.c:1111: undefined reference to `av_log'
/usr/local/lib/libavcodec.a(alsdec.o): In function `read_channel_data':
/home/karim/ffmpeg/libavcodec/alsdec.c:1148: undefined reference to `av_log'
/usr/local/lib/libavcodec.a(alsdec.o): In function `read_frame_data':
/home/karim/ffmpeg/libavcodec/alsdec.c:1329: undefined reference to `av_log'
/usr/local/lib/libavcodec.a(alsdec.o):/home/karim/ffmpeg/libavcodec/alsdec.c:1173: more undefined references to `av_log' foll

That message is so big.., so I just pasted few lines. Even I tried

export LD_INCLUDE_PATH=/usr/local/include:$LD_INCLUDE_PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

in .bashrc file, still I'm getting those errors. Do you have any idea about this?

Thanks...
Thanks.., I fixed this problem by myself... Actually this is library ordering problem... :-)

prupert
July 15th, 2010, 10:49 AM
Thanks.., I fixed this problem by myself... Actually this is library ordering problem... :-)

To help others in future, since your post was too complicated for me - can you write down a step by step of how you fixed this problem?

daaxix
July 17th, 2010, 05:38 PM
I compiled exactly as in the first post for 10.04, then ran the following command :


ffmpeg -i ./input.mkv -s 480x320 -vcodec mpeg4 -acodec libfaac -ac 1 -ar 16000 -r 13 -ab 32000 -aspect 3:2 output.mp4


To attempt to transcode for my G1 Android phone.

This results in the following output :


[scale @ 0x2b28930] w:720 h:480 fmt:yuv420p -> w:480 h:320 fmt:yuv420p flags:0xa0000004
Output #0, mp4, to 'outut.mp4':
Metadata:
encoder : Lavf52.74.0
Stream #0.0: Video: mpeg4, yuv420p, 480x320 [PAR 1:1 DAR 3:2], q=2-31, 200 kb/s, 13 tbn, 13 tbc
Stream #0.1(eng): Audio: libfaac, 16000 Hz, 1 channels, s16, 32 kb/s
Metadata:
title : 6ch NDAAC
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
[aac @ 0x2aeade0] Duplicate channel tag found, attempting to remap.
Resampling with input channels greater than 2 unsupported.
Can not resample 6 channels @ 48000 Hz to 1 channels @ 16000 Hz

but works just fine if I leave out the
-ac 1 -ar 16000 switches, but unfortunately will then not play on my G1. The G1 is very fickle.

Any suggestions?

Bachstelze
July 17th, 2010, 05:41 PM
I compiled exactly as in the first post for 10.04, then ran the following command :


ffmpeg -i ./input.mkv -s 480x320 -vcodec mpeg4 -acodec libfaac -ac 1 -ar 16000 -r 13 -ab 32000 -aspect 3:2 output.mp4


To attempt to transcode for my G1 Android phone.

This results in the following output :


[scale @ 0x2b28930] w:720 h:480 fmt:yuv420p -> w:480 h:320 fmt:yuv420p flags:0xa0000004
Output #0, mp4, to 'outut.mp4':
Metadata:
encoder : Lavf52.74.0
Stream #0.0: Video: mpeg4, yuv420p, 480x320 [PAR 1:1 DAR 3:2], q=2-31, 200 kb/s, 13 tbn, 13 tbc
Stream #0.1(eng): Audio: libfaac, 16000 Hz, 1 channels, s16, 32 kb/s
Metadata:
title : 6ch NDAAC
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
[aac @ 0x2aeade0] Duplicate channel tag found, attempting to remap.
Resampling with input channels greater than 2 unsupported.
Can not resample 6 channels @ 48000 Hz to 1 channels @ 16000 Hz

but works just fine if I leave out the
-ac 1 -ar 16000 switches, but unfortunately will then not play on my G1. The G1 is very fickle.

Any suggestions?

Since ffmpeg apparently has problems subsampling your 5.1 audio to Mono, I'd try to process the sound separately with other tools. Which format is it in?

daaxix
July 17th, 2010, 06:14 PM
Since ffmpeg apparently has problems subsampling your 5.1 audio to Mono, I'd try to process the sound separately with other tools. Which format is it in?

The audio is MPEG-4 AAC.

Thanks, I <3 Ubuntu Forums!

HHelsinger
July 17th, 2010, 07:41 PM
When I try to transcode using ffmpeg & libx264, I get the error "unknown encoder libx264" I've followed the threads, and reinstalled and updated libx264.

I've configured the latest ffmpeg (carefully following the instructions) with

--enable-nonfree --enable-libfaac --enable-gpl --enable-libx264
After configuring, it reports that both libfaac and libx264 are enabled.
But when I compile I get this error:

/usr/local/src/ffmpeg-export-2010-07-11/libavcodec/libavcodec.a(libx264.o): In function `X264_init':
/usr/local/src/ffmpeg-export-2010-07-11/libavcodec/libx264.c:300: undefined reference to `x264_encoder_open_102'
collect2: ld returned 1 exit status
make: *** [ffmpeg_g] Error 1

and indeed, here is the code from line 300 of libx264.c

if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER)
x4->params.b_repeat_headers = 0;

x4->enc = x264_encoder_open(&x4->params);

So at this point I am way in over my head, and going under for the third time.

I'm trying to convert Cinelerra output for Vimeo. Anyone have any suggestions for alternative encodings that don't call libx264?

Thanks.

qyot27
July 18th, 2010, 12:03 AM
The audio is MPEG-4 AAC.

Thanks, I <3 Ubuntu Forums!
Assuming that the audio is the second track in the file:

mkvextract tracks input.mkv 2:input.aac
faad input.aac -o output.wav

Open the .wav in Audacity and merge the channels down to mono. Then either swap out the audio from the original using MKVToolNix (and use this new file to do the conversion) or find a way to point ffmpeg at the new audio file while disabling the original file's audio.

prupert
July 18th, 2010, 01:04 AM
Can you not transcode to a file with two audio channels and then to a file with one?

dannyboy79
July 19th, 2010, 03:31 PM
When I try to transcode using ffmpeg & libx264, I get the error "unknown encoder libx264" I've followed the threads, and reinstalled and updated libx264.

I've configured the latest ffmpeg (carefully following the instructions) with

After configuring, it reports that both libfaac and libx264 are enabled.
But when I compile I get this error:


and indeed, here is the code from line 300 of libx264.c

So at this point I am way in over my head, and going under for the third time.

I'm trying to convert Cinelerra output for Vimeo. Anyone have any suggestions for alternative encodings that don't call libx264?

Thanks.
i've had no problems at all using this google bash script to compile ffmpeg (svn) and x264 (git).
http://code.google.com/p/x264-ffmpeg-up-to-date/

prupert
July 19th, 2010, 05:01 PM
i've had no problems at all using this google bash script to compile ffmpeg (svn) and x264 (git).
http://code.google.com/p/x264-ffmpeg-up-to-date/

The script (that I wrote) basically does exactly what is listed in this HowTo, it just does it all automatically.

So, yeah, try it and see if it works for you, if it does, then you musta followed one of the instructions wrong somewhere...

n.hinton
July 19th, 2010, 07:04 PM
Hi prupert,

You beat me to it! I wouldn't run a script without at least having a glance through it, and if I learned nothing else from reading, at least I would have learned enough to credit yourself and FakeOutdoorsman for the script. Google script indeed!

FakeOutdoorsman
July 20th, 2010, 01:18 AM
Hi flyone,



I love fiddling with these things:


svn info | sed '5!d' | awk '{ print $NF }'

Would always work unless the number of lines changed, reasonably unlikely... A variation:


svn info | sed -e '5!d' -e 's/^.\{10\}//'

Andrew
I'm not very good at fiddling at these things (just look at that ugly x264 pkgversion). Much more useful. Adopting. Thanks, Andrew!



When I try to transcode using ffmpeg & libx264, I get the error "unknown encoder libx264" I've followed the threads, and reinstalled and updated libx264.

I've configured the latest ffmpeg (carefully following the instructions) with

After configuring, it reports that both libfaac and libx264 are enabled.
But when I compile I get this error:


and indeed, here is the code from line 300 of libx264.c

So at this point I am way in over my head, and going under for the third time.

I'm trying to convert Cinelerra output for Vimeo. Anyone have any suggestions for alternative encodings that don't call libx264?

Thanks.

My guess is that you still have an old x264 on your system. Try removing any x264 packages including libx264-dev and then continue with the Updating FFmpeg and x264 section of the guide.

madtowneast
July 20th, 2010, 04:53 AM
Hi,

Thank you for the tutorial and sorry of this error came up before, 110+ pages is a lot to go through. I was following the tutorial and got to the install ffmpeg step I was able to configure and make the needed files but when i wanted to install I got this error:




$ sudo checkinstall --pkgname=ffmpeg --pkgversion "4:SVN-r`svn info | sed '5!d' | awk '{ print $NF }'`" --backup=no --default
bash: !d': event not found


I am not sure what the problem is, so any help would be greatly appreciated.

Cheers

FakeOutdoorsman
July 20th, 2010, 06:35 AM
Hi,

Thank you for the tutorial and sorry of this error came up before, 110+ pages is a lot to go through. I was following the tutorial and got to the install ffmpeg step I was able to configure and make the needed files but when i wanted to install I got this error:




$ sudo checkinstall --pkgname=ffmpeg --pkgversion "4:SVN-r`svn info | sed '5!d' | awk '{ print $NF }'`" --backup=no --default
bash: !d': event not found


I am not sure what the problem is, so any help would be greatly appreciated.

Cheers

I just updated that command today, but it worked for me when I tested it on Lucid. I'll investigate more tomorrow. Until then you can use the old command:

sudo checkinstall --pkgname=ffmpeg --pkgversion "4:SVN-r`svn info | grep Revision | awk '{ print $NF }'`" --backup=no --default

andrew.46
July 20th, 2010, 08:26 AM
Hi,

Looks like the '!' mark is experiencing some trouble with the double quote marks enclosing the --pkgversion string and history completion is being invoked. Perhaps a better solution might be:


--pkgversion "4:SVN-r$(svn info | sed -n '5p' | awk '{ print $NF }')"

Andrew

tylerious
July 20th, 2010, 03:40 PM
I can confirm madtowneast's problem. I get the same error. Thanks for looking into it so promptly!

I tried andrew.46's advice replacing "5!d" with "5p". It seemed to be progressing fine until I got an error (what appears to be a vi screen):

"dpkg-deb: parse-error, in file '/var/tmp/tmp.VZ4mXXK66k/package/DEBIAN/control' near line 10 package 'ffmpeg':
empty value for version
~
~..."

Output then said:

"Building Debian package... FAILED!

*** Failed to build the package

Do you want to see the log file? [y]: y

Erasing temporary files...OK

Deleting temp dir...OK"

The "old command" employing grep worked fine. I had to change sed to grep with the qt-faststart checkinstall command as well.

Bachstelze
July 20th, 2010, 03:45 PM
People these days... Just run svn info, find the revision number, and then use it directly. Takes about five seconds.

ron999
July 20th, 2010, 11:13 PM
Hi
I'm following the instructions to install x264 and ffmpeg on Karmic.
After I've installed x264 I run the checkinstall and get this result:-

ron@ubuntu:~/x264$ sudo checkinstall --pkgname=x264 --pkgversion "1:0.svn`date +%Y%m%d`+`git rev-list HEAD -n 1 | head -c 7`" --backup=no --default

checkinstall 1.6.1, Copyright 2002 Felipe Eduardo Sanchez Diaz Duran
This software is released under the GNU GPL.


The package documentation directory ./doc-pak does not exist.
Should I create a default set of package docs? [y]: y

Preparing package documentation...OK

*****************************************
**** Debian package creation selected ***
*****************************************

This package will be built according to these values:

0 - Maintainer: [ root@ubuntu ]
1 - Summary: [ Package created with checkinstall 1.6.1 ]
2 - Name: [ x264 ]
3 - Version: [ 1:0.svn20100720+1a6fd47 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ checkinstall ]
7 - Architecture: [ i386 ]
8 - Source location: [ x264 ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ x264 ]

Enter a number to change any of them or press ENTER to continue:

Installing with make...Installing with install...

========================= Installation results ===========================
/usr/bin/installwatch: /var/tmp/tmp.6VITgKHULa/installscript.sh: /bin/sh: bad interpreter: Permission denied

**** Installation failed. Aborting package creation.

Cleaning up...OK

Bye.

ron@ubuntu:~/x264$


Is this normal?

FakeOutdoorsman
July 20th, 2010, 11:37 PM
Definitely not normal. Did you install Ubuntu yourself or are you renting a server that had Ubuntu pre-installed? Show the output of:

mount | grep noexec
Is /var/tmp located on a non-standard drive?

ron999
July 20th, 2010, 11:48 PM
Here's the output:-

ron@ubuntu:~$ mount | grep noexec
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /tmp type tmpfs (rw,noexec,noatime)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
tmpfs on /var/tmp type tmpfs (rw,noexec,noatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
ron@ubuntu:~$

The /var/tmp folder is not on a different drive. It's on the same drive as my home folder and all the others such as:- media, mnt, opt, usr...


Edit I installed Ubuntu myself on my own computer.

FakeOutdoorsman
July 20th, 2010, 11:57 PM
Here's what I get on a standard Karmic 32-bit VM:

$ mount | grep noexec
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
For some reason your /var/tmp has been mounted with noexec causing things to go ape. Have you "hardened" your system or made any security modifications?

ron999
July 21st, 2010, 12:03 AM
For some reason your /var/tmp has been mounted with noexec causing things to go ape. Have you "hardened" your system or made any security modifications?
I've got Firefox running in RAM. I had to do some modifications.
The details are here:-http://ubuntuguide.net/speed-up-firefox-by-moving-cache-into-ram-in-ubuntu

FakeOutdoorsman
July 21st, 2010, 12:14 AM
Ah, ok. Maybe this will work for you then:

Getting around tmpfs 'noexec' problems (http://serialized.net/2010/03/getting-around-tmpfs-noexec-problems/)

Does running Firefox in RAM show any performance differences?

ron999
July 21st, 2010, 12:17 AM
Ah, ok. Maybe this will work for you then:

Getting around tmpfs 'noexec' problems (http://serialized.net/2010/03/getting-around-tmpfs-noexec-problems/)

Does running Firefox in RAM show any performance differences?

I'm going to try it now.
Watch this space...

ron999
July 21st, 2010, 12:26 AM
Yes, that's fixed it.:D
I'll carry on with the rest now.


Done. The new package has been installed and saved to

/home/ron/x264/x264_1:0.svn20100721+1a6fd47-1_i386.deb

You can remove it from your system anytime using:

dpkg -r x264

************************************************** ********************

ron@ubuntu:~/x264$

ron999
July 21st, 2010, 12:42 AM
Hi
x264 and libvpx and libtheora have installed OK.
But ffmpeg won't write to that /tmp folder.
So I'm going to # those 2 extra lines on my fstab file then re-boot and try again.


ron@ubuntu:~/ffmpeg$ ./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
Unable to create and execute files in /tmp. Set the TMPDIR environment
variable to another directory and make sure that it is not mounted noexec.
Sanity test failed.

If you think configure made a mistake, make sure you are using the latest
version from SVN. If the latest version fails, report the problem to the
ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem.
ron@ubuntu:~/ffmpeg$

ron999
July 21st, 2010, 01:00 AM
Hi
I've deleted the two lines on the fstab file and I'm gonna start again.

I don't know whether running Firefox in RAM improves things or not.
I'm not sure.
It seems like a good idea, but maybe it's a con.:(

I've tried to follow your tutorial several times before, but each time when things went pear-shaped I lost my nerve. I didn't want to risk losing ffmpeg.
:o

ron999
July 21st, 2010, 01:42 AM
OK FakeOutdoorsman
Your tutorial is successful.:)
Everything is installed OK.
Thanks.:popcorn:

I have a question. I'd like to 'hide' the four new folders, so that I don't delete them by mistake.
Can I do this by putting a dot in front of their names, or is there a better way?


ron@ubuntu:~$ ffmpeg
FFmpeg version SVN-r24378, Copyright (c) 2000-2010 the FFmpeg developers
built on Jul 21 2010 01:34:53 with gcc 4.4.1
configuration: '--enable-gpl' '--enable-version3' '--enable-nonfree' '--enable-postproc' '--enable-pthreads' '--enable-libfaac' '--enable-libmp3lame' '--enable-libopencore-amrnb' '--enable-libopencore-amrwb' '--enable-libtheora' '--enable-libvpx' '--enable-libx264' '--enable-libxvid' '--enable-x11grab'
libavutil 50.22. 0 / 50.22. 0
libavcodec 52.84. 0 / 52.84. 0
libavformat 52.76. 0 / 52.76. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.25. 1 / 1.25. 1
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'
ron@ubuntu:~$

FakeOutdoorsman
July 21st, 2010, 01:53 AM
I have a question. I'd like to 'hide' the four new folders, so that I don't delete them by mistake.
Can I do this by putting a dot in front of their names, or is there a better way?

I guess it depends on your file manager (if you even use one), but you could make a directory such as .compiledjunk and then move the appropriate directories into it. It's similar to what I do on another distro, such as: ~/builds/ffmpeg. Just remember where your directories are if you want to follow the Upgrading FFmpeg and x264 section of the guide.

I would avoid creating a .ffmpeg directory because that's usually used for custom preset files. Probably wouldn't cause any issues because the original presets would be in the ffpresets sub-directory, but it's something to be aware of.

Glad you got it working.

ron999
July 21st, 2010, 02:04 AM
Just remember where your directories are if you want to follow the Upgrading FFmpeg and x264

Yes, I understand.
When updating x264 I would need to cd ./compiledjunk/x264
and similar for ffmpeg.
:D

Gigalo
July 23rd, 2010, 01:48 AM
Thank you fore the excellent instructions ... I got this to work with no problems on my 32 bit P4 machine. Having since moved to an AMD Phenom II X4 based system, I again attempted to do this compile. Unfortunately, I have run into a roadblock, ld crashes with:

~/git/x264$ make
gcc -o x264 x264.o matroska.o muxers.o libx264.a -lm -lpthread -s
collect2: ld terminated with signal 11 [Segmentation fault]
/usr/bin/ld: i386 architecture of input file `matroska.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `libx264.a(*.o)' is incompatible with i386:x86-64 output

the (*.o) in the libx264 line is substituted for all .o files in that group.

I am on Lucid, 64-Bit

Any and all assistance would be appreciatated.

FakeOutdoorsman
July 23rd, 2010, 02:15 AM
Did you follow the guide word-for-word, or did you add any modifications?

Update: I assumed you moved to a completely new system, but perhaps you're compiling from the same old ~/x264 directory? If that's the case then you'll need to make distclean. See the Updating FFmpeg and x264 section of the guide to see how to do that.

Gigalo
July 23rd, 2010, 05:13 AM
FakeOutdoorsman, your assumptions are all correct. Although I changed from 32 bit to 64 bit Ubuntu when I switched, doing a complete OS wipe to achieve a consistent result. That said, I have now recloned both x264 and ffmpeg. After this, no problem except that it took two compiles to ffmpeg to complete. Wierd.

At any rate, does anyone have any idea where the '-vf' command option went?

... As of my previous compile (~2mo ago) this worked.


ffmpeg -i $inFile -pass 1 -an -sn -vf crop=8:0:704:480 \
-vcodec libx264 -vpre slow_firstpass -b 2048k -bt 2048k \
-threads 0 -y -flags2 +dct8x8+bpyramid -flags +loop \
-deblockalpha 2 -deblockbeta 5 -r 30000/1001 -y \
-f matroska /dev/null

FFmpeg version SVN-r19327
... bunch of output ...

[NULL @ 0x21274b0]Unknown option 'vf'
[swscaler @ 0x21284e0]Unknown option 'vf'
[NULL @ 0x2126010]Unknown option 'f'
ffmpeg: unrecognized option '-vf'


Also, any critiques regarding my settings? This is being used to transcode DVD's.

dannyboy79
July 23rd, 2010, 02:32 PM
FakeOutdoorsman, your assumptions are all correct. Although I changed from 32 bit to 64 bit Ubuntu when I switched, doing a complete OS wipe to achieve a consistent result. That said, I have now recloned both x264 and ffmpeg. After this, no problem except that it took two compiles to ffmpeg to complete. Wierd.

At any rate, does anyone have any idea where the '-vf' command option went?

... As of my previous compile (~2mo ago) this worked.


ffmpeg -i $inFile -pass 1 -an -sn -vf crop=8:0:704:480 \
-vcodec libx264 -vpre slow_firstpass -b 2048k -bt 2048k \
-threads 0 -y -flags2 +dct8x8+bpyramid -flags +loop \
-deblockalpha 2 -deblockbeta 5 -r 30000/1001 -y \
-f matroska /dev/null

FFmpeg version SVN-r19327
... bunch of output ...

[NULL @ 0x21274b0]Unknown option 'vf'
[swscaler @ 0x21284e0]Unknown option 'vf'
[NULL @ 0x2126010]Unknown option 'f'
ffmpeg: unrecognized option '-vf'


Also, any critiques regarding my settings? This is being used to transcode DVD's.

not sure, according to here it's still there: http://www.ffmpeg.org/ffmpeg-doc.html

FakeOutdoorsman
July 23rd, 2010, 07:48 PM
FakeOutdoorsman, your assumptions are all correct. Although I changed from 32 bit to 64 bit Ubuntu when I switched, doing a complete OS wipe to achieve a consistent result. That said, I have now recloned both x264 and ffmpeg. After this, no problem except that it took two compiles to ffmpeg to complete. Wierd.

At any rate, does anyone have any idea where the '-vf' command option went?

... As of my previous compile (~2mo ago) this worked.


ffmpeg -i $inFile -pass 1 -an -sn -vf crop=8:0:704:480 \
-vcodec libx264 -vpre slow_firstpass -b 2048k -bt 2048k \
-threads 0 -y -flags2 +dct8x8+bpyramid -flags +loop \
-deblockalpha 2 -deblockbeta 5 -r 30000/1001 -y \
-f matroska /dev/null

FFmpeg version SVN-r19327
... bunch of output ...

[NULL @ 0x21274b0]Unknown option 'vf'
[swscaler @ 0x21284e0]Unknown option 'vf'
[NULL @ 0x2126010]Unknown option 'f'
ffmpeg: unrecognized option '-vf'


Also, any critiques regarding my settings? This is being used to transcode DVD's.

You're using an old FFmpeg revision (r19327). As of now, FFmpeg is at r24460. Can you show the complete FFmpeg output?

I usually recommend single-pass CRF instead of two-pass VBR (as it appears what you're using) unless you are require a specific bitrate and/or output file size. I would remove:

-flags2 +dct8x8+bpyramid -flags +loop -deblockalpha 2 -deblockbeta 5
...because the presets already cover most of these options. FFmpeg will inherit the frame rate of the input so you don't need to declare -r if you want the frame rate to remain the same as the input.

mocha
July 25th, 2010, 05:47 PM
Does anyone here know if ffmpeg has an equivalent option to mencoder's tele_src/tele_dest below:


tele_src and tele_dest
Enables arbitrary telecining using Donand Graft's DGPulldown
code. You need to specify the original and the desired framer‐
ate; the muxer will make the video stream look like it was en‐
coded at the desired framerate. It only works with MPEG-2 video
when the input framerate is smaller than the output framerate
and the framerate increase is <= 1.5.

EXAMPLE:
tele_src=25,tele_dest=30000/1001
PAL to NTSC telecining

If not, what is the recommended method in ffmpeg to convert PAL to NTSC for MPEG2-DVD encoding? Thanks.

qyot27
July 25th, 2010, 07:56 PM
Does anyone here know if ffmpeg has an equivalent option to mencoder's tele_src/tele_dest below:


tele_src and tele_dest
Enables arbitrary telecining using Donand Graft's DGPulldown
code. You need to specify the original and the desired framer‐
ate; the muxer will make the video stream look like it was en‐
coded at the desired framerate. It only works with MPEG-2 video
when the input framerate is smaller than the output framerate
and the framerate increase is <= 1.5.

EXAMPLE:
tele_src=25,tele_dest=30000/1001
PAL to NTSC telecining

If not, what is the recommended method in ffmpeg to convert PAL to NTSC for MPEG2-DVD encoding? Thanks.
It's been about 2 years since I messed with ffmpeg for MPEG-2 encoding, as it had issues encoding DVD compliant streams that are free of noticeable problems (namely, I-frames being encoded at a much higher quantizer than P or B frames, which is really obvious on the first frame of a video; fixing or lessening it required breaking DVD compliancy). And I also seem to remember it didn't support *any* form of pulldown flagging, although this might have changed, or changed only to support standard 3:2 pulldown. I do know that ffmpeg does report weird status info if you give it a stream with pulldown, although I don't know the extent of how good or bad a sign this is. All of that is why I use HCenc instead.

What I do know is that DGPulldown itself, which mencoder's docs mentioned that it uses, runs perfectly in Wine (as does HCenc, for that matter). You'll just need to mux the video and audio together with mplex from the MJPEGTools project after fixing the MPEG-2 stream. I do believe that mplex is available natively, although it'll run okay in Wine as well.

NobodyNowehreNothing
July 25th, 2010, 10:31 PM
Hey Guys,

Please if you can, help me out or just direct me to a right location, I have been stock for a whole week with this error, I have tried everything, Different versions of ubuntu (8.10,9.10 and now 10.04) , different versions of x264 , different versions of ffmpeg , everything i could, my client is now going mental!

This is now running on a Ubuntu Server 10.04 - I have gnome and everything installed, and I can VNC into the server which is setup on :1 , The server is at EC2 amazon, I did the same installation at home and I had no errors so I am going crazy! Whenever i try to use x11grab to capture screen, I get:

Segmentation fault

Here is the full version:


ffmpeg -v 2 -y -s 800x400 -r 9 -f x11grab -i :1.0 -g 300 -threads 0 -vcodec libtheora -sc_threshold -1 -cqp 22 -b 1200k /tmp/screenCapture1.ogv
FFmpeg version SVN-r24502, Copyright (c) 2000-2010 the FFmpeg developers
built on Jul 25 2010 20:36:29 with gcc 4.4.3
configuration: '--enable-gpl' '--enable-version3' '--enable-nonfree' '--enable-postproc' '--enable-pthreads' '--enable-libfaac' '--enable-libmp3lame' '--enable-libopencore-amrnb' '--enable-libopencore-amrwb' '--enable-libtheora' '--enable-libvorbis' '--enable-libvpx' '--enable-libx264' '--enable-libxvid' '--enable-x11grab'
libavutil 50.23. 0 / 50.23. 0
libavcore 0. 0. 0 / 0. 0. 0
libavcodec 52.84. 0 / 52.84. 0
libavformat 52.77. 0 / 52.77. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.26. 1 / 1.26. 1
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
[x11grab @ 0x9872470] device: :1.0 -> display: :1.0 x: 0 y: 0 width: 800 height: 400
[x11grab @ 0x9872470] shared memory extension found
Segmentation fault


Please guys, if you have any clue, help me out or point me to the right direction! Long time ubuntu user here :(

FakeOutdoorsman
July 26th, 2010, 05:08 AM
-threads 0 is currently only for libx264 as far as I know. Try removing that option or use a value more suitable for your CPU.

Do you get a seg fault with a very basic command? Example:

ffmpeg -t 5 -f x11grab -r 30 -s 640x320 -i :0.0 -y x11grab.mpg
If the basic command also provides a seg fault, you should file a bug report: Reporting a Bug To The FFmpeg Project (http://ffmpeg.org/bugreports.html). It is important to use a minimal command in your bug report to rule out extras such as threads or external libraries.

If the basic command does work, then I suggest using libx264 to capture your screen as shown in this useful guide:
HOWTO: Proper Screencasting on Linux (http://ubuntuforums.org/showthread.php?t=1392026)

mocha
July 26th, 2010, 08:25 AM
It's been about 2 years since I messed with ffmpeg for MPEG-2 encoding, as it had issues encoding DVD compliant streams that are free of noticeable problems (namely, I-frames being encoded at a much higher quantizer than P or B frames, which is really obvious on the first frame of a video; fixing or lessening it required breaking DVD compliancy). And I also seem to remember it didn't support *any* form of pulldown flagging, although this might have changed, or changed only to support standard 3:2 pulldown. I do know that ffmpeg does report weird status info if you give it a stream with pulldown, although I don't know the extent of how good or bad a sign this is. All of that is why I use HCenc instead.

What I do know is that DGPulldown itself, which mencoder's docs mentioned that it uses, runs perfectly in Wine (as does HCenc, for that matter). You'll just need to mux the video and audio together with mplex from the MJPEGTools project after fixing the MPEG-2 stream. I do believe that mplex is available natively, although it'll run okay in Wine as well.

Thanks for the info. It's interesting considering that not much development happens on mencoder but it is superior for some MPEG2/DVD stuff compared to ffmpeg.

ron999
August 1st, 2010, 12:20 AM
Hi
I don't seem to be able to convert audio into ogg using vorbis codec any more.
I think that previously I used a command like:

ffmpeg -i < input > -acodec libvorbis output.ogg

When I try that now it doesn't recognize libvorbis.

Unknown encoder 'libvorbis'

So I tried vorbis instead

ffmpeg -i < input > -acodec vorbis output.ogg

When I tried that it tells me to use '-strict experimental'.

encoder 'vorbis' is experimental and might produce bad results.
Add '-strict experimental' if you want to use it.

So I tried

ffmpeg -i < input > -acodec vorbis -strict experimental output.ogg
It converted OK, but when I played it back there is no sound output.


General
Complete name : output.ogg
Format : OGG
File size : 447 KiB
Duration : 3mn 18s
Overall bit rate : 18.5 Kbps

Audio
ID : 530006952 (0x1F9743A8)
Format : Vorbis
Duration : 3mn 18s
Channel(s) : 2 channels
Sampling rate : 44.1 KHz


There's information on the web that says the internal ogg encoder is no good and recommends that libvorbis is used instead.

Is this problem now caused because ffmpeg hasn't been compiled with libvorbis?
And is there some other way to use ffmpeg to convert using vorbis?
Or am I just doing something wrong?



FFmpeg version SVN-r24614, Copyright (c) 2000-2010 the FFmpeg developers
built on Jul 31 2010 15:19:46 with gcc 4.4.1
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
libavutil 50.23. 0 / 50.23. 0
libavcore 0. 2. 0 / 0. 2. 0
libavcodec 52.84. 2 / 52.84. 2
libavformat 52.77. 0 / 52.77. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.27. 0 / 1.27. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0


EDIT

I think I've answered my own questions now.
There's information in this blog here:-http://xiphmont.livejournal.com/51160.html

So I've re-compiled ffmpeg and added these two extras to the ./configure line
--disable-encoder=vorbis --enable-libvorbis


Now when I use the command:-

ffmpeg -i < input > -acodec vorbis output.ogg
It reports

Unknown encoder 'vorbis'
And when I use command:-

ffmpeg -i < input > -acodec libvorbis output.ogg
It converts OK and the result sounds alright.


General
Complete name : output.ogg
Format : OGG
File size : 1.33 MiB
Duration : 3mn 18s
Overall bit rate : 56.1 Kbps
Writing application : Lavc52.84.2

Audio
ID : 1396686445 (0x533FBE6D)
Format : Vorbis
Format settings, Floor : 1
Duration : 3mn 18s
Bit rate : 64.0 Kbps
Channel(s) : 2 channels
Sampling rate : 44.1 KHz
Stream size : 1.51 MiB
Writing library : libVorbis 1.2 (UTC 2007-06-22)



ron@ubuntu:~$ ffmpeg
FFmpeg version SVN-r24643, Copyright (c) 2000-2010 the FFmpeg developers
built on Aug 1 2010 10:38:14 with gcc 4.4.1
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --disable-encoder=vorbis --enable-libvorbis
libavutil 50.23. 0 / 50.23. 0
libavcore 0. 2. 0 / 0. 2. 0
libavcodec 52.84. 2 / 52.84. 2
libavformat 52.78. 0 / 52.78. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.27. 0 / 1.27. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0

Mustache Villain
August 1st, 2010, 09:05 AM
Any word on when we will see ffvp8 codec, the alternative to Google's libvpx?

dejan034
August 1st, 2010, 09:39 AM
Good frontend for ffmpeg...


http://kde-apps.org/content/show.php/Hyper+Video+Converter?content=67781

andrew.46
August 1st, 2010, 09:42 AM
Hi Mustache,


Any word on when we will see ffvp8 codec, the alternative to Google's libvpx?

Decoder is there now:



andrew@skamandros~$ mplayer -vc help | grep ffvp8
ffvp8 ffmpeg working FFmpeg VP8 [vp8]


Andrew

mc4man
August 1st, 2010, 10:57 AM
Hi
I don't seem to be able to convert audio into ogg using vorbis codec any more.

Is this problem now caused because ffmpeg hasn't been compiled with libvorbis?

That would do it.
You would want to add --enable-libvorbis to your ./configure

( Isn't in the posted karmic instr.'s but you can add w/ no issue

ron999
August 1st, 2010, 11:23 AM
That would do it.
You would want to add --enable-libvorbis to your ./configure

( Isn't in the posted karmic instr.'s but you can add w/ no issue

Thanks mc4man
We are cross-posting.:D
I've just edited my post here:-http://ubuntu-ky.ubuntuforums.org/showpost.php?p=9662787&postcount=1169

stressat
August 1st, 2010, 05:54 PM
Hello!
I use ffmpeg for recording audio/video x11:
ffmpeg -f oss -i /dev/audio -f x11grab -s 1280x960 -r 24 -b 6500 -bt 712k -sameq -i :0.0 ~/out.avi

It is possible to do same thing in tty (Ctrl+Alt+F1....F6) ???

Bachstelze
August 1st, 2010, 05:57 PM
Hello!
I use ffmpeg for recording audio/video x11:
ffmpeg -f oss -i /dev/audio -f x11grab -s 1280x960 -r 24 -b 6500 -bt 712k -sameq -i :0.0 ~/out.avi

It is possible to do same thing in tty (Ctrl+Alt+F1....F6) ???

There is nothing to record in a tty, it's just text. You can use script to get a transcript of a shell session.

Mustache Villain
August 1st, 2010, 09:30 PM
Hi Mustache,

Decoder is there now:



andrew@skamandros~$ mplayer -vc help | grep ffvp8
ffvp8 ffmpeg working FFmpeg VP8 [vp8]
Andrew

I don't see it, but I haven't compiled according to this thread. I used the lucidbleed experimental PPA (https://launchpad.net/%7Elucid-bleed/+archive/lucidbleed-exp). Are they in the latest svn?

stressat
August 2nd, 2010, 05:02 AM
There is nothing to record in a tty, it's just text. You can use script to get a transcript of a shell session.

I'm watching video file with mplayer (in a small window/ screen...), i use moc for audio file, i use fbterm +fbv for background image in tty...
But you can be more explicit with that script? An example???
Sorry for my poor english, is not my native language. I'm a noob too...
Thanks you for your answer, have a nice day!

stressat
August 2nd, 2010, 05:44 PM
Ok, i saw what doing "script", thanks, it's useful. But i want something else:
- fbgrab, scrot, import... = snapshots in tty
- ffmpeg, recordmydesktop...= audio/video record in x11
- ??? = audio/video record in tty...

Just text?;)

FakeOutdoorsman
August 2nd, 2010, 07:03 PM
That would do it.
You would want to add --enable-libvorbis to your ./configure

( Isn't in the posted karmic instr.'s but you can add w/ no issue
Updated the Karmic guide to include libvorbis. That should have been added a long time ago. Too many Ubuntu releases to keep up with.


I don't see it, but I haven't compiled according to this thread. I used the lucidbleed experimental PPA (https://launchpad.net/%7Elucid-bleed/+archive/lucidbleed-exp). Are they in the latest svn?

No. It appears to be using the FFmpeg 0.6 branch (4:0.6-2ubuntu2~ppa1~lucid1), but I did not test this to backup my assumption. To see if your FFmpeg includes the native VP8 decoder:

$ ffmpeg -codecs 2>/dev/null | grep vp8
D V D vp8 On2 VP8

Freyr92
August 4th, 2010, 03:34 AM
My solution to the checkinstall of ffmpeg in Spanish was:


cd
git clone git://git.ffmpeg.org/ffmpeg/
cd ffmpeg
git clone git://git.ffmpeg.org/libswscale/
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
make
sudo checkinstall --pkgname=ffmpeg --pkgversion="`date +%Y%m%d%H%M`-git" --backup=no --default
hash x264 ffmpeg ffplay

I prefer git to SVN ;D

p.d: and update:


cd ~/ffmpeg
make distclean
git pull

FakeOutdoorsman
August 4th, 2010, 09:36 PM
If you're using FFmpeg SVN and you experience a crash or odd behavior, then you may be interested in submitting a bug report to the FFmpeg project. If you are using FFmpeg from the Ubuntu repository, please report bugs to Launchpad (https://bugs.launchpad.net/ubuntu/+source/ffmpeg) instead.

Read the bug report guidelines
Reporting a Bug To The FFmpeg Project (http://ffmpeg.org/bugreports.html). You don't want to get flamed for not strictly following directions. The goal of this post is not to duplicate the guidelines, but to provide some more instruction that may be useful to Ubuntu users, to help make reporting a bug less intimidating, and to make your bug report more informative.

Ask first
It is a good idea to ask the #ffmpeg IRC channel or ffmpeg-user mailing list (http://ffmpeg.org/contact.html) if anyone else can duplicate your bug. Insight from others may reveal your issue as not a bug or they can help provide additional information.

Search for your bug
Go to the FFmpeg Issue Tracker (https://roundup.ffmpeg.org/) (yes, it's horrendously slow), and then perform a search (https://roundup.ffmpeg.org/issue?@template=search) before creating a new bug report. Someone else may have already reported your bug. You don't want to get flamed for making a duplicate bug report. There are many search options. I generally just use the All text* search box and leave everything else as is.

Report your bug
If you find nothing, then register (https://roundup.ffmpeg.org/user?@template=register) and then create (https://roundup.ffmpeg.org/issue?@template=item) your new bug report.


http://fakeoutdoorsman.com/ffmpeg/bug.png
Creating a FFmpeg Bug Report


Title: Give a detailed and useful title. A title like segmentation fault when capturing screen with x11grab is better than ffmpeg crashes.
Type: Choose bug.
Priority: Choose important for crashes/segmentation faults and normal for everything else.
Status: I've always used New / New when creating a bug.
Nosy List: Adding your user name to the Nosy List will e-mail you when someone replies to your bug or updates the bug priority.
Change Note: This is where you provide a description of the bug, how to duplicate the bug, and where samples are located.

You can generally ignore the rest of the options.

Change Note Continued...
Always provide the most simple ffmpeg command. For example, if you experience a crash with:

ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 30 -s 1024x768 -i :0.0 -acodec pcm_s16le \
-vcodec libx264 -vpre lossless_ultrafast -threads 0 output.mkv
...you should also try a more basic command:

ffmpeg -f x11grab -r 30 -s 1024x768 -i :0.0 output.mpg
If the simple command still crashes use it instead so the developers can rule out extra junk that may cause issues such as threads or external encoders.

Now submit your bug report. It will be assigned an issue ID number, such as issue1392, which will be important if you want to submit a sample file.

Providing a sample
You should provide a sample if it is important to reproducing the bug or if a developer asks for one. This is explained in the Submitting Sample Media section of Reporting a Bug To The FFmpeg Project (http://ffmpeg.org/bugreports.html). All that I will add is when creating a new directory as the page instructs, name it the same as your issue number. This will make life easier for the server admins. Then navigate back to your bug report and make a comment indicating where your sample is. Something like: "Sample located at incoming/issue1392/descriptive_sample_name.foo".

gdb output and backtrace
A developer will most likely ask you to provide the gdb output and a backtrace if you are reporting a crash bug. This is mostly described at Reporting a Bug To The FFmpeg Project (http://ffmpeg.org/bugreports.html). Some additional info:

Install gdb if you don't have it:

sudo apt-get install gdb

ffmpeg_g is located in your ~/ffmpeg directory if you followed HOWTO: Install and use the latest FFmpeg and x264 (http://ubuntuforums.org/showthread.php?t=786095).

If you need additional help, the best places to ask questions are the #ffmpeg IRC channel, the ffmpeg-user mailing list (http://ffmpeg.org/contact.html), or you can reply to this post.

FakeOutdoorsman
August 5th, 2010, 06:47 PM
I don't own an iPod, yet I have an iPod example on this guide: iPod 640x480 using the slow and ipod640 presets. I'm not sure if it actually works. Is anyone willing to test it (and mention the i[Pod|Pad|Phone] version)?

Also, the commands are in one long string. Originally I thought it would be easier for new users to show that each command is on it's own line. What do most people prefer? The long, unbroken commands, or something that you can see all at once, but is not un-broken like this:

cd
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc \
--enable-pthreads --enable-libfaac --enable-libmp3lame \
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora \
--enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid \
--enable-x11grab
make
sudo checkinstall --pkgname=ffmpeg --pkgversion "4:SVN-r`svn info | grep Revision | \
awk '{ print $NF }'`" --backup=no --default
hash x264 ffmpeg ffplay

andrew.46
August 6th, 2010, 12:32 AM
Hi FakeOutdoorsman,


Also, the commands are in one long string. Originally I thought it would be easier for new users to show that each command is on it's own line. What do most people prefer? The long, unbroken commands, or something that you can see all at once, but is not un-broken...

I prefer a command I can see on one screen, divided by the '\' character as you have demonstrated. The downfall of course is that less experienced users will be unsure which is a single command and there will inevitably be some copy and paste errors...

Andrew

qyot27
August 6th, 2010, 07:23 AM
For quick reference, I also prefer the \ notation, but for copy-paste stuff (that isn't going into a script, anyway) it would make it harder for new users that aren't aware of what \ does. IMO, the way to remedy that is simply to add a cautionary note about the usage of \, and to ensure one has copied all lines before trying to execute it.

Bachstelze
August 6th, 2010, 07:32 AM
For quick reference, I also prefer the \ notation, but for copy-paste stuff (that isn't going into a script, anyway) it would make it harder for new users that aren't aware of what \ does. IMO, the way to remedy that is simply to add a cautionary note about the usage of \, and to ensure one has copied all lines before trying to execute it.

If you just copy-paste the lines with the \ one at a time (or even all at once), it will work just as well. I fail to see how a note would be useful.

skaag
August 6th, 2010, 03:49 PM
I have a problem compiling with libvpx. Here's the error:



CC libavcodec/libvpxdec.o
libavcodec/libvpxdec.c: In function ‘vp8_decode’:
libavcodec/libvpxdec.c:89: error: implicit declaration of function ‘av_check_image_size’
make: *** [libavcodec/libvpxdec.o] Error 1


For now I compiled ffmpeg without libvpx, but I would like to have that capability.
Could it be that the latest version in the repository simply has an error?

FakeOutdoorsman
August 6th, 2010, 08:12 PM
r24717 compiled and installed ok for me on Lucid 64-bit. Looks like it was already fixed:

$ svn log -l 24 svn://svn.mplayerhq.hu/ffmpeg/trunk
------------------------------------------------------------------------
r24717 | alexc | 2010-08-06 10:57:14 -0800 (Fri, 06 Aug 2010) | 4 lines

libvpxdec: Fix "error: implicit declaration of function ‘av_check_image_size’".

av_check_image_size() is declared in libavcore/imgutils.h.

------------------------------------------------------------------------

theluddite
August 12th, 2010, 12:47 AM
Everything was working famously until I got to step 6 in your guide (http://ubuntuforums.org/showpost.php?p=9114176&postcount=967). After make, I got this error:


...
libavformat/metadata.c:76: warning: assignment discards qualifiers from pointer target type
CC libavformat/metadata_compat.o
CC libavformat/mm.o
CC libavformat/mmf.o
make: *** No rule to make target `libavformat/mms.o', needed by `libavformat/libavformat.a'. Stop.


I'd really like to use some of the encoders not supplied in the .deb. What the heck is the problem?

FakeOutdoorsman
August 12th, 2010, 01:10 AM
Everything was working famously until I got to step 6 in your guide (http://ubuntuforums.org/showpost.php?p=9114176&postcount=967). After make, I got this error:


I'd really like to use some of the encoders not supplied in the .deb. What the heck is the problem?

Confirmed. The developers just noticed and it will probably will be fixed in less than a few hours. If you don't want to wait:

cd ~/ffmpeg
make distclean
svn up -r 24778 svn://svn.ffmpeg.org/ffmpeg/trunk .
...and then continue with the ./configure line in step 6.

iymovies
August 12th, 2010, 01:34 AM
Hello,

Linux Mint user here.

Just googled an error I got, and was sent to this page.

I'm getting a slightly different error however:


CC libavformat/metadata_compat.o
CC libavformat/mm.o
CC libavformat/mmf.o
CC libavformat/mms.o
libavformat/mms.c:23:17: error: mms.h: No such file or directory
libavformat/mms.c:27: error: expected ‘)’ before ‘*’ token
libavformat/mms.c:42: error: expected ‘)’ before ‘*’ token
libavformat/mms.c:52: error: expected ‘)’ before ‘*’ token
make: *** [libavformat/mms.o] Error 1

Any idea?

Here's what I'm cofniguring:


./configure --enable-libx264 --enable-pthreads --enable-libxvid --enable-libmp3lame --enable-libfaac --enable-gpl --enable-nonfree

FakeOutdoorsman
August 12th, 2010, 01:39 AM
...
Any idea?
...

Once in a while a revision to FFmpeg SVN will break something and it won't compile. It doesn't happen often but fixes usually come quickly. See my previous post on this thread of you want to compile the last working revision, or you can watch the FFmpeg log (http://git.ffmpeg.org/?p=ffmpeg;a=summary) for a new revision that fixes this error.

iymovies
August 12th, 2010, 01:44 AM
Once in a while a revision to FFmpeg SVN will break something and it won't compile. It doesn't happen often but fixes usually come quickly. See my previous post on this thread of you want to compile the last working revision, or you can watch the FFmpeg log (http://git.ffmpeg.org/?p=ffmpeg;a=summary) for a new revision that fixes this error.

Thanks for the response, Dark_Shikari from #ffmpeg had me run "svn up -r 24778" and it fixed it without a problem.

theluddite
August 12th, 2010, 03:55 AM
If you don't want to wait:

cd ~/ffmpeg
make distclean
svn up -r 24778 svn://svn.ffmpeg.org/ffmpeg/trunk .

Thanks for the super-fast response! But I guess the svn hasn't been updated yet. I'm still getting the same error. I'll try again tomorrow.

FakeOutdoorsman
August 12th, 2010, 06:30 AM
It should be working now:

$ svn log -l 3 svn://svn.mplayerhq.hu/ffmpeg/trunk

r24784 | rbultje | 2010-08-11 18:01:33 -0800 (Wed, 11 Aug 2010) | 3 lines
Add another missing file from r24799.
Compiled and installed fine for me.

theluddite
August 12th, 2010, 08:18 PM
It should be working now:

Compiled and installed fine for me.

I checked out version r24789. GTG. Thanks for the help.

dannyboy79
August 12th, 2010, 09:50 PM
I checked out version r24789. GTG. Thanks for the help.

huh? im using the google code script to keep my ffmpeg up to date, at least I thought. i just ran it again and it says this:

ffmpeg is at revision 24784
recent ffmpeg SVN changes
svn: No such revision 24785
one
ffmpeg updated.
maybe i need to check with google code script author about it not going to revision 24789

prupert
August 12th, 2010, 09:55 PM
huh? im using the google code script to keep my ffmpeg up to date, at least I thought. i just ran it again and it says this:

ffmpeg is at revision 24784
recent ffmpeg SVN changes
svn: No such revision 24785
one
ffmpeg updated.
maybe i need to check with google code script author about it not going to revision 24789

Hi, I wrote the script you are using (from here yes? http://code.google.com/p/x264-ffmpeg-up-to-date/) Sounds like you haven't updated to the latest version. The code that checked what SVN version was currrent and the version installed didn't work very well, so I ditched it. If you simply run


ffmpeg

It will show you which version of FFmpeg you are using...

Edit, I just checked using ffmpegupv1.7.sh and it built and installed:

FFmpeg version SVN-r24789, Copyright (c) 2000-2010 the FFmpeg developers
built on Aug 12 2010 22:01:01 with gcc 4.4.3

So all is ok.

feranick
August 15th, 2010, 04:30 AM
I am the maintainer of Lucidbleed ppa. The version of ffmpeg is a simple backport from the package currently available in Maverick.

mc4man
August 15th, 2010, 05:59 AM
I am the maintainer of Lucidbleed ppa ...

That appears to be a well rounded ppa with some replacement builds of apps that would be affected and or improved by new ffmpeg libs.

IF I was using lucid and the Lucidbleed ppa (https://launchpad.net/~lucid-bleed/+archive/ppa) I'd probably use this ppa instead for installing some updated gstreamer plugins (https://launchpad.net/~gstreamer-developers/+archive/ppa). (including the gstreamer-ffmpeg plugin

FakeOutdoorsman
August 16th, 2010, 06:58 AM
Another attempt to make the instructions work with non-English languages or locales. As we recall, the FFmpeg checkinstall command currently gives an error. En Espańol:

dpkg-deb - error: (origen) versión (`SVN-r') no contiene ningún dígito
dpkg-deb: 1 errores en el fichero de control
Adding LANG=C seems to solve this issue:

sudo checkinstall --pkgname=ffmpeg --pkgversion "4:SVN-r`LANG=C svn info | grep Revision \
| awk '{ print $NF }'`" --backup=no --default
I've only tested this on my new Spanish Ubuntu Maverick VM. As the crazy German asked in Marathon Man: "Is it safe?".

Also, I can't read Spanish.

mc4man
August 17th, 2010, 07:59 PM
What is avcore for?

FakeOutdoorsman
August 17th, 2010, 08:20 PM
Good question. According to the Add libavcore (http://git.ffmpeg.org/?p=ffmpeg;a=commit;h=5b9b34740a10ed254ecd14e40e368 e375e7e7b97) commit:

The new library is meant to contain the core multimedia utilities for FFmpeg, to make them shareable between more libav* libraries.
...and [FFmpeg-devel] [RFC] New library for shared non-generic libav* utils (http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2010-July/092675.html):

This new lib will contain all code/utils which need to be shared between more libav* libs, and are not enough generic to deserve a place in libavutil, which is to be considered a collection of generic/non-multimedia-related utilities.

tulpie
August 19th, 2010, 09:24 PM
I now have found this

http://www3.pic-upload.de/19.08.10/vqlfbodcs5o.png
http://wiki.ubuntuusers.de/HandBrake

my Problem was to transcode asf Stream (not seakable) in mp4 Format without video and audio delay. Couriosiusly AAC works :-)
Can Anyone inspect why it work ---> FFmpeg

Pakages are there:

https://edge.launchpad.net/~stebbins/+archive/handbrake-snapshots/+packages

My Commandline to transcode asf to mp4 is Simpel:


HandBrakeCLI -i "source.asf" -o "destination.mp4"


https://trac.handbrake.fr/wiki/CLIGuide


Hehehehehe it looks like all CPU-Cores are used.
(is it possible that this Programm realy use FFmpeg as backbone :-) :-) )))

FakeOutdoorsman
August 19th, 2010, 09:27 PM
Maybe I'm missing something obvious, but I don't understand your question.

tulpie
August 19th, 2010, 09:45 PM
I don't understand myself :-)
I am only happy that anyone compilied a nice Pakage, that use all Core's and the AAC encoder. that's all :lolflag:

mocha
August 19th, 2010, 10:47 PM
my Problem was to transcode asf Stream (not seakable) in mp4 Format without video and audio delay.


FYI, there's a neat Linux native app to deal with troublesome ASF streams here http://www.radioactivepages.com/index.php?docid=asfbin&lang=en&section=software I use it a lot on streams I captured from sopcast.

Vrroom
August 20th, 2010, 04:35 PM
I don't know if anyone else have mentioned or not but I use this GUI for ffmpeg: Encode (http://ubuntu-vibes.blogspot.com/2010/08/encode-ffmpeg-video-converter-with-gui.html)

Linuxforall
August 20th, 2010, 05:49 PM
I don't know if anyone else have mentioned or not but I use this GUI for ffmpeg: Encode (http://ubuntu-vibes.blogspot.com/2010/08/encode-ffmpeg-video-converter-with-gui.html)

Thats a cool encoder, even though its gtk, will give it a spin, I usually use WinFF.

Vrroom
August 20th, 2010, 08:36 PM
yeah I used to have winff sometime back....but It cannot convert .ogv files. So I switched....

tulpie
August 21st, 2010, 09:09 PM
Hello Pupils,

I want you to show my Script i have made and improved.
this Script kann strip

--------- From Orginal Video -------- Input ---------
-Video duration
-aspect Ratio
-And Video dimension
-Bitrate

to set up all "optimum" Encoding result.
################################################## ######################



###Output Display:
#aim width
MAXW="400"
#aim height
MAXH="240"
#input file
INPUT=$1
#output file
OUTPUT=$2
#cut in second of beginning
V="00"
#cut from back of Video in Second
HINTENWEG="00"
#cut panel color
color="0x000000"


################################################## ##############
#change nothing until the ffmpeg line come down heer


ffmpeg -i "${INPUT}" 2> "${fileinfo}"
durati=$(cat "${fileinfo}" | gawk -F"Duration: " '{print $2}' | grep -v '^$')
hour=$(expr substr "${durati}" 1 2)
TIME=$(expr ${hour} \* 3600)
mins=$(expr substr "${durati}" 4 2)
mins=$(expr ${mins} \* 60)
TIME=$(expr ${TIME} + $mins)
secs=$(expr substr "${durati}" 7 2)
TIME=$(expr ${TIME} + ${secs})
TIME=$(expr ${TIME} + 1)
TIME=$(expr ${TIME} - $HINTENWEG)
TIME=$(expr ${TIME} + 1)
echo "###################"
echo "# TIME :${TIME}"

######## Größe genau einpassen
title=$( cat "${fileinfo}" | gawk -F"from '" '{print $2}' | sort | gawk -F: '{print $1}' | grep -v '^$' | gawk -F.avi '{print $1}')
bitra=$( cat "${fileinfo}" | gawk -Fbitrate: '{print $2}' | grep -v '^$' | gawk '{print $1}')
aspect=$(cat "${fileinfo}" | gawk -F#0.1 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $1/$2}'| sed 's/ //g')
weight=$(cat "${fileinfo}" | gawk -F#0.1 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $1}' | sed 's/ //g')
height=$(cat "${fileinfo}" | gawk -F#0.1 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $2}' | sed 's/ //g')
if [[ ${weight} == "stereo" ]]; then
echo "# weight=stereo"
weight=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $1}' | sed 's/ //g')
height=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $2}' | sed 's/ //g')
aspect=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $1/$2}'| sed 's/ //g')
fi
if [[ ${weight} == "2 channels" ]]; then
echo "# weight=2 channels"
weight=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $1}' | sed 's/ //g')
height=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $2}' | sed 's/ //g')
aspect=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $1/$2}'| sed 's/ //g')
fi
if [[ ${weight} == "" ]]; then
echo "# weight="
weight=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $1}' | sed 's/ //g')
height=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $2}' | sed 's/ //g')
aspect=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $1/$2}'| sed 's/ //g')
fi
if [[ ${weight} == "mono" ]]; then
echo "# weight=mono"
weight=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $1}' | sed 's/ //g')
height=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $2}' | sed 's/ //g')
aspect=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $1/$2}'| sed 's/ //g')
fi
if [[ ${weight} == "1 channels" ]]; then
echo "# weight=1 channels"
weight=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $1}' | sed 's/ //g')
height=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $2}' | sed 's/ //g')
aspect=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $1/$2}'| sed 's/ //g')
fi
if [[ ${weight} == "2channels" ]]; then
echo "# weight=2channels"
weight=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $1}' | sed 's/ //g')
height=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $2}' | sed 's/ //g')
aspect=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $1/$2}'| sed 's/ //g')
fi
if [[ ${weight} == "1channels" ]]; then
echo "# weight=1channels"
weight=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $1}' | sed 's/ //g')
height=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $2}' | sed 's/ //g')
aspect=$(cat "${fileinfo}" | gawk -F#0.0 '{print $2}' | grep -v '^$' | gawk -F, '{print $3}' | gawk -F[ '{print $1}' | gawk -Fx '{print $1/$2}'| sed 's/ //g')
fi

rm "${fileinfo}"

echo "#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
echo "#title :${title}"
echo "#bitra :${bitra}"
echo "#aspect :${aspect}"
echo "#weight :${weight}"
echo "#height :${height}"
echo "#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"

#Calculate padding?? :-)

maxw=$(expr ${MAXW})
maxh=$(expr ${MAXH})
kleiner="0"
#first look if any caluculation an changings are necessary
#Displays-width greater then Video-size
if [[ $(expr ${maxw}) -gt ${weight} ]]; then
#Display-high greater then Video-high
if [[ $(expr ${maxh}) -gt ${height} ]]; then
kleiner="1"
www=${weight}
hhh=${height}
fi
fi

#now it's clear.... orginal Video greater than Display
if [[ ${kleiner} == "0" ]]; then

hhh=${MAXH}
www=${MAXW}
#################################################
#Video-width greater Display-width
if [[ $(expr ${weight}) -gt ${maxw} ]]; then
www=${MAXW}
a=$(echo "scale=4 ; ${weight}/${maxw}" | bc)
h=$(echo "scale=0 ; ${height}/${a}" | bc)
### hhh keine ungerade Zahl
hh=$(echo "scale=0 ; ${h}/2" | bc)
hhh=$(echo "scale=0 ; ${hh}*2" | bc)
#Video-width smaler Displays-width
else
hhh=${MAXH}
a=$(echo "scale=4 ; ${height}/${maxh}" | bc)
w=$(echo "scale=0 ; ${weight}/${a}" | bc)
###look that www no 3,7,9,11,15,19,111 number
ww=$(echo "scale=0 ; ${w}/2" | bc)
www=$(echo "scale=0 ; ${ww}*2" | bc)
fi
#################################################
#Video-high always bigger than Display-high
if [[ $(expr ${hhh}) -gt ${maxh} ]]; then
hhh=${MAXH}
a=$(echo "scale=4 ; ${height}/${maxh}" | bc)
w=$(echo "scale=0 ; ${weight}/${a}" | bc)
###look that www no 3,7,9,11,15,19,111 number
ww=$(echo "scale=0 ; ${w}/2" | bc)
www=$(echo "scale=0 ; ${ww}*2" | bc)
#Videobreite kleiner Displaysbreite
fi
#################################################
#Video-width always bigger than Display-width
if [[ $(expr ${www}) -gt ${maxw} ]]; then
www=${MAXW}
a=$(echo "scale=4 ; ${weight}/${maxw}" | bc)
h=$(echo "scale=0 ; ${height}/${a}" | bc)
### look that hhhh no 3,7,9,11,15,19,111 number
hh=$(echo "scale=0 ; ${h}/2" | bc)
hhh=$(echo "scale=0 ; ${hh}*2" | bc)
fi
#################################################
echo "#www :${www}"
echo "#hhh :${hhh}"
echo "#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
#################################################
fi

padx="0"
pady="0"
#################################################
if [[ ! ${www} == ${MAXW} ]]; then
padx=$(echo "scale=0 ; ${MAXW}-${www}" | bc)
#padx=$(echo "scale=0 ; ${padx}/2" | bc)
fi
echo "#padx= ${padx}"
#################################################
if [[ ! ${hhh} == ${MAXH} ]]; then
pady=$(echo "scale=0 ; ${MAXH}-${hhh}" | bc)
#pady=$(echo "scale=0 ; ${pady}/2" | bc)
fi
echo "#pady= ${pady}"
echo "#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
#################################################

ffmpeg -y -i ${INPUT} -vcodec mpeg4 -b "${bitra}k" -acodec libmp3lame -f avi -ss 00:00:${V} -t ${TIME} -s ${www}:${hhh} -vf pad=${MAXW}:${MAXH}:${padx}:${pady}:${color} ${OUTPUT}.avi



there was until jet, no INPUT wich are not working with this littel script.
I knew that the work was a little bit to hard because aspect ratio would be enought for my little Player :-) :-)

Benoe
August 24th, 2010, 09:47 AM
I don't know if anyone else have mentioned or not but I use this GUI for ffmpeg: Encode (http://ubuntu-vibes.blogspot.com/2010/08/encode-ffmpeg-video-converter-with-gui.html)

I tried to install this encode but it stops with the following message:

" trying to overwrite '/usr/local/share/ffmpeg/libx264-max.ffpreset', which is also in package ffmpeg 4:SVN-r24894-1"

I think it is packaged against the ffmpeg version from the repository

tulpie
August 24th, 2010, 11:38 AM
I tried to install this encode but it stops with the following message:

" trying to overwrite '/usr/local/share/ffmpeg/libx264-max.ffpreset', which is also in package ffmpeg 4:SVN-r24894-1"

I think it is packaged against the ffmpeg version from the repository

the command line options has changed between the repository version and the svn version of ffmpeg. I don't know if the old Front-Ends use the new command line options :-) :-)

xidianzhangjun
August 25th, 2010, 08:41 AM
In the "install ffmpeg" step, "./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab"? "--enable-shared" is not required?

Benoe
August 25th, 2010, 10:22 AM
the command line options has changed between the repository version and the svn version of ffmpeg. I don't know if the old Front-Ends use the new command line options :-) :-)

Now I see that ffmpeg is already included in the Encode package. That's why it causes conflict

earthmeLon
August 25th, 2010, 05:21 PM
Thank you so much for this.

When trying to run the first command you mentioned, I got the error:
[libfaac @ 0x28a78b0] libfaac doesn't support this output format!

I changed my parameters to:
-acodec libfaac -ac 2 -ar 48000
vs what you have:
libfaac -ab 192k -ac 2

Not sure what the difference is, but it's working for me :D

prupert
August 25th, 2010, 06:02 PM
Thank you so much for this.

When trying to run the first command you mentioned, I got the error:
[libfaac @ 0x28a78b0] libfaac doesn't support this output format!

I changed my parameters to:
-acodec libfaac -ac 2 -ar 48000
vs what you have:
libfaac -ab 192k -ac 2

Not sure what the difference is, but it's working for me :D

Yeah, sometimes FFmpeg can be a bit backward and you have to tell it some things when you think they would be taken for granted. So, in your case, adding -ar 48000, which relates to the samplerate frequency which AAC requires to be at 48000.

FakeOutdoorsman
August 25th, 2010, 07:11 PM
In the "install ffmpeg" step, "./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab"? "--enable-shared" is not required?

No, it is not required. You may need it if you're compiling something else that requires FFmpeg to have --enable-shared. If you do --enable-shared, then make sure to run sudo ldconfig after FFmpeg installation.



Thank you so much for this.

When trying to run the first command you mentioned, I got the error:
[libfaac @ 0x28a78b0] libfaac doesn't support this output format!

I changed my parameters to:
-acodec libfaac -ac 2 -ar 48000
vs what you have:
libfaac -ab 192k -ac 2

Not sure what the difference is, but it's working for me :D

FFmpeg will attempt to use the same -ar as the input file. Your input probably has an -ar, such as 8000 Hz, that was incompatible with libfaac.


So, in your case, adding -ar 48000, which relates to the samplerate frequency which AAC requires to be at 48000.
AAC can use some -ar < 48000 Hz as well. I'm not sure of the range though.

earthmeLon
August 25th, 2010, 07:13 PM
FFmpeg will attempt to use the same -ar as the input file. Your input probably has an -ar, such as 8000 Hz, that was incompatible with libfaac.

Ah, so you're suggesting next time I use:
-acodec libfaac -ac 2 -ar 48000 -ab 192k

FakeOutdoorsman
August 25th, 2010, 07:35 PM
I don't know much about audio rate conversion, and I'm not sure what -ar would be optimal in your case, but if -ar 48000 sounds good to you and works on whatever device your file is playing on then go for it.

mc4man
August 25th, 2010, 09:08 PM
According to the Add libavcore commit: ect.
Thanks for that..
I've moved up to maverick and decided to put some new shared aac enabled packages in place.
While probably no advantage used a svn source rather than the 0.6 release and was a bit surprised when the new libs showed up (and nowhere to install package wise.
Went ahead and resolved that and the newer libs are fine in 10.10 - I guess down the road there will be 2 new packages as part of the ffmpeg set which has now grown to 19 possible.

(while technically improper, for various reasons I use ubuntu naming - this is the current set I've got for 10.10 (atm r24829, shared x264-104

doug@doug-laptop:~/ffmpegs/new/testup$ ls *.deb
ffmpeg_0.6-2ubuntu4_i386.deb
ffmpeg-dbg_0.6-2ubuntu4_i386.deb
ffmpeg-doc_0.6-2ubuntu4_all.deb
libavcodec-dev_0.6-2ubuntu4_i386.deb
libavcodec-extra-52_0.6-2ubuntu4_i386.deb
libavcore-dev_0.6-2ubuntu4_i386.deb
libavcore-extra-0_0.6-2ubuntu4_i386.deb
libavdevice-dev_0.6-2ubuntu4_i386.deb
libavdevice-extra-52_0.6-2ubuntu4_i386.deb
libavfilter-dev_0.6-2ubuntu4_i386.deb
libavfilter-extra-1_0.6-2ubuntu4_i386.deb
libavformat-dev_0.6-2ubuntu4_i386.deb
libavformat-extra-52_0.6-2ubuntu4_i386.deb
libavutil-dev_0.6-2ubuntu4_i386.deb
libavutil-extra-50_0.6-2ubuntu4_i386.deb
libpostproc-dev_0.6-2ubuntu4_i386.deb
libpostproc-extra-51_0.6-2ubuntu4_i386.deb
libswscale-dev_0.6-2ubuntu4_i386.deb
libswscale-extra-0_0.6-2ubuntu4_i386.deb

FakeOutdoorsman
August 25th, 2010, 09:19 PM
...and was a bit surprised when the new libs showed up

There is another possible addition in the works:
[FFmpeg-devel] [PATCH] Add libavsequencer (http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2010-August/094880.html)


The new library is meant to contain the sequencer multimedia features for being able to playback modules and MIDI files in FFmpeg.

earthmeLon
August 25th, 2010, 09:30 PM
I am getting this warning:
Warning, using s16 intermediate sample format for resampling.

I have no clue what this means. If it's bad, please let me know :D

FakeOutdoorsman
August 25th, 2010, 09:35 PM
It's nothing to worry about if your output sounds fine to you. Can you show your FFmpeg command and the complete output?

tock
August 26th, 2010, 03:55 PM
I'm having trouble getting ffmpeg to find the x264 encoder. I used the link you have posted under the install x264 section to install the latest version (libx264-104). The package manager shows it to be installed but ffmpeg isn't finding it. When I try to remove it using apt-get remove x264 is says that it isn't installed. How do I get ffmpeg to find the newest x264?

earthmeLon
August 26th, 2010, 05:43 PM
I am getting 10FPS, but I think I should be going a bit faster...
I have changed --threads=0 to --threads=4 && --threads=5 to no avail v_v



ffmpeg -i /home/daryl/Desktop/encodes/PIC_0056.MOV -acodec libfaac -ac 2 -ar 48000 -ab 192k -vcodec libx264 -vpre slow -crf 22 -threads 5 /home/daryl/Desktop/encodes/out/pic_0056.mov.x264.mp4





processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 30
model name : Intel(R) Core(TM) i7 CPU Q 740 @ 1.73GHz
stepping : 5
cpu MHz : 1734.000
cache size : 6144 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 4
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm ida tpr_shadow vnmi flexpriority ept vpid
bogomips : 3457.67
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 30
model name : Intel(R) Core(TM) i7 CPU Q 740 @ 1.73GHz
stepping : 5
cpu MHz : 933.000
cache size : 6144 KB
physical id : 0
siblings : 8
core id : 1
cpu cores : 4
apicid : 2
initial apicid : 2
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm ida tpr_shadow vnmi flexpriority ept vpid
bogomips : 3025.84
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

processor : 2
vendor_id : GenuineIntel
cpu family : 6
model : 30
model name : Intel(R) Core(TM) i7 CPU Q 740 @ 1.73GHz
stepping : 5
cpu MHz : 933.000
cache size : 6144 KB
physical id : 0
siblings : 8
core id : 2
cpu cores : 4
apicid : 4
initial apicid : 4
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm ida tpr_shadow vnmi flexpriority ept vpid
bogomips : 3457.94
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

processor : 3
vendor_id : GenuineIntel
cpu family : 6
model : 30
model name : Intel(R) Core(TM) i7 CPU Q 740 @ 1.73GHz
stepping : 5
cpu MHz : 1066.000
cache size : 6144 KB
physical id : 0
siblings : 8
core id : 3
cpu cores : 4
apicid : 6
initial apicid : 6
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm ida tpr_shadow vnmi flexpriority ept vpid
bogomips : 3457.94
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

processor : 4
vendor_id : GenuineIntel
cpu family : 6
model : 30
model name : Intel(R) Core(TM) i7 CPU Q 740 @ 1.73GHz
stepping : 5
cpu MHz : 1734.000
cache size : 6144 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 4
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm ida tpr_shadow vnmi flexpriority ept vpid
bogomips : 3457.95
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

processor : 5
vendor_id : GenuineIntel
cpu family : 6
model : 30
model name : Intel(R) Core(TM) i7 CPU Q 740 @ 1.73GHz
stepping : 5
cpu MHz : 933.000
cache size : 6144 KB
physical id : 0
siblings : 8
core id : 1
cpu cores : 4
apicid : 3
initial apicid : 3
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm ida tpr_shadow vnmi flexpriority ept vpid
bogomips : 3457.94
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

processor : 6
vendor_id : GenuineIntel
cpu family : 6
model : 30
model name : Intel(R) Core(TM) i7 CPU Q 740 @ 1.73GHz
stepping : 5
cpu MHz : 1734.000
cache size : 6144 KB
physical id : 0
siblings : 8
core id : 2
cpu cores : 4
apicid : 5
initial apicid : 5
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm ida tpr_shadow vnmi flexpriority ept vpid
bogomips : 3457.94
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

processor : 7
vendor_id : GenuineIntel
cpu family : 6
model : 30
model name : Intel(R) Core(TM) i7 CPU Q 740 @ 1.73GHz
stepping : 5
cpu MHz : 1734.000
cache size : 6144 KB
physical id : 0
siblings : 8
core id : 3
cpu cores : 4
apicid : 7
initial apicid : 7
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm ida tpr_shadow vnmi flexpriority ept vpid
bogomips : 3457.95
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

Linuxforall
August 27th, 2010, 05:12 AM
Thats a surprise, I get far better FPS with my dual XEONs, with i7 it should be on fire.

mullens101
August 27th, 2010, 11:57 AM
earthmeLon,
What's top show your CPU load as while encoding (each CPU ... is ffmpeg attaching to one core or using all) and, more importantly, what are you encoding? (That is, what resolution are you encoding ... HD?) If you post what source resolution is, I'll run a matching sample on my Phenom II x4 and let you know what I get. RF 22 is a pretty high number ab should be faster, I typically use 20 (then again, I also typically use handbrake since it's easy and uses ffmpeg at its core)

FakeOutdoorsman
August 29th, 2010, 05:26 AM
I'm having trouble getting ffmpeg to find the x264 encoder. I used the link you have posted under the install x264 section to install the latest version (libx264-104).

What link are you referring to?


The package manager shows it to be installed but ffmpeg isn't finding it. When I try to remove it using apt-get remove x264 is says that it isn't installed. How do I get ffmpeg to find the newest x264?

What errors messages does FFmpeg tell you when it can't find x264? If there is a ~/ffmpeg/config.err (or maybe it's config.log) you can check the end of that file for more information.


I am getting 10FPS, but I think I should be going a bit faster...
I have changed --threads=0 to --threads=4 && --threads=5 to no avail v_v

When -threads is set to 0 it tells libx264 to automatically use an appropriate value for your CPU.

I can't say if your encode is being slow because your encoding time can vary among inputs. Experiment with other -vpre. You can see a current list of presets ordered by speed on the FFmpeg x264 encoding guide (http://rob.opendot.cl/index.php/useful-stuff/ffmpeg-x264-encoding-guide/). The slower presets will generally create a smaller output file but result in a longer encoding time. The -crf option can also affect your encoding speed, but I usually adjust the -vpre if I require faster encoding.

For comparison, re-encoding IronMan.mkv (http://mirror05.x264.nl/Dark/x264clips/IronMan.mkv) on an Intel i7 860 using FFmpeg r24961 and x264 0.104.1703 on Arch Linux x86_64:

$ time ffmpeg -i IronMan.mkv -vcodec libx264 -vpre slow -crf 22 -threads 0 -an -y output.mkv
real 2m43.037s
user 19m38.916s
sys 0m2.663s

tock
September 2nd, 2010, 04:40 PM
FakeOutdoorsman,

this is the link I used (http://ftp.itsuki.fkraiem.org/pub/x264/)

I went back and deleted the temp directories then tried just using the commands you layed out and it worked. but when I used the links to get the latest versions, I couldn't get ffmpeg to compile correctly.

After getting it installed and using the single pass preset to convert from avchd to h.264, the play back is still very lagging using gui-mplayer. Its a X2 amd with 2 gig of ram. How much horsepower does it take to play back h.264?

Thanks for the reply

mc4man
September 2nd, 2010, 07:25 PM
I went back and deleted the temp directories then tried just using the commands you layed out and it worked. but when I used the links to get the latest versions, I couldn't get ffmpeg to compile correctly.

You need for building ffmpeg both the libx264-XXX and companion libx264-dev packages installed

FakeOutdoorsman
September 2nd, 2010, 08:04 PM
FakeOutdoorsman,

this is the link I used (http://ftp.itsuki.fkraiem.org/pub/x264/)

I went back and deleted the temp directories then tried just using the commands you layed out and it worked. but when I used the links to get the latest versions, I couldn't get ffmpeg to compile correctly.
I'm not sure why Bachstelze's x264 package didn't work for you. I've never tested it myself. I put a note on the guide mentioning that I can't support these packages, but I'll leave the link for those who want to use it.


After getting it installed and using the single pass preset to convert from avchd to h.264, the play back is still very lagging using gui-mplayer. Its a X2 amd with 2 gig of ram. How much horsepower does it take to play back h.264?
It depends on the video you are trying to play and if you have any type of hardware accelerated decoding (VDPAU or any of those fancy things). The users in the #ffmpeg or #x264 IRC channels will know if your hardware is adequate. Just make sure to use a pastebin service to show some info about your file. Give them the output of: ffmpeg -i input.foo.

Cypress421
September 3rd, 2010, 03:55 AM
One question, I have the Medibuntu repository, this won't update new codecs from Medibuntu over the FFmpeg or x264 builds i.e. overwrite the newest SVN codecs that I've compiled with older ones? Will Ubuntu via Update Manager ever overwrite these files either?

bdebaere
September 3rd, 2010, 06:21 AM
I have a problem at step 6. When you install ffmpeg. I executed every step so far including the optional one however when I get here it says:
ERROR: libx264 not found

when I try to execute the line in the terminal.
Any assisstance would be appreciated, thanks.

Cypress421
September 3rd, 2010, 06:34 AM
Did you follow the x264 instructions correctly?

bdebaere
September 3rd, 2010, 06:50 AM
Did you follow the x264 instructions correctly?
Yes, I'm quite sure as all I did was
CTRL+C
SHIFT+CTRL+V

EDIT: if I wanted to restart the whole process and just begin from step 1, what would I have to do?

prupert
September 3rd, 2010, 11:23 AM
One question, I have the Medibuntu repository, this won't update new codecs from Medibuntu over the FFmpeg or x264 builds i.e. overwrite the newest SVN codecs that I've compiled with older ones? Will Ubuntu via Update Manager ever overwrite these files either?

It shouldn't do, as Ubuntu will see that the SVN version is more recent than the Mediabuntu one.

However, if you enabled Mediabuntu to install an app that uses FFmpeg, you might find there are issues if that app requires a specific version of FFmpeg, as the newer SVN versions may not be compatable..

prupert
September 3rd, 2010, 11:28 AM
EDIT: if I wanted to restart the whole process and just begin from step 1, what would I have to do?

The easiest thing is, if you want to restart, is to issue:

sudo apt-get remove ffmpeg x264 libx264-dev

Then delete the two folders x264 and ffmpeg that you downloaded the source to.

Then you can start again.

bdebaere
September 3rd, 2010, 11:59 AM
The easiest thing is, if you want to restart, is to issue:

sudo apt-get remove ffmpeg x264 libx264-dev

Then delete the two folders x264 and ffmpeg that you downloaded the source to.

Then you can start again.
Ok I went trough the whole setup again and this time I could execute all commands without trouble. I do have some questions though:
With these installed, is it now possible for me to use this as codec in Pitivi?
Can I now convert to x264 with Downloadhelper addon for Firefox?

Thanks for your help

prupert
September 3rd, 2010, 12:18 PM
If they both support x264 then it should work....

dannyboy79
September 5th, 2010, 02:04 PM
well, after using the google bash script to update to latest svn ffmpeg and x264 git my kdenlive no longer renders files to h264. ddkennedy from kdenlive forums believes its due to me using a mlt package from sanub's PPA along with ffmpeg and x264 from svn and git. this setup was working for weeks so I am not sure what the correct course of action is. Here's what's installed:
melt = 0.5.6-0ubuntu0~sunab~lucid1
ffmpeg = FFmpeg version SVN-r25041, Copyright (c) 2000-2010 the FFmpeg developers
built on Sep 4 2010 08:58:47 with gcc 4.4.3
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab
x264 = git
kdenlive = 7.7.1 (from ubuntu repos)

his comment on 9-5-10 is this:
"I just tested today's checkouts of x264 and ffmpeg, built from source, and it worked for me using kdenlive's render options. So, that's not it. It is possible the mlt package was not rebuilt using the version of ffmpeg that you are using. How did you install ffmpeg and x264? If they did not come from sunab's repo, then his repo may not be synchronized with whatever repo you grabbed x264 and ffmpeg from. Certainly, if you build those from source yourself, then it will be a problem. You can not arbitrarily update dependencies like that."

so, what does that mean for me? i am asking him over there but this forum is more active so I am asking here also.
-Do I rebuild mlt from source instead of using sanub's .5.6 mlt?
-do I somehow go back to a previous svn of ffmpeg? How to do that since I am using the google bash script that updates svn ffmeg and x264 from git?

I was able to render to h264/aac about 2 days ago so I am stuck now. Any help would be appreciated. Please anyone help, I need to get videos done for my youtube channel.

prupert
September 5th, 2010, 05:17 PM
It seems you are trying to use FFmpeg for two different things:

1) Have the most recent version from SVN
2) Use it as part of kdenlive.

I am not sure what the sanub PPA is for, is this where you get kdenlive from?

If so, if you want to use the bleeding edge of kdenlive, yes, I would build from source - but even that way, you might find occasionally updating to the latest version of FFmpeg via my script (the google code one) might break kdenlive.

If I were you, the easiest solution is to stop using my script, uninstall ffmpeg and x264 and stick to just using the PPA that you were using. That way, there will never be dependency problems. You wont be using the most recent version of FFmpeg, but there will never be an issue with it not working.

dannyboy79
September 5th, 2010, 08:22 PM
It seems you are trying to use FFmpeg for two different things:

1) Have the most recent version from SVN
2) Use it as part of kdenlive.

I am not sure what the sanub PPA is for, is this where you get kdenlive from?

If so, if you want to use the bleeding edge of kdenlive, yes, I would build from source - but even that way, you might find occasionally updating to the latest version of FFmpeg via my script (the google code one) might break kdenlive.

If I were you, the easiest solution is to stop using my script, uninstall ffmpeg and x264 and stick to just using the PPA that you were using. That way, there will never be dependency problems. You wont be using the most recent version of FFmpeg, but there will never be an issue with it not working.i am using sanub's PPA for melt .5.6. I believe the combination of melt from his PPA and the latest svn ffmpeg is broken. I am not sure how to go back to a previous build or 2 of ffmpeg. I dont know how to install mlt from source as I have tried and I just keep getting failures. if you could tell me how to change your script to install a previous svn version of ffmpeg I would be greatful.

kdenlive is from ubuntu repo's. 7.7.1

this is weird because ffmpeg from svn at version 24084 worked just fine

mc4man
September 5th, 2010, 10:53 PM
because ffmpeg from svn at version 24084 worked just fine
If you used this script previously then what did you do with the checkinstall .deb's for ffmpeg and x264? (maybe they're still in the source folders
If so, you can then use dpkg to downgrade your current installs to those versions.

dannyboy79
September 5th, 2010, 11:27 PM
If you used this script previously then what did you do with the checkinstall .deb's for ffmpeg and x264? (maybe they're still in the source folders
If so, you can then use dpkg to downgrade your current installs to those versions.
awesome idea except when i check the /usr/local/src/ folder there is nothing but a ffmpeg r25042.deb. Thanks for the suggestion. I dont know how to compile mlt against this version of ffmpeg. If I did I think i could solve my issue.

ffmpeg works fine from command line, its when I try to use kdenlive which uses the mlt framework to put in transitions and what not. I get a useless file when rendering. so my last hump to get over is to compile mlt. If I knew what ./configure options I needed to run I'd be good to go.

qyot27
September 5th, 2010, 11:56 PM
All things considered, I think this is a good reason why maintaining separate ffmpeg installations is a good idea. Use the regular kdenlive setup as needed, the stability of the components outweighs the need for bleeding edge. I'm saying this out of my own experience in video editing (albeit on Premiere 6.5 under Windows, so this doesn't apply directly to me), as well as doing fairly regular SVN compiles of ffmpeg; you don't want your editor to break, so if there's a conflict, you need to keep them separate.

Basically, keep kdenlive as it is when it's working, and then install SVN ffmpeg as static to a separate prefix (like /opt or something). Hopefully that would solve the issue, as I'm assuming the problem is arising because the SVN ffmpeg is being built shared, and that's why it's messing with kdenlive's dependencies. If you build static this shouldn't happen, and putting it in a completely different prefix is just further precaution that the two installs are kept in order. I don't know, however, if a conflict would occur with the two ffmpeg apps themselves if you added the new prefix to the $PATH, as it would have to decide which ffmpeg binary to use. But you can circumvent that by not adding the SVN ffmpeg to the $PATH and calling it manually, e.g.,

/opt/bin/./ffmpeg [options]






EDIT: Oh yeah, the way to checkout an arbitrary revision of a project from SVN is to use the -r [revision] parameter, like so:

svn checkout -r 20056 svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg

Will checkout revision 20056 instead of the latest. You just have to know what revision you need.

andrew.46
September 6th, 2010, 12:58 AM
Hi qyot,


EDIT: Oh yeah, the way to checkout an arbitrary revision of a project from SVN is to use the -r [revision] parameter, like so:

svn checkout -r 20056 svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg

Will checkout revision 20056 instead of the latest. You just have to know what revision you need.

Mind you there is a small problem with this approach in that the syntax you have given will download revision 20056 of all of FFmpeg except libswscale which will be the latest svn HEAD, it is an external library. Failure to compile can result. A slightly unwieldy way to correct this is to download revisions by date rather than revision:



$ svn co -r '{'2010-02-18'}' svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
$ cd ffmpeg/libswscale
$ svn up -r '{'2010-02-18'}'


although there are other methods...

Andrew

qyot27
September 6th, 2010, 02:10 AM
Mind you there is a small problem with this approach in that the syntax you have given will download revision 20056 of all of FFmpeg except libswscale which will be the latest svn HEAD, it is an external library. Failure to compile can result.
So it seems. I never noticed that before. Then again most times I work with ffmpeg revisions that far in the past it's on other branches that are restricted to git, and you have to grab libswscale manually afterward (making date cohesion more of an obvious task).


A slightly unwieldy way to correct this is to download revisions by date rather than revision:



$ svn co -r '{'2010-02-18'}' svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
$ cd ffmpeg/libswscale
$ svn up -r '{'2010-02-18'}'


although there are other methods...

Andrew
I suppose it could be do-able by having a script with nearly identical syntax to svn checkout that queries ffmpeg's svn log by revision, copies the date/time from the entry, and then performs the aforementioned date-based checkout.

So the command given would be something like:
ffcheckout -r 20056 svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg

But what would go on is:
svn log -r 20056 svn://svn.ffmpeg.org/ffmpeg/trunk

r20056 | mru | 2009-09-27 04:16:50 -0400 (Sun, 27 Sep 2009) | 1 line

(copies '2009-09-27 04:16:50 -400' from the log entry)
svn co -r '{'2009-09-27 04:16:50 -400'}' svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
cd ffmpeg/libswscale
svn up -r '{'2009-09-27 04:16:50 -400'}'

dannyboy79
September 6th, 2010, 04:59 AM
i am not building ffmpeg with shared libraries. the ./configure command is here:
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab

i understand you guys are trying to help but since I am using kdenlive which really depends on the mlt framework I am SOL at the moment because I can't seem to build a previous version of ffmpeg (r24084) and still use the sanub PPA for mlt .5.6. Kdenlive is being retrieved from normal ubuntu repos (7.7.1). all these libraries and dependencies are driving me nuts and I am just about ready to do a fresh install. I don't think that would fix my issue either though. I have tried the medibuntu repos and NO sanub PPA repo and still kdenlive won't render to h264. i noticed it was using melt .5.4.

I just wish now that I hadn't updated to the latest SVN of ffmpeg. My setup was running great 3 days ago. Now I htink I've buggered so much crap up I don't know what to do.

I tried to update the google bash script so it would download and install r24084 of ffmpeg but that didn't work either. AHHHHHHHHHHHHHH

Dang it, I wish I understood all these libav* libraries and what not. All these guides are great for merely ffmpeg and x264 but what about the mlt framework and kdenlive. I can't believe there are more video editors out there with a similar situation. Any help would be appreciated.

mc4man
September 6th, 2010, 06:50 AM
Well obviously your current ffmpeg and x264 are doing you no good so remove them


sudo apt-get remove ffmpeg x264

Then you could build a new x264 and ffmpeg without a script using older sources - using this guide (just different sources

What would be far easier is to just use the lucid ffmpeg, libx264, and your sunab repo with medibuntu also enabled.

To do that re-enable both sunab and medibuntu repo's, then run

sudo apt-get update

sudo apt-get install ffmpeg libx264
and ck. in synaptic that you have the extra versions of the ffmpeg libs installed. Search ffmpeg and scroll down ( libavcodec-extra-52, libavformat-extra-52, ect. - if not just mark the extra versions for install, synaptic will upgrade for you

If you wish to try to build a newer ffmpeg and x264 than the default lucid versions then a couple of commands will do so - I'd try the default lucid libs first.

If you know you wish to try building again then just remove as noted above and post back.

(small note - maverick will have a newer ffmpeg (0.6), a newer mlt (0.5.6) and your kdenlive should work fine