PDA

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



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

andrew.46
June 3rd, 2011, 07:03 AM
Perhaps you could use a local installation of FFmpeg for AirVideo as andrew.46 shows in Howto: Build the development version of vlc under Ubuntu (http://ubuntuforums.org/showthread.php?t=1398119).

That technique works well for builds apart from FFmpeg, I have just finished updated another guide:

Howto: Build the BitTorrent client Transmission under the latest Ubuntu release
http://ubuntuforums.org/showthread.php?p=10896413

and I have used the same idea when building libevent, that is to install the library locally and add the path to PKG_CONFIG_PATH for the compiler to find. libevent is not such a hot potato as FFmpeg when building Ubuntu packages but I am sure doing it this way will avoid breakages on some systems...

ron999
June 3rd, 2011, 08:27 PM
EDIT
This patch is now obsolete.
See post #1768 here:- http://ubuntuforums.org/showpost.php?p=10967333&postcount=1768

(Another) Update for libvpx patches

Hi
It looks like those libvpx presets have changed again.
When I tried to apply the presets from "ffmpeg-HEAD-VP8_param_mapping-7.tar.gz" it produced an error.

This time I've used these commands:-


wget http://webm.googlecode.com/files/ffmpeg-presets.diff.gz
gzip -d ffmpeg-presets.diff.gz
git apply -v ffmpeg-presets.diff

Result:-

ron@ubuntu:~/ffmpeg$ git apply -v ffmpeg-presets.diff
Checking patch ffpresets/libvpx-1080p.ffpreset...
Checking patch ffpresets/libvpx-1080p50_60.ffpreset...
Checking patch ffpresets/libvpx-360p.ffpreset...
Checking patch ffpresets/libvpx-720p.ffpreset...
Checking patch ffpresets/libvpx-720p50_60.ffpreset...
Applied patch ffpresets/libvpx-1080p.ffpreset cleanly.
Applied patch ffpresets/libvpx-1080p50_60.ffpreset cleanly.
Applied patch ffpresets/libvpx-360p.ffpreset cleanly.
Applied patch ffpresets/libvpx-720p.ffpreset cleanly.
Applied patch ffpresets/libvpx-720p50_60.ffpreset cleanly.

Jose Catre-Vandis
June 12th, 2011, 12:04 PM
Followed guide successfully on Xubuntu 11.04. Everything works fine. Have an odd problem with mp4 playback using mplayer (no-gui).

If I encode a bit of recorded tv (.ts file, PAR 64:45, DAR 16/9) using the first crf example, the encode works fine and retains the PAR and DAR, but when I go to playback in mplayer (nothing in config file) mplayer seems to think the video has an aspect ratio of 2.53:1, making a wide thin video.

If I encode using the same command line but replace with mkv instead of mp4, mplayer plays back at the correct aspect of 16/9.

mplayer plays back avi/xvid (encoding the same piece of recorded tv) at the correct aspect ratio.

Screen is a 1920x1080 24". No similar problems on 10.04 LTS

I can fix this with a profile in mplayer's config:
[extension.mp4]
profile-desc="Profile for HD mp4 files"
aspect="16/9" but this will affect all mp4 extensions.

If I use parole, I have to use the "none" setting in Aspect menu to get the correct resolution.

Can anyone shed any light on this issue? I have tried encoding with all sorts of different parameters but with no success.

qyot27
June 12th, 2011, 09:11 PM
Followed guide successfully on Xubuntu 11.04. Everything works fine. Have an odd problem with mp4 playback using mplayer (no-gui).

If I encode a bit of recorded tv (.ts file, PAR 64:45, DAR 16/9) using the first crf example, the encode works fine and retains the PAR and DAR, but when I go to playback in mplayer (nothing in config file) mplayer seems to think the video has an aspect ratio of 2.53:1, making a wide thin video.

If I encode using the same command line but replace with mkv instead of mp4, mplayer plays back at the correct aspect of 16/9.

mplayer plays back avi/xvid (encoding the same piece of recorded tv) at the correct aspect ratio.

Screen is a 1920x1080 24". No similar problems on 10.04 LTS

I can fix this with a profile in mplayer's config:
[extension.mp4]
profile-desc="Profile for HD mp4 files"
aspect="16/9" but this will affect all mp4 extensions.

If I use parole, I have to use the "none" setting in Aspect menu to get the correct resolution.

Can anyone shed any light on this issue? I have tried encoding with all sorts of different parameters but with no success.
It's clearly interpreting the PAR as the file's SAR value. The two are not the same, and SAR values can mess up aspect display (they do have a reason for their existence, but I simply find it easier to encode to 1:1 and then do after-the-fact flagging if I need to).

Case in point:
64/45 * 1920 = ~2730
~2730/1080 = ~2.53

If you have the SAR or DAR at 1/1 (like it should be for files that actually are 1920 pixels wide and 1080 pixels tall), then it works out correctly to a normal ~1.78 ratio. Aspect flagging should only be used for files whose storage resolutions differ from their displayed resolutions. If the files were 1440x1080, then the 64:45 ratio would work out correctly to 2048, which is close enough to 1920 (to be pedantic, 2048 width is a studio format known as 2K, roughly equivalent to the difference between 'proper' anamorphic widescreen used for Hollywood movies and the 16:9 standard used on TVs).

With Matroska, aspect is handled a bit differently and the internal aspect ratios are set to match the reality of the files if they aren't specifically overridden by the user. MP4 isn't quite as straight-forward many times.

In essence,
PAR (Pixel aspect ratio) simply exists as the natural ratio of width to height
SAR (Sample aspect ratio) is a bitstream-level flag that indicates the internally-correct display ratio of the pixels
DAR (Display aspect ratio) is a container-level flag that matches the display ratio.

Whatever is happening in the encoder, the PAR and SAR are being mixed up. It might have to do with the TS container of the source file, but I'm not confident about that.

At least, that's how I understand the whole PAR, SAR, DAR situation. It's probably overly simplistic, but as long as you know what it should be displayed as and if the source resolution is a correct reduction of that value, then you're good.

FakeOutdoorsman
June 12th, 2011, 10:01 PM
Can anyone shed any light on this issue?
Perhaps the setdar or setpar FFmpeg filters would be useful here. There's some info on these filters in man ffmpeg. I haven't actually tried them though. Does ffplay show the video correctly?

Jose Catre-Vandis
June 12th, 2011, 10:22 PM
Perhaps the setdar or setpar FFmpeg filters would be useful here. There's some info on these filters in man ffmpeg. I haven't actually tried them though. Does ffplay show the video correctly?

Yes it plays at the correct aspect ratio in ffplay.

I'll have a go with the setsar and setdar filters....thanks to qyot27 for the detailed and informative explanation and to fakeoutdoorsman for the pointers.

[EDIT] getting unrecognised option for both of them - do they need to be compiled in? (Doh! you need to use -vf in front)

Bingo!


ffmpeg -i input.ts -vf setdar=16:9 -acodec libfaac -aq 100 -vcodec libx264 -preset slow -crf 22 -threads 0 -deinterlace output.mp4

Sorted out the playback aspect ratio in mplayer (doesn't fix parole but I wasn't expecting that ;))

Seems advice is to put the filter at the front of the chain

FakeOutdoorsman
June 12th, 2011, 10:43 PM
[EDIT] getting unrecognised option for both of them - do they need to be compiled in?
They should be available if you followed the guide, but not in the repository FFmpeg (as of Natty). Sparse example:

-vf setdar=16:9
Edit: I'm a slow typer. Looks like you figured it out.

Jose Catre-Vandis
June 14th, 2011, 12:34 AM
Spoke to soon - I had left my config file setting in place!!

However, by trial and error, I found that setting the DAR to 3:2 worked:

ffmpeg -i input.ts -vf setdar=3:2 -acodec libfaac -aq 100 -vcodec libx264 -preset slow -crf 22 -threads 0 -deinterlace output.mp4

I'll need to tweak a bit more as mplayer reports an aspect ratio of 1.80:1 !!!

Doesn't make any sense. Other mp4 files (e.g. iPlayer) work fine.

heyup
June 15th, 2011, 08:59 PM
I had a problem updating ffmpeg (Hardy).

When updating ffmpeg, I got to 'git pull', but the update aborted with this error meassge:


Your local changes to 'libavformat/avformat.h' would be overwritten by merge. Please, commit your changes or stash them before you can merge.

I had saved a change to ffmpeg/libavformat/avformat.h to test a patch, then decided to undo the change, and update ffmpeg instead.

How do I commit or stash my changes?

FakeOutdoorsman
June 16th, 2011, 06:27 AM
I'm fairly new to Git myself, but I think this will do it:

git stash
git pull

beyored
June 19th, 2011, 08:18 PM
Hello. I'm experiencing sort of problem. First of all i never ever used any Linux before and installed Xubuntu yesterday. And i did it mainly because of ffmpeg. I need to use some functions from its libraries. So i installed it following this guide. It works ( i mean works as tool to convert/encode/decode video/audio and so on ). After that i installed Codelite as IDE. All i need now is to include ffmpeg libraries to my project.

1) Here is a trouble number 1. ffmpeg installed in two directories. First one is /ffmpeg/ in my user's directory - i mean /home/username/ffmpeg/ and second one is /usr/local/bin/ and /usr/local/include/ and /usr/local/lib/. I don't understand why is it so and what libraries should i use for linking to my project. As far as i configure both x264 and ffmpeg as static (--enable-static) there are only .a libraries ( static ). They seems to be equal both in /ffmpeg/ subfolders and /usr/local/lib/. But i don't know what to use and why. I just thought that if i built something inside its own directory it shouldn't somehow go somewhere else but i'm obviously incorrect.

2) I've tried to use static libraries from /home/username/ffmpeg when linking to the project. I know that it's possible to use static and shared libraries. I have only static so i need to link it. In project properties i've added library path like that ../../../ffmpeg/libavcodec/ and so on, and specified libs by ../../../ffmpeg/libavcodec/avcodec as far as linker deprecates 'lib' and '.a'. When i'm trying to build it, it compiles successfully but linking stage give me error /usr/bin/ld: cannot find -l../../../ffmpeg/libavcodec/avcodec, though there is a file named libavcodec.a. I don't understand if /usr/local/lib is part of some PATH_TO_LIB global variable or something and it collides with my mentioned path in IDE or am i just missing something fundamental.

3) I've tried to build shared versions of x264 and ffmpeg. x264 builds shared well, but after that ffmpeg build fails with something like ".....x264.a(common.o)...try to compile with -fPic option". I just can't provide it exactly right now but i will do it anytime if necessary.

I understand that maybe it's the wrong place for such types of questions or i can find all answers in google or i just need to read some fundamental books before trying to make it work but i just don't know from what i should start. Sorry for the wall of text.

jwcalla
June 19th, 2011, 11:15 PM
1) Here is a trouble number 1. ffmpeg installed in two directories. First one is /ffmpeg/ in my user's directory - i mean /home/username/ffmpeg/ and second one is /usr/local/bin/ and /usr/local/include/ and /usr/local/lib/. I don't understand why is it so and what libraries should i use for linking to my project. As far as i configure both x264 and ffmpeg as static (--enable-static) there are only .a libraries ( static ). They seems to be equal both in /ffmpeg/ subfolders and /usr/local/lib/. But i don't know what to use and why. I just thought that if i built something inside its own directory it shouldn't somehow go somewhere else but i'm obviously incorrect.

Generally if you build a program or library in a directory it will stay there, unless you do a "make install", or unless a build script runs such a command, which installs the appropriate goodies in system-wide directories so that all users on the system have access. So the binary executable went into /usr/local/bin/ and the header files (for other programs you need to compile that tap into the codebase) are in /usr/local/include/ and the static / shared libraries for linking are in /usr/local/lib/.

The residual files in ~/ffmpeg/ will remain but are no longer necessary. You can choose to blow them away if you'd like, or keep them around in case you'd like to do another re-compile.

When linking from another program, you can specify the directories to use from either your home area or the system-wide area -- it's completely up to you, provided, of course, that both locations hold the exact same compiles. Otherwise, if for example you tinkered with the one in your home directory and didn't install it system wide, and want to include those tinkerings in your other program's compile, you'll have to be sure to deliberately include those files.


2) I've tried to use static libraries from /home/username/ffmpeg when linking to the project. I know that it's possible to use static and shared libraries. I have only static so i need to link it. In project properties i've added library path like that ../../../ffmpeg/libavcodec/ and so on, and specified libs by ../../../ffmpeg/libavcodec/avcodec as far as linker deprecates 'lib' and '.a'. When i'm trying to build it, it compiles successfully but linking stage give me error /usr/bin/ld: cannot find -l../../../ffmpeg/libavcodec/avcodec, though there is a file named libavcodec.a. I don't understand if /usr/local/lib is part of some PATH_TO_LIB global variable or something and it collides with my mentioned path in IDE or am i just missing something fundamental.mehhhh I'm having a C brainfart but I think the options you want to use are -L../../../ffmpeg/libavcodec -lavcodec. Or if you want to use the ones installed on the system, -L/usr/local/lib -lavcodec. (Note: in my case the libavcodec.a file is in the /usr/local/lib directory.)

I always get those library switches confused.

qyot27
June 20th, 2011, 08:14 AM
Generally if you build a program or library in a directory it will stay there, unless you do a "make install", or unless a build script runs such a command, which installs the appropriate goodies in system-wide directories so that all users on the system have access.
Minor elaboration: 'make install' actually will install to the specified prefix named during the configure process. By default Ubuntu defines this as /usr/local, and thus 'make install' will put the binaries/libraries/headers there, but it doesn't have to. Other distros use /usr by itself; others might even use /opt.

For instance, whenever I'm building everything I install only a basic ffmpeg to a directory in $HOME, then install ffms2 to the same directory (and link it against the ffmpeg installed there), then install x264 (linking it against the $HOME installs of ffmpeg and ffms2) and a full ffmpeg to system. Keeps things cleaner that way. And of course, if I'm cross-compiling, then everything goes to such a custom prefix.

bigdawgte
June 21st, 2011, 04:09 PM
I'm guessing my problem is simple. When I try to "make" ffmpeg on Natty, i get the following"
CC libavcodec/crystalhd.o
In file included from libavcodec/crystalhd.c:82:0:
/usr/include/libcrystalhd/bc_dts_types.h:64:14: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘bc_bool_t’
In file included from libavcodec/crystalhd.c:84:0:
/usr/include/libcrystalhd/libcrystalhd_if.h:149:14: error: expected ‘)’ before ‘*’ token
/usr/include/libcrystalhd/libcrystalhd_if.h:177:12: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:215:14: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:255:14: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:300:14: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:339:14: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:371:12: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:402:12: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:452:14: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:486:16: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:522:14: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:569:14: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:604:12: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:635:12: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:666:13: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:695:15: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:726:15: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:757:12: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:786:12: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:829:14: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:878:14: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:908:12: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:954:14: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:990:15: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:1031:14: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:1068:14: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:1104:14: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:1138:14: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:1170:12: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:1198:12: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:1228:13: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:1265:13: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:1298:13: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:1329:14: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:1363:14: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:1393:21: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:1423:10: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:1451:10: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:1478:13: error: expected ‘)’ before ‘hDevice’
/usr/include/libcrystalhd/libcrystalhd_if.h:1507:13: error: expected ‘)’ before ‘hDevice’
libavcodec/crystalhd.c:125:5: error: expected specifier-qualifier-list before ‘HANDLE’
libavcodec/crystalhd.c:152:7: error: ‘CHDContext’ has no member named ‘sWidth’
libavcodec/crystalhd.c:153:7: warning: missing braces around initializer
libavcodec/crystalhd.c:153:7: warning: (near initialization for ‘options[0].default_val’)
libavcodec/crystalhd.c: In function ‘id2subtype’:
libavcodec/crystalhd.c:177:20: error: ‘CHDContext’ has no member named ‘is_nal’
libavcodec/crystalhd.c: In function ‘opaque_list_push’:
libavcodec/crystalhd.c:238:14: error: ‘CHDContext’ has no member named ‘head’
libavcodec/crystalhd.c:240:13: error: ‘CHDContext’ has no member named ‘head’
libavcodec/crystalhd.c:240:9: warning: statement with no effect
libavcodec/crystalhd.c:242:39: error: ‘CHDContext’ has no member named ‘tail’
libavcodec/crystalhd.c:242:45: error: ‘AVOption’ has no member named ‘fake_timestamp’
libavcodec/crystalhd.c:242:33: warning: assignment makes integer from pointer without a cast
libavcodec/crystalhd.c:243:13: error: ‘CHDContext’ has no member named ‘tail’
libavcodec/crystalhd.c:243:19: error: ‘AVOption’ has no member named ‘next’
libavcodec/crystalhd.c:243:9: warning: statement with no effect
libavcodec/crystalhd.c:245:9: error: ‘CHDContext’ has no member named ‘tail’
libavcodec/crystalhd.c:245:5: warning: statement with no effect
libavcodec/crystalhd.c: In function ‘opaque_list_pop’:
libavcodec/crystalhd.c:261:28: error: ‘CHDContext’ has no member named ‘head’
libavcodec/crystalhd.c:261:24: warning: initialization from incompatible pointer type
libavcodec/crystalhd.c:263:14: error: ‘CHDContext’ has no member named ‘head’
libavcodec/crystalhd.c:273:13: error: ‘CHDContext’ has no member named ‘head’
libavcodec/crystalhd.c:273:19: error: ‘AVOption’ has no member named ‘fake_timestamp’
libavcodec/crystalhd.c:273:36: warning: comparison between pointer and integer
libavcodec/crystalhd.c:274:13: error: ‘CHDContext’ has no member named ‘head’
libavcodec/crystalhd.c:274:9: warning: statement with no effect
libavcodec/crystalhd.c:276:18: error: ‘CHDContext’ has no member named ‘head’
libavcodec/crystalhd.c:276:24: error: ‘AVOption’ has no member named ‘next’
libavcodec/crystalhd.c:277:17: error: ‘CHDContext’ has no member named ‘tail’
libavcodec/crystalhd.c:277:30: error: ‘CHDContext’ has no member named ‘head’
libavcodec/crystalhd.c:277:13: warning: statement with no effect
libavcodec/crystalhd.c:293:20: error: ‘CHDContext’ has no member named ‘tail’
libavcodec/crystalhd.c:293:16: warning: statement with no effect
libavcodec/crystalhd.c: In function ‘flush’:
libavcodec/crystalhd.c:317:9: error: ‘CHDContext’ has no member named ‘last_picture’
libavcodec/crystalhd.c:317:5: warning: statement with no effect
libavcodec/crystalhd.c:318:9: error: ‘CHDContext’ has no member named ‘output_ready’
libavcodec/crystalhd.c:318:5: warning: statement with no effect
libavcodec/crystalhd.c:319:9: error: ‘CHDContext’ has no member named ‘need_second_field’
libavcodec/crystalhd.c:319:5: warning: statement with no effect
libavcodec/crystalhd.c:320:9: error: ‘CHDContext’ has no member named ‘skip_next_output’
libavcodec/crystalhd.c:320:5: warning: statement with no effect
libavcodec/crystalhd.c:321:9: error: ‘CHDContext’ has no member named ‘decode_wait’
libavcodec/crystalhd.c:321:5: warning: statement with no effect
libavcodec/crystalhd.c:327:5: error: implicit declaration of function ‘DtsFlushInput’
libavcodec/crystalhd.c:327:23: error: ‘CHDContext’ has no member named ‘dev’
libavcodec/crystalhd.c: In function ‘uninit’:
libavcodec/crystalhd.c:334:5: error: ‘HANDLE’ undeclared (first use in this function)
libavcodec/crystalhd.c:334:5: note: each undeclared identifier is reported only once for each function it appears in
libavcodec/crystalhd.c:334:5: warning: statement with no effect
libavcodec/crystalhd.c:334:12: error: expected ‘;’ before ‘device’
libavcodec/crystalhd.c:336:5: error: ‘device’ undeclared (first use in this function)
libavcodec/crystalhd.c:336:18: error: ‘CHDContext’ has no member named ‘dev’
libavcodec/crystalhd.c:336:5: warning: statement with no effect
libavcodec/crystalhd.c:337:5: error: implicit declaration of function ‘DtsStopDecoder’
libavcodec/crystalhd.c:338:5: error: implicit declaration of function ‘DtsCloseDecoder’
libavcodec/crystalhd.c:339:5: error: implicit declaration of function ‘DtsDeviceClose’
libavcodec/crystalhd.c:341:25: error: ‘CHDContext’ has no member named ‘parser’
libavcodec/crystalhd.c:341:5: warning: passing argument 1 of ‘av_parser_close’ from incompatible pointer type
libavcodec/avcodec.h:4110:6: note: expected ‘struct AVCodecParserContext *’ but argument is of type ‘const struct AVOption *’
libavcodec/crystalhd.c:342:13: error: ‘CHDContext’ has no member named ‘bsfc’
libavcodec/crystalhd.c:343:39: error: ‘CHDContext’ has no member named ‘bsfc’
libavcodec/crystalhd.c:343:9: warning: passing argument 1 of ‘av_bitstream_filter_close’ from incompatible pointer type
libavcodec/avcodec.h:4138:6: note: expected ‘struct AVBitStreamFilterContext *’ but argument is of type ‘const struct AVOption *’
libavcodec/crystalhd.c:346:17: error: ‘CHDContext’ has no member named ‘sps_pps_buf’
libavcodec/crystalhd.c:346:5: warning: passing argument 1 of ‘av_free’ discards qualifiers from pointer target type
./libavutil/mem.h:97:6: note: expected ‘void *’ but argument is of type ‘const struct AVOption *’
libavcodec/crystalhd.c:351:13: error: ‘CHDContext’ has no member named ‘head’
libavcodec/crystalhd.c:352:31: error: ‘CHDContext’ has no member named ‘head’
libavcodec/crystalhd.c:352:27: warning: initialization from incompatible pointer type
libavcodec/crystalhd.c: In function ‘init’:
libavcodec/crystalhd.c:370:24: error: ‘FALSE’ undeclared (first use in this function)
libavcodec/crystalhd.c:370:9: warning: initialization makes integer from pointer without a cast
libavcodec/crystalhd.c:371:24: error: ‘TRUE’ undeclared (first use in this function)
libavcodec/crystalhd.c:371:9: warning: initialization makes integer from pointer without a cast
libavcodec/crystalhd.c:372:37: error: ‘vdecFrameRate59_94’ undeclared (first use in this function)
libavcodec/crystalhd.c:372:35: error: invalid operands to binary | (have ‘unsigned int’ and ‘const struct AVOption *’)
libavcodec/crystalhd.c:372:56: error: invalid operands to binary | (have ‘const struct AVOption *’ and ‘int’)
libavcodec/crystalhd.c:372:9: warning: initialization makes integer from pointer without a cast
libavcodec/crystalhd.c:384:21: error: ‘vdecRESOLUTION_1080p23_976’ undeclared (first use in this function)
libavcodec/crystalhd.c:384:21: error: invalid operands to binary << (have ‘const struct AVOption *’ and ‘int’)
libavcodec/crystalhd.c:383:46: error: invalid operands to binary | (have ‘int’ and ‘const struct AVOption *’)
libavcodec/crystalhd.c:379:21: warning: initialization makes integer from pointer without a cast
libavcodec/crystalhd.c:394:9: error: ‘CHDContext’ has no member named ‘is_nal’
libavcodec/crystalhd.c:394:5: warning: statement with no effect
libavcodec/crystalhd.c:395:9: error: ‘CHDContext’ has no member named ‘last_picture’
libavcodec/crystalhd.c:395:5: warning: statement with no effect
libavcodec/crystalhd.c:396:9: error: ‘CHDContext’ has no member named ‘decode_wait’
libavcodec/crystalhd.c:396:5: warning: statement with no effect
libavcodec/crystalhd.c:415:17: error: ‘CHDContext’ has no member named ‘bsfc’
libavcodec/crystalhd.c:415:13: warning: statement with no effect
libavcodec/crystalhd.c:416:22: error: ‘CHDContext’ has no member named ‘bsfc’
libavcodec/crystalhd.c:422:44: error: ‘CHDContext’ has no member named ‘bsfc’
libavcodec/crystalhd.c:423:40: warning: passing argument 1 of ‘av_bitstream_filter_filter’ from incompatible pointer type
libavcodec/avcodec.h:4134:5: note: expected ‘struct AVBitStreamFilterContext *’ but argument is of type ‘const struct AVOption *’
libavcodec/crystalhd.c:425:17: error: ‘CHDContext’ has no member named ‘sps_pps_buf’
libavcodec/crystalhd.c:425:13: warning: statement with no effect
libavcodec/crystalhd.c:426:17: error: ‘CHDContext’ has no member named ‘sps_pps_size’
libavcodec/crystalhd.c:426:13: warning: statement with no effect
libavcodec/crystalhd.c:430:38: error: ‘CHDContext’ has no member named ‘sps_pps_buf’
libavcodec/crystalhd.c:430:32: warning: assignment from incompatible pointer type
libavcodec/crystalhd.c:431:38: error: ‘CHDContext’ has no member named ‘sps_pps_size’
libavcodec/crystalhd.c:431:32: warning: assignment makes integer from pointer without a cast
libavcodec/crystalhd.c:454:13: error: ‘CHDContext’ has no member named ‘sWidth’
libavcodec/crystalhd.c:456:43: error: ‘CHDContext’ has no member named ‘sWidth’
libavcodec/crystalhd.c:456:37: warning: assignment makes integer from pointer without a cast
libavcodec/crystalhd.c:462:5: error: implicit declaration of function ‘DtsDeviceOpen’
libavcodec/crystalhd.c:462:30: error: ‘CHDContext’ has no member named ‘dev’
libavcodec/crystalhd.c:468:5: error: implicit declaration of function ‘DtsCrystalHDVersion’
libavcodec/crystalhd.c:468:35: error: ‘CHDContext’ has no member named ‘dev’
libavcodec/crystalhd.c:474:9: error: ‘CHDContext’ has no member named ‘is_70012’
libavcodec/crystalhd.c:474:5: warning: statement with no effect
libavcodec/crystalhd.c:476:13: error: ‘CHDContext’ has no member named ‘is_70012’
libavcodec/crystalhd.c:483:5: error: implicit declaration of function ‘DtsSetInputFormat’
libavcodec/crystalhd.c:483:33: error: ‘CHDContext’ has no member named ‘dev’
libavcodec/crystalhd.c:489:5: error: implicit declaration of function ‘DtsOpenDecoder’
libavcodec/crystalhd.c:489:30: error: ‘CHDContext’ has no member named ‘dev’
libavcodec/crystalhd.c:495:5: error: implicit declaration of function ‘DtsSetColorSpace’
libavcodec/crystalhd.c:495:32: error: ‘CHDContext’ has no member named ‘dev’
libavcodec/crystalhd.c:500:5: error: implicit declaration of function ‘DtsStartDecoder’
libavcodec/crystalhd.c:500:31: error: ‘CHDContext’ has no member named ‘dev’
libavcodec/crystalhd.c:505:5: error: implicit declaration of function ‘DtsStartCapture’
libavcodec/crystalhd.c:505:31: error: ‘CHDContext’ has no member named ‘dev’
libavcodec/crystalhd.c:512:13: error: ‘CHDContext’ has no member named ‘parser’
libavcodec/crystalhd.c:512:9: warning: statement with no effect
libavcodec/crystalhd.c:513:18: error: ‘CHDContext’ has no member named ‘parser’
libavcodec/crystalhd.c:517:13: error: ‘CHDContext’ has no member named ‘parser’
libavcodec/crystalhd.c:517:9: error: assignment of read-only location ‘*(const struct AVOption *)&<erroneous-expression>’
libavcodec/crystalhd.c:517:9: warning: statement with no effect
libavcodec/crystalhd.c: In function ‘copy_frame’:
libavcodec/crystalhd.c:542:53: error: ‘VDEC_FLAG_BOTTOMFIELD’ undeclared (first use in this function)
libavcodec/crystalhd.c:542:51: error: invalid operands to binary & (have ‘uint32_t’ and ‘const struct AVOption *’)
libavcodec/crystalhd.c:544:55: error: ‘VDEC_FLAG_BOTTOM_FIRST’ undeclared (first use in this function)
libavcodec/crystalhd.c:544:53: error: invalid operands to binary & (have ‘uint32_t’ and ‘const struct AVOption *’)
libavcodec/crystalhd.c:577:5: error: implicit declaration of function ‘DtsGetDriverStatus’
libavcodec/crystalhd.c:577:34: error: ‘CHDContext’ has no member named ‘dev’
libavcodec/crystalhd.c:601:50: error: ‘VDEC_FLAG_UNKNOWN_SRC’ undeclared (first use in this function)
libavcodec/crystalhd.c:601:48: error: invalid operands to binary & (have ‘uint32_t’ and ‘const struct AVOption *’)
libavcodec/crystalhd.c:602:28: error: ‘CHDContext’ has no member named ‘need_second_field’
libavcodec/crystalhd.c:612:47: error: ‘CHDContext’ has no member named ‘last_picture’
libavcodec/crystalhd.c:612:40: warning: comparison between pointer and integer
libavcodec/crystalhd.c:612:70: error: ‘CHDContext’ has no member named ‘need_second_field’
libavcodec/crystalhd.c:619:43: error: ‘VDEC_FLAG_INTERLACED_SRC’ undeclared (first use in this function)
libavcodec/crystalhd.c:619:41: error: invalid operands to binary & (have ‘uint32_t’ and ‘const struct AVOption *’)
libavcodec/crystalhd.c:630:35: error: ‘CHDContext’ has no member named ‘need_second_field’
libavcodec/crystalhd.c:633:9: error: ‘CHDContext’ has no member named ‘need_second_field’
libavcodec/crystalhd.c:633:50: error: ‘CHDContext’ has no member named ‘need_second_field’
libavcodec/crystalhd.c:633:5: warning: statement with no effect
libavcodec/crystalhd.c:645:13: error: ‘CHDContext’ has no member named ‘is_70012’
libavcodec/crystalhd.c:691:14: error: ‘CHDContext’ has no member named ‘need_second_field’
libavcodec/crystalhd.c:703:47: error: invalid operands to binary & (have ‘uint32_t’ and ‘const struct AVOption *’)
libavcodec/crystalhd.c:713:16: error: ‘CHDContext’ has no member named ‘need_second_field’
libavcodec/crystalhd.c:714:36: error: invalid operands to binary & (have ‘uint32_t’ and ‘const struct AVOption *’)
libavcodec/crystalhd.c: In function ‘receive_frame’:
libavcodec/crystalhd.c:728:5: error: ‘HANDLE’ undeclared (first use in this function)
libavcodec/crystalhd.c:728:5: warning: statement with no effect
libavcodec/crystalhd.c:728:12: error: expected ‘;’ before ‘dev’
libavcodec/crystalhd.c:733:5: error: implicit declaration of function ‘DtsProcOutputNoCopy’
libavcodec/crystalhd.c:733:31: error: ‘dev’ undeclared (first use in this function)
libavcodec/crystalhd.c:742:21: error: ‘CHDContext’ has no member named ‘last_picture’
libavcodec/crystalhd.c:742:36: warning: comparison between pointer and integer
libavcodec/crystalhd.c:747:21: error: ‘CHDContext’ has no member named ‘last_picture’
libavcodec/crystalhd.c:747:17: warning: statement with no effect
libavcodec/crystalhd.c:751:54: error: ‘CHDContext’ has no member named ‘bframe_bug’
libavcodec/crystalhd.c:754:21: error: ‘CHDContext’ has no member named ‘last_picture’
libavcodec/crystalhd.c:754:17: error: lvalue required as increment operand
libavcodec/crystalhd.c:754:17: warning: statement with no effect
libavcodec/crystalhd.c:755:17: error: implicit declaration of function ‘DtsReleaseOutputBuffs’
libavcodec/crystalhd.c:755:50: error: ‘FALSE’ undeclared (first use in this function)
libavcodec/crystalhd.c:761:21: error: ‘CHDContext’ has no member named ‘last_picture’
libavcodec/crystalhd.c:761:40: warning: comparison between pointer and integer
libavcodec/crystalhd.c:774:20: error: ‘CHDContext’ has no member named ‘last_picture’
libavcodec/crystalhd.c:774:16: warning: statement with no effect
libavcodec/crystalhd.c:780:21: error: ‘CHDContext’ has no member named ‘last_picture’
libavcodec/crystalhd.c:780:17: error: lvalue required as increment operand
libavcodec/crystalhd.c:780:17: warning: statement with no effect
libavcodec/crystalhd.c: In function ‘decode’:
libavcodec/crystalhd.c:811:5: error: ‘HANDLE’ undeclared (first use in this function)
libavcodec/crystalhd.c:811:5: warning: statement with no effect
libavcodec/crystalhd.c:811:12: error: expected ‘;’ before ‘dev’
libavcodec/crystalhd.c:812:5: warning: ISO C90 forbids mixed declarations and code
libavcodec/crystalhd.c:817:34: error: ‘CHDContext’ has no member named ‘bframe_bug’
libavcodec/crystalhd.c:823:13: error: ‘CHDContext’ has no member named ‘bframe_bug’
libavcodec/crystalhd.c:823:9: warning: statement with no effect
libavcodec/crystalhd.c:824:40: error: ‘CHDContext’ has no member named ‘bframe_bug’
libavcodec/crystalhd.c:830:13: error: ‘CHDContext’ has no member named ‘bframe_bug’
libavcodec/crystalhd.c:830:9: warning: statement with no effect
libavcodec/crystalhd.c:834:9: error: implicit declaration of function ‘DtsTxFreeSize’
libavcodec/crystalhd.c:834:50: error: ‘dev’ undeclared (first use in this function)
libavcodec/crystalhd.c:836:17: error: ‘CHDContext’ has no member named ‘parser’
libavcodec/crystalhd.c:841:21: error: ‘CHDContext’ has no member named ‘bsfc’
libavcodec/crystalhd.c:842:54: error: ‘CHDContext’ has no member named ‘bsfc’
libavcodec/crystalhd.c:844:50: warning: passing argument 1 of ‘av_bitstream_filter_filter’ from incompatible pointer type
libavcodec/avcodec.h:4134:5: note: expected ‘struct AVBitStreamFilterContext *’ but argument is of type ‘const struct AVOption *’
libavcodec/crystalhd.c:851:38: error: ‘CHDContext’ has no member named ‘parser’
libavcodec/crystalhd.c:851:46: error: ‘AVOption’ has no member named ‘priv_data’
libavcodec/crystalhd.c:851:34: warning: initialization from incompatible pointer type
libavcodec/crystalhd.c:853:46: error: ‘CHDContext’ has no member named ‘parser’
libavcodec/crystalhd.c:855:42: warning: passing argument 1 of ‘av_parser_parse2’ from incompatible pointer type
libavcodec/avcodec.h:4099:5: note: expected ‘struct AVCodecParserContext *’ but argument is of type ‘const struct AVOption *’
libavcodec/crystalhd.c:898:13: error: implicit declaration of function ‘DtsProcInput’
libavcodec/crystalhd.c:918:13: error: ‘CHDContext’ has no member named ‘skip_next_output’
libavcodec/crystalhd.c:920:13: error: ‘CHDContext’ has no member named ‘skip_next_output’
libavcodec/crystalhd.c:920:9: warning: statement with no effect
libavcodec/crystalhd.c:939:13: error: ‘CHDContext’ has no member named ‘output_ready’
libavcodec/crystalhd.c:939:28: warning: comparison between pointer and integer
libavcodec/crystalhd.c:941:17: error: ‘CHDContext’ has no member named ‘output_ready’
libavcodec/crystalhd.c:941:13: error: lvalue required as increment operand
libavcodec/crystalhd.c:941:13: warning: statement with no effect
libavcodec/crystalhd.c:953:13: error: ‘CHDContext’ has no member named ‘decode_wait’
libavcodec/crystalhd.c:953:9: warning: statement with no effect
libavcodec/crystalhd.c:981:28: error: ‘CHDContext’ has no member named ‘decode_wait’
libavcodec/crystalhd.c:981:17: warning: passing argument 1 of ‘usleep’ makes integer from pointer without a cast
/usr/include/unistd.h:457:12: note: expected ‘__useconds_t’ but argument is of type ‘const struct AVOption *’
libavcodec/crystalhd.c:998:17: error: ‘CHDContext’ has no member named ‘skip_next_output’
libavcodec/crystalhd.c:998:13: warning: statement with no effect
libavcodec/crystalhd.c:1009:16: error: ‘CHDContext’ has no member named ‘decode_wait’
libavcodec/crystalhd.c:1009:5: warning: passing argument 1 of ‘usleep’ makes integer from pointer without a cast
/usr/include/unistd.h:457:12: note: expected ‘__useconds_t’ but argument is of type ‘const struct AVOption *’
make: *** [libavcodec/crystalhd.o] Error 1

Any suggestions?

qyot27
June 21st, 2011, 09:40 PM
I'm guessing my problem is simple. When I try to "make" ffmpeg on Natty, i get the following"

Any suggestions?
CrystalHD-related errors were brought up about 4 weeks ago, and since I didn't get the chance to really ask then, I will now:

Was this ffmpeg one of the release tarballs (0.6.3 or 0.7-rc1) or a git clone? Because these errors point to a situation where there was an error in the code itself, and thus it would probably (and in the case of 4 weeks ago, clearly did) throw this kind of stuff even when one does not have a Broadcom CrystalHD chip.

I don't even bother with the release tarballs, and have never seen this error arise from git. I would try this first if you haven't already. If the error remains, use the solution described here:
http://ubuntuforums.org/showpost.php?p=10840807&postcount=1716

bigdawgte
June 22nd, 2011, 06:44 AM
Thanks a bunch, that worked. I am using git, though.

terrykiwi83
June 22nd, 2011, 07:04 AM
excellent article, just updated my natty - thanks heaps

andrew.46
June 22nd, 2011, 09:41 AM
Keen users of webm should note that now that patching is no longer necessary to get the libvpx presets as they have been absorbed into the FFmpeg source (http://git.videolan.org/?p=ffmpeg.git;a=commit;h=e1674d7ef7e25d9c37b8f6a6f dac2bba93692fef). Easy now to make quality webm files using FakeOutdoorsman's guide :).

xzero1
June 23rd, 2011, 01:29 AM
The ffmpeg x264 encoding guide link is no longer working. Please update this if possible.

FakeOutdoorsman
June 23rd, 2011, 02:17 AM
Thanks for the notification. It appears that the server is down for maintenance. I just removed the link because it was outdated (due to the new -preset option) and no longer worked.

Smacker_626
June 24th, 2011, 09:00 PM
Keen users of webm should note that now that patching is no longer necessary to get the libvpx presets as they have been absorbed into the FFmpeg source (http://git.videolan.org/?p=ffmpeg.git;a=commit;h=e1674d7ef7e25d9c37b8f6a6f dac2bba93692fef). Easy now to make quality webm files using FakeOutdoorsman's guide :).

Awesome!

Also, YouTube was having issues with WebM videos that used Alt Refs (which the presets turn on). I posted on the WebM mailing list a few days ago and someone from Google has put in a fix for it; it may be fixed already.

aranwe
June 29th, 2011, 05:23 PM
great
Tnx man

Smacker_626
June 30th, 2011, 11:07 PM
Awesome!

Also, YouTube was having issues with WebM videos that used Alt Refs (which the presets turn on). I posted on the WebM mailing list a few days ago and someone from Google has put in a fix for it; it may be fixed already.

The libvpx presets that come with ffmpeg don't enable Alt Refs. Assuming that someone from Google removed the altref option from the presets, YouTube+Alt Refs probably won't be fixed anytime soon. On the bright side, the latest ffmpeg+libvpx presets once again produce WebM videos that work perfectly with YouTube :).

And on a related note, using mkclean isn't a good idea anymore. While a mkclean'ed WebM video will still work with YouTube, it won't be processed as you upload it like the original ffmpeg produced WebM will be.

Here's some up-to-date example WebM cmdlines for ffmpeg in case anyone wants 'em (assuming dual-core CPU and 720p+eng input).

2-pass VBR
(video=4 Mbps, audio=320 Kbps):


ffmpeg -i example.avi -an -vlang eng -vcodec libvpx -vpre 720p -vb 4M -pass 1 -threads 2 vbr_example.webm
ffmpeg -i example.avi -alang eng -acodec libvorbis -ab 320k -vlang eng -vcodec libvpx -vpre 720p -vb 4M -pass 2 -threads 2 -y vbr_example.webm
2-pass CQ (Constrained Quality, similar to x264's CRF)
(video=23 quality with 4 Mbps target maximum, audio=9 quality which is ~320 Kbps for Vorbis):


ffmpeg -i example.avi -an -vlang eng -vcodec libvpx -vpre 720p -crf 23 -vb 4M -pass 1 -threads 2 cq_example.webm
ffmpeg -i example.avi -alang eng -acodec libvorbis -aq 9 -vlang eng -vcodec libvpx -vpre 720p -crf 23 -vb 4M -pass 2 -threads 2 -y cq_example.webm

OKComputerQ
July 6th, 2011, 05:31 PM
Hi Guys !

I'm really new to Linux and in order to use OpenCV I needed to install ffmpeg . I followed the guide for Natty but problem I'm facing is during making of x264 . What I get from googling is that this error is coming perhaps due to my previous attempts to install ffmpeg . I tried uninstalling and performing the whole process all over again several times , but I'm still getting the same error.

Below is the log



gcc -Wshadow -O3 -ffast-math -Wall -I. -march=i686 -mfpmath=sse -msse -std=gnu99 -fomit-frame-pointer -fno-tree-vectorize -c -o x264.o x264.c
gcc -Wshadow -O3 -ffast-math -Wall -I. -march=i686 -mfpmath=sse -msse -std=gnu99 -fomit-frame-pointer -fno-tree-vectorize -c -o input/input.o input/input.c
gcc -Wshadow -O3 -ffast-math -Wall -I. -march=i686 -mfpmath=sse -msse -std=gnu99 -fomit-frame-pointer -fno-tree-vectorize -c -o input/timecode.o input/timecode.c
input/timecode.c: In function ‘parse_tcfile’:
input/timecode.c:163:18: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
input/timecode.c:196:22: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
input/timecode.c:242:14: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
input/timecode.c:248:18: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
gcc -Wshadow -O3 -ffast-math -Wall -I. -march=i686 -mfpmath=sse -msse -std=gnu99 -fomit-frame-pointer -fno-tree-vectorize -c -o input/raw.o input/raw.c
gcc -Wshadow -O3 -ffast-math -Wall -I. -march=i686 -mfpmath=sse -msse -std=gnu99 -fomit-frame-pointer -fno-tree-vectorize -c -o input/y4m.o input/y4m.c
gcc -Wshadow -O3 -ffast-math -Wall -I. -march=i686 -mfpmath=sse -msse -std=gnu99 -fomit-frame-pointer -fno-tree-vectorize -c -o output/raw.o output/raw.c
gcc -Wshadow -O3 -ffast-math -Wall -I. -march=i686 -mfpmath=sse -msse -std=gnu99 -fomit-frame-pointer -fno-tree-vectorize -c -o output/matroska.o output/matroska.c
gcc -Wshadow -O3 -ffast-math -Wall -I. -march=i686 -mfpmath=sse -msse -std=gnu99 -fomit-frame-pointer -fno-tree-vectorize -c -o output/matroska_ebml.o output/matroska_ebml.c
gcc -Wshadow -O3 -ffast-math -Wall -I. -march=i686 -mfpmath=sse -msse -std=gnu99 -fomit-frame-pointer -fno-tree-vectorize -c -o output/flv.o output/flv.c
gcc -Wshadow -O3 -ffast-math -Wall -I. -march=i686 -mfpmath=sse -msse -std=gnu99 -fomit-frame-pointer -fno-tree-vectorize -c -o output/flv_bytestream.o output/flv_bytestream.c
gcc -Wshadow -O3 -ffast-math -Wall -I. -march=i686 -mfpmath=sse -msse -std=gnu99 -fomit-frame-pointer -fno-tree-vectorize -c -o filters/filters.o filters/filters.c
gcc -Wshadow -O3 -ffast-math -Wall -I. -march=i686 -mfpmath=sse -msse -std=gnu99 -fomit-frame-pointer -fno-tree-vectorize -c -o filters/video/video.o filters/video/video.c
gcc -Wshadow -O3 -ffast-math -Wall -I. -march=i686 -mfpmath=sse -msse -std=gnu99 -fomit-frame-pointer -fno-tree-vectorize -c -o filters/video/source.o filters/video/source.c
gcc -Wshadow -O3 -ffast-math -Wall -I. -march=i686 -mfpmath=sse -msse -std=gnu99 -fomit-frame-pointer -fno-tree-vectorize -c -o filters/video/internal.o filters/video/internal.c
gcc -Wshadow -O3 -ffast-math -Wall -I. -march=i686 -mfpmath=sse -msse -std=gnu99 -fomit-frame-pointer -fno-tree-vectorize -c -o filters/video/resize.o filters/video/resize.c
filters/video/resize.c:44:27: fatal error: libavutil/opt.h: No such file or directory
compilation terminated.
make: *** [filters/video/resize.o] Error 1
I would be really grateful if someone could help me out since I have spent 3-4 days on unsuccessful attempts to properly install ffmpeg

andrew.46
July 7th, 2011, 02:11 AM
Just to get you going perhaps add --disable-lavf to your x264 ./configure string? I have to confess though that I know nothing about OpenCV so I do not know if you will actually need x264 lavf support for this...

OKComputerQ
July 7th, 2011, 02:40 AM
Just to get you going perhaps add --disable-lavf to your x264 ./configure string? I have to confess though that I know nothing about OpenCV so I do not know if you will actually need x264 lavf support for this...

OpenCV is a library of computer vision related functions . I tried adding --disable-lavf, it gives the same error

andrew.46
July 7th, 2011, 02:45 AM
I tried adding --disable-lavf, it gives the same error

In that case we shall have to wait for wiser heads than mine to have a look at the problem :(

OKComputerQ
July 7th, 2011, 04:19 PM
In that case we shall have to wait for wiser heads than mine to have a look at the problem :(

I guess so , Thanks for the reply :)

qyot27
July 7th, 2011, 11:42 PM
Google only showed this thread and a few OpenSUSE discussions where that error occurred. And the OpenSUSE discussions were centered around an old revision of ffmpeg (0.6.25320 as far as the package naming was concerned; back in October 2010). And more specifically, it mentioned that this issue of libavutil/opt.h coming up missing was fixed when ffmpeg was still using SVN (r25420, specifically).

So I'm guessing that's the issue. Use an ffmpeg that isn't horrifically outdated and the problem will probably go away.

OKComputerQ
July 8th, 2011, 05:45 AM
Google only showed this thread and a few OpenSUSE discussions where that error occurred. And the OpenSUSE discussions were centered around an old revision of ffmpeg (0.6.25320 as far as the package naming was concerned; back in October 2010). And more specifically, it mentioned that this issue of libavutil/opt.h coming up missing was fixed when ffmpeg was still using SVN (r25420, specifically).


So I'm guessing that's the issue. Use an ffmpeg that isn't horrifically outdated and the problem will probably go away.
Thanks for the reply

Yes you are right , but I'm following exactly what it says in the tutorial given here (using git). And also I can't even make it to the ffmpeg step due to this problem occurring in make x264 . I did however got past this step in my previous attempts , then only ffmpeg was causing problems , but now I could not even reach there

qyot27
July 8th, 2011, 07:35 AM
Thanks for the reply

Yes you are right , but I'm following exactly what it says in the tutorial given here (using git). And also I can't even make it to the ffmpeg step due to this problem occurring in make x264 . I did however got past this step in my previous attempts , then only ffmpeg was causing problems , but now I could not even reach there
Try

sudo apt-get purge ffmpeg

and then attempt to build x264 again. I have a feeling that there may have been a copy of FFmpeg 0.6 installed previously, and the 'remove' step didn't flush all of it out. Also, if any part of a make process fails, it tends to be a good idea to run 'make distclean' before running ./configure again. Otherwise you could get remnants from previous failed build attempts.





From a different angle, I would hope I'm wrong, but it could be due to the 'bulk' of the FFmpeg build that x264 is trying to link against. Some git commits from this past April mention an opt.h, but I don't know if it's related to this issue. You could try to build a stripped-down version of FFmpeg *first*, then build x264 (which will detect FFmpeg), then uninstall FFmpeg and install a proper, full version. For cleanliness reasons, you can install the minimal FFmpeg to a custom area, which won't mess with the system.

This is what I do since none of the encoders or muxers in FFmpeg are necessary for x264's lavf support to function (along with inflating FFMS2 the same way, and needing to link even more stuff in the process).

If you want to try the minimal FFmpeg->x264->full FFmpeg option, then see if this works:

basic FFmpeg:

cd ffmpeg
./configure --prefix=$HOME/ffms2_build --enable-gpl --enable-version3 \
--enable-postproc --disable-encoders --disable-muxers --disable-debug \
--disable-network --disable-hwaccels --disable-indevs --disable-outdevs
make
make install

FFMS2 (as optional as the lavf support in x264 is, and I think the sudo part covers everything needed):

sudo apt-get install subversion automake autoconf libtool
svn checkout http://ffmpegsource.googlecode.com/svn/trunk ffms2
cd ffms2
./configure --prefix=$HOME/ffms2_build PKG_CONFIG_PATH=$HOME/ffms2_build/lib/pkgconfig
make
make install

x264 (which is just changes to the ./configure step):

cd x264
PKG_CONFIG_PATH=$HOME/ffms2_build/lib/pkgconfig ./configure --enable-static \
--extra-cflags="-I$HOME/ffms2_build/include" --extra-ldflags="-L$HOME/ffms2_build/lib"

Cleanup before building full FFmpeg:

cd ffmpeg
make uninstall
make distclean

OKComputerQ
July 8th, 2011, 02:17 PM
Try

sudo apt-get purge ffmpeg

and then attempt to build x264 again. I have a feeling that there may have been a copy of FFmpeg 0.6 installed previously, and the 'remove' step didn't flush all of it out. Also, if any part of a make process fails, it tends to be a good idea to run 'make distclean' before running ./configure again. Otherwise you could get remnants from previous failed build attempts.





From a different angle, I would hope I'm wrong, but it could be due to the 'bulk' of the FFmpeg build that x264 is trying to link against. Some git commits from this past April mention an opt.h, but I don't know if it's related to this issue. You could try to build a stripped-down version of FFmpeg *first*, then build x264 (which will detect FFmpeg), then uninstall FFmpeg and install a proper, full version. For cleanliness reasons, you can install the minimal FFmpeg to a custom area, which won't mess with the system.

This is what I do since none of the encoders or muxers in FFmpeg are necessary for x264's lavf support to function (along with inflating FFMS2 the same way, and needing to link even more stuff in the process).

If you want to try the minimal FFmpeg->x264->full FFmpeg option, then see if this works:

basic FFmpeg:

cd ffmpeg
./configure --prefix=$HOME/ffms2_build --enable-gpl --enable-version3 \
--enable-postproc --disable-encoders --disable-muxers --disable-debug \
--disable-network --disable-hwaccels --disable-indevs --disable-outdevs
make
make installFFMS2 (as optional as the lavf support in x264 is, and I think the sudo part covers everything needed):

sudo apt-get install subversion automake autoconf libtool
svn checkout http://ffmpegsource.googlecode.com/svn/trunk ffms2
cd ffms2
./configure --prefix=$HOME/ffms2_build PKG_CONFIG_PATH=$HOME/ffms2_build/lib/pkgconfig
make
make installx264 (which is just changes to the ./configure step):

cd x264
PKG_CONFIG_PATH=$HOME/ffms2_build/lib/pkgconfig ./configure --enable-static \
--extra-cflags="-I$HOME/ffms2_build/include" --extra-ldflags="-L$HOME/ffms2_build/lib"Cleanup before building full FFmpeg:

cd ffmpeg
make uninstall
make distclean

Thank you very much qyot27!!! You just resolved my issue . I did the minimum install and followed your instructions and it worked! :D Now I just need to setup OpenCV to get my development working ! You rock man :guitar:

vagrale13
July 10th, 2011, 02:01 PM
Indeed I did not notice that presets-libavcodec52-v6.xml is packaged in /usr/share/winff/ :). You will not need the sed command though as this change is already present in the preset. So to modify your command slightly:



mv -v ~/.winff/presets.xml ~/.winff/presets.xml_bak && \
cp -v /usr/share/winff/presets-libavcodec52-v6.xml ~/.winff/presets.xml
should be enough to get started with the git FFmpeg. To alter the ogg preset I would suggest:


sed -i_oggchange 's/-acodec vorbis/-acodec libvorbis/g' ~/.winff/presets.xmland then possible more changes, I have only just started looking at the newer presets. Thanks for pointing out that the newer presets were already installed :).
After a couple of days, i try to convert a video with winff without command

sed -i 's/kb /k /g' ~/.winff/presets.xmland doesn' t work.
After run the command, where change kb to k, works fine!

wrightjmf
July 13th, 2011, 04:42 PM
Thanks. This was incredibly helpful.

budgierless
July 22nd, 2011, 11:42 AM
Hi, i am using ubuntu 9.10, i am trying to get mp4box to support x264 for ipad mp4 files, but i dont have a clue what im doing, can someone give me a step by step tutorial to config this via the terminal of ubuntu 9.10.

i dont know if this help but their is an example of my current output:


FFmpeg version SVN-r25924, Copyright (c) 2000-2010 the FFmpeg developers
built on Dec 9 2010 20:10:38 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-libx264 --enable-libxvid --enable-x11grab
libavutil 50.34. 0 / 50.34. 0
libavcore 0.16. 0 / 0.16. 0
libavcodec 52.99. 1 / 52.99. 1
libavformat 52.88. 0 / 52.88. 0
libavdevice 52. 2. 2 / 52. 2. 2
libavfilter 1.68. 1 / 1.68. 1
libswscale 0.12. 0 / 0.12. 0
libpostproc 51. 2. 0 / 51. 2. 0
[flv @ 0x2eb5510] Estimating duration from bitrate, this may be inaccurate

Seems stream 0 codec frame rate differs from container frame rate: 59.94 (2997/50) -> 29.92 (359/12)
Input #0, flv, from '/var/www/vhosts/xxxxxxxx/mydomain.com/httpdocs/vdata/videoclip.flv':
Metadata:
metadatacreator : Yet Another Metadata Injector for FLV - Version 1.5
hasKeyframes : true
hasVideo : true
hasAudio : true
hasMetadata : true
canSeekToEnd : false
duration : 138
datasize : 6524496
videosize : 5791258
videocodecid : 7
width : 640
height : 360
framerate : 30
videodatarate : 325
audiosize : 703690
audiocodecid : 10
audiosamplerate : 44100
audiosamplesize : 16
stereo : true
audiodatarate : 38
filesize : 6525667
lasttimestamp : 138
lastkeyframetimestamp: 135
lastkeyframelocation: 6341071
Duration: 00:02:18.32, start: 0.000000, bitrate: 370 kb/s
Stream #0.0: Video: h264, yuv420p, 640x360 [PAR 1:1 DAR 16:9], 332 kb/s, 29.92 tbr, 1k tbn, 59.94 tbc
Stream #0.1: Audio: aac, 48000 Hz, mono, s16, 38 kb/s
File for preset 'hq' not found

no idea if that helps at all.

bflag
July 24th, 2011, 04:39 PM
I'm using Ubuntu 11.04 and was having difficulty encoding in x264 format from Handbrake using the AppleTV 2 preset. I kept getting a Segmentation Fault about 10% into the encode. I followed FakeOutdoorsman's instructions and attempted to encode the video directly from ffmpeg :
ffmpeg -i input.mpg -acodec libfaac -aq 100 -vcodec libx264 -preset slow -crf 22 -threads 0 output.mp4

But, I kept getting a Segmentation Fault.

So, I performed a new install of Ubuntu 11.04... updated the system, and refollowed FakeOutdoorsman's instructions.

Segmentation Fault.

Unistalled everything. Installed ffmpeg, then x264, removed ffmpeg, then reinstalled ffmpeg.

Segmentation Fault.

I've been encoding the same input videos on another Ubuntu 11.04 system, using the AppleTV2 preset from Handbrake wiithout issues.

Anyone have any ideas?

PS : I'm using a new AMD Phenom II X6 1090T Processor and the 64 Bit version of Ubuntu 11.04

bflag
July 24th, 2011, 08:38 PM
Attached is the output from an attempted encode. Does anyone have any ideas?

---

frank@Ubuntu-1:~$ ffmpeg -i test_input.mpg -acodec libfaac -aq 100 -vcodec libx264 -preset slow -crf 22 -threads 0 output.mp4
ffmpeg version N-31629-g9e4ed29, Copyright (c) 2000-2011 the FFmpeg developers
built on Jul 24 2011 15:27:06 with gcc 4.5.2
configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
libavutil 51. 11. 0 / 51. 11. 0
libavcodec 53. 9. 0 / 53. 9. 0
libavformat 53. 6. 0 / 53. 6. 0
libavdevice 53. 2. 0 / 53. 2. 0
libavfilter 2. 27. 3 / 2. 27. 3
libswscale 2. 0. 0 / 2. 0. 0
libpostproc 51. 2. 0 / 51. 2. 0
Input #0, mpeg, from 'test_input.mpg':
Duration: 00:30:00.09, start: 0.402556, bitrate: 11928 kb/s
Stream #0.0[0x1e0]: Video: mpeg2video (Main), yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 19392 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Stream #0.1[0x1bd]: Audio: ac3, 48000 Hz, 5.1, s16, 384 kb/s
[buffer @ 0x18f8380] w:1920 h:1080 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
[libx264 @ 0x18f8440] using SAR=1/1
[libx264 @ 0x18f8440] using cpu capabilities: MMX2 SSE2Fast FastShuffle SSEMisalign LZCNT
[libx264 @ 0x18f8440] profile High, level 5.0
[libx264 @ 0x18f8440] 264 - core 116 r2037 f8ebd4a - H.264/MPEG-4 AVC codec - Copyleft 2003-2011 - 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=9 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 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=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
Metadata:
encoder : Lavf53.6.0
Stream #0.0: Video: libx264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 30k tbn, 29.97 tbc
Stream #0.1: Audio: libfaac, 48000 Hz, 5.1, s16, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop, [?] for help
Segmentation fault0 q=28.0 size= 71288kB time=00:01:36.39 bitrate=6058.2kbits/s dup=20 drop=0

FakeOutdoorsman
July 27th, 2011, 07:25 PM
I'm using Ubuntu 11.04 and was having difficulty encoding in x264 format from Handbrake using the AppleTV 2 preset. I kept getting a Segmentation Fault about 10% into the encode. I followed FakeOutdoorsman's instructions and attempted to encode the video directly from ffmpeg...But, I kept getting a Segmentation Fault.
Handbreak and FFmpeg (that you compiled from this guide) are both giving you a seg fault? Does FFmpeg from the repository give you a seg fault too?

sudo apt-get remove ffmpeg x264
sudo apt-get install ffmpeg libavcodec-extra-52
hash ffmpeg
ffmpeg -i test_input.mpg -an -vcodec libx264 -vpre slow -crf 22 -threads 0 output.mp4

bflag
July 28th, 2011, 01:37 AM
Another Segmentation Fault... I installed Ubuntu 11.04 Minimum install, implemented your original instructions, followed by your most recent instructions...

frank@encoder-1-host:~$ ffmpeg -i "The Office - The Cover-Up.mpg" -an -vcodec libx264 -vpre slow -crf 22 -threads 0 output.mp4
FFmpeg version 0.6.2-4:0.6.2-1ubuntu1, Copyright (c) 2000-2010 the Libav developers
built on Mar 22 2011 15:55:04 with gcc 4.5.2
configuration: --extra-version=4:0.6.2-1ubuntu1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-vaapi --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
WARNING: library configuration mismatch
libavutil configuration: --extra-version=4:0.6.2-1ubuntu2 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-vaapi --enable-libopenjpeg --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libfaad --enable-libdirac --enable-libfaad --enable-libmp3lame --enable-librtmp --enable-libx264 --enable-libxvid --enable-libdc1394 --enable-shared --disable-static
libavcodec configuration: --extra-version=4:0.6.2-1ubuntu2 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-vaapi --enable-libopenjpeg --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libfaad --enable-libdirac --enable-libfaad --enable-libmp3lame --enable-librtmp --enable-libx264 --enable-libxvid --enable-libdc1394 --enable-shared --disable-static
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
[mpeg2video @ 0x15a2a50]mpeg_decode_postinit() failure
Last message repeated 12 times
[mpeg @ 0x1551640]max_analyze_duration reached
Input #0, mpeg, from 'The Office - The Cover-Up.mpg':
Duration: 00:30:02.39, start: 1.000000, bitrate: 13391 kb/s
Stream #0.0[0x1bd]: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
Stream #0.1[0x1e0]: Video: mpeg2video, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 20000 kb/s, 32.72 fps, 29.97 tbr, 90k tbn, 59.94 tbc
[libx264 @ 0x16b1770]using SAR=1/1
[libx264 @ 0x16b1770]using cpu capabilities: MMX2 SSE2Fast FastShuffle SSEMisalign LZCNT
[libx264 @ 0x16b1770]profile High, level 5.0
[libx264 @ 0x16b1770]264 - core 106 Ubuntu_2:0.106.1741-3 - 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=9 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 open_gop=0 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 'output.mp4':
Metadata:
encoder : Lavf52.64.2
Stream #0.0: Video: libx264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], q=10-51, 200 kb/s, 30k tbn, 29.97 tbc
Stream mapping:
Stream #0.1 -> #0.0
Press [q] to stop encoding
[mpeg2video @ 0x15a2a50]warning: first frame is no keyframe
Segmentation fault1 q=27.0 size= 64256kB time=71.07 bitrate=7406.4kbits/s its/s

Mr.Goose
July 28th, 2011, 10:59 PM
@Jose Catre-Vandis, WRT your post a few weeks ago:-
http://ubuntuforums.org/showpost.php?p=10930828&postcount=1753

After a lot of digging around, I think I found a fix for the issue of ffmpeg-x264 *.mp4 files playing with the wrong aspect ratio in MPlayer - whilst playing perfectly OK in VLC, Kaffeine, Totem etc.

Seems it is a bug with MPlayer :P - though I don't understand why ffmpeg-x264 *.mp4 files I encoded last year seem to play fine. :confused:

Anyway, an updated MPlayer is available in PPA:-
https://launchpad.net/~motumedia/+archive/mplayer-daily

This updated version fixes the aspect ratio issue. To install it, open a terminal window and type in each of the three lines (remembering to hit your return key at the end of each line of course):-


sudo apt-add-repository ppa:motumedia/mplayer-daily
sudo apt-get update
sudo apt-get dist-upgrade

I just did it and I'm delighted to report that all my recently-encoded ffmpeg-x264 encoded mp4's now play perfectly in Mplayer. All the old ones play fine too.

FWIW, I'm actually using Ricardo Villalba's SMPlayer, an excellent QT-based front end for Mplayer. IMHO, it's probably one of the finest (and easiest to use) media players for this type of file - especially now I've figured out how to fix the aspect ratio issue. lol. :D

Anyway Jose, I'd be very interested to know if this fixes the issue for you too?

Best wishes, G.


Followed guide successfully on Xubuntu 11.04. Everything works fine. Have an odd problem with mp4 playback using mplayer (no-gui).

If I encode a bit of recorded tv (.ts file, PAR 64:45, DAR 16/9) using the first crf example, the encode works fine and retains the PAR and DAR, but when I go to playback in mplayer (nothing in config file) mplayer seems to think the video has an aspect ratio of 2.53:1, making a wide thin video.

If I encode using the same command line but replace with mkv instead of mp4, mplayer plays back at the correct aspect of 16/9.

mplayer plays back avi/xvid (encoding the same piece of recorded tv) at the correct aspect ratio.

Screen is a 1920x1080 24". No similar problems on 10.04 LTS

I can fix this with a profile in mplayer's config:
[extension.mp4]
profile-desc="Profile for HD mp4 files"
aspect="16/9" but this will affect all mp4 extensions.

If I use parole, I have to use the "none" setting in Aspect menu to get the correct resolution.

Can anyone shed any light on this issue? I have tried encoding with all sorts of different parameters but with no success.

andrew.46
July 28th, 2011, 11:31 PM
FWIW, I'm actually using Ricardo Villalba's SMPlayer, an excellent QT-based front end for Mplayer. IMHO, it's probably one of the finest (and easiest to use) media players for this type of file - especially now I've figured out how to fix the aspect ratio issue. lol. :D

There has been a lot of interest recently in a fork of SMPlayer called UMPlayer, might be worth a look as well?

andrew.46
July 30th, 2011, 12:03 PM
I am converting some footage of my daughter tandem skydiving for my android phone. For this to play on this particular device I have to use the baseline profile but I cannot get past an error message:



andrew@skamandros~/Desktop$ ffmpeg -i claire.vob \
> -vcodec libx264 -preset slow -profile baseline -crf 22 -threads 0 \
> -acodec libfaac -ac 2 -ar 44100 -ab 128k \
> claire_skydive.mp4
ffmpeg version N-31694-g0e29c4f, Copyright (c) 2000-2011 the FFmpeg developers
built on Jul 30 2011 20:54:25 with gcc 4.5.3
configuration: --prefix=/usr --mandir=/usr/man --enable-postproc --enable-avfilter --enable-pthreads --enable-shared --disable-static --disable-ffserver --enable-libvorbis --enable-libmp3lame --enable-libx264 --enable-libfaac --enable-libvpx --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-x11grab --enable-nonfree --enable-gpl --enable-version3
libavutil 51. 11. 1 / 51. 11. 1
libavcodec 53. 9. 0 / 53. 9. 0
libavformat 53. 6. 0 / 53. 6. 0
libavdevice 53. 2. 0 / 53. 2. 0
libavfilter 2. 27. 3 / 2. 27. 3
libswscale 2. 0. 0 / 2. 0. 0
libpostproc 51. 2. 0 / 51. 2. 0
[mpeg @ 0x8068380] max_analyze_duration 5000000 reached at 5000000
Input #0, mpeg, from 'claire.vob':
Duration: 00:05:38.68, start: 0.360000, bitrate: 7605 kb/s
Stream #0.0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 8000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0.1[0xa0]: Audio: pcm_s16be, 48000 Hz, 2 channels, s16, 1536 kb/s
w:720 h:576 pixfmt:yuv420p tb:1/1000000 sar:64/45 sws_param:
[libx264 @ 0x8063700] using SAR=64/45
[libx264 @ 0x8063700] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
[libx264 @ 0x8063700] profile Constrained Baseline, level 3.0
[libx264 @ 0x8063700] 264 - core 116 r84 9cc407d - H.264/MPEG-4 AVC codec - Copyleft 2003-2011 - http://www.videolan.org/x264.html - options: cabac=0 ref=5 deblock=1:0:0 analyse=0x1:0x111 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=crf mbtree=1 crf=22.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[B][NULL @ 0x80658c0] [Eval @ 0xbfdff01c] Undefined constant or missing '(' in 'baseline'
[NULL @ 0x80658c0] Unable to parse option value "baseline"
[NULL @ 0x80658c0] Error setting option profile to value baseline.
Output #0, mp4, to 'claire_skydive.mp4':
Stream #0.0: Video: libx264, yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream #0.1: Audio: libfaac, 44100 Hz, 2 channels, s16, 64 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


This has been reported to FFmpeg-users (http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2011-July/001690.html) just recently with no subsequent comments :(. Any thoughts or fixes for this one?

qyot27
July 30th, 2011, 04:27 PM
I am converting some footage of my daughter tandem skydiving for my android phone. For this to play on this particular device I have to use the baseline profile but I cannot get past an error message:


---snip---
[NULL @ 0x80658c0] [Eval @ 0xbfdff01c] Undefined constant or missing '(' in 'baseline'
[NULL @ 0x80658c0] Unable to parse option value "baseline"
[NULL @ 0x80658c0] Error setting option profile to value baseline.
---snip---

This has been reported to FFmpeg-users (http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2011-July/001690.html) just recently with no subsequent comments :(. Any thoughts or fixes for this one?

It was mentioned here (http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/133615) that it has something to do with audio being included. Looks like the possible interim solutions are:

Encode video and audio separately, mux later (with MP4Box or mp4creator, most likely, unless it supports MKV too), or
Use an L-SMASH equipped x264 build directly, since those come with audio encoding support.

FakeOutdoorsman
July 30th, 2011, 10:48 PM
It appears that 5dc6bd86 (http://git.videolan.org/?p=ffmpeg.git;a=commit;h=5dc6bd86f0f5cfffb44b47e6e 916119f26b12091) introduced this issue to me. I replied to the thread that qyot27 mentioned. Maybe it will add some more interest to the issue.

Another option is to use the previous working commit (1885824b20a493d25db4b8e5397666e3a68f45f2): example (http://ubuntuforums.org/showpost.php?p=11096593&postcount=151).

andrew.46
July 31st, 2011, 07:43 AM
Thanks qyot and Fakeoutdoorsman, I encoded video and audio separately and then muxed with MP4Box. Hopefully the FFmpeg developers will sort it all out soon...

cpcpcp
July 31st, 2011, 09:31 PM
Following the instructions to install the latest ffmpeg etc on LTS10.04 it seems to be going wrong.
Is it hopeless (am I hopeless) or can things be fixed?


cjp@cjp-desktop:~$ sudo apt-get remove ffmpeg x264 libx264-dev
Reading package lists... Done Building dependency tree
Reading state information... Done Package libx264-dev is not installed, so not removed
The following packages will be REMOVED ffmpeg winff winff-doc x264 0 upgraded, 0 newly installed, 4 to remove and 88 not upgraded. After this operation, 7,791kB disk space will be freed. Do you want to continue [Y/n]? y
(Reading database ... 279297 files and directories currently installed.)
Removing winff-doc ... Removing winff ...
Removing ffmpeg ...
Removing x264 ...
Processing triggers for doc-base ... Processing 1 removed doc-base file(s)... Registering documents with scrollkeeper...
Processing triggers for shared-mime-info ... Processing triggers for man-db ... Processing triggers for menu ... Processing triggers for hicolor-icon-theme ... Processing triggers for desktop-file-utils ... Processing triggers for python-gmenu ... Rebuilding /usr/share/applications/desktop.en_GB.utf8.cache... Processing triggers for python-support ...
cjp@cjp-desktop:~$ sudo apt-get update Hit http://ppa.launchpad.net lucid Release.gpg Ign http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu/ lucid/main Translation-en_GB

etc

Hit http://archive.ubuntu.com/ubuntu/ lucid/main Translation-en_GB
Hit http://archive.ubuntu.com/ubuntu/ lucid/multiverse Translation-en_GB
Hit http://archive.ubuntu.com lucid-updates Release.gpg Ign http://archive.ubuntu.com/ubuntu/ lucid-updates/restricted Translation-en_GB Ign http://archive.ubuntu.com/ubuntu/ lucid-u etc Ign http://packages.medibuntu.org/ lucid/free Translation-en_GB
Hit http://archive.ubuntu.com lucid-security Release.gpg Ign http://archive.ubuntu.com/ubuntu/ lucid-security/restricted Translation-en_GB Hit http://ppa.launchpad.net lucid Release Ign http://archive.ubuntu.com/ubuntu/ lucid-security/universe Translation-en_GB Ign http://archive.ubuntu.com/ubuntu/ lucid-security/main Translation-en_GB etc Hit http://deb.torproject.org lucid/main Packages Get: 1 http://archive.getdeb.net lucid-getdeb Release.gpg [836B]
Ign http://archive.getdeb.net/ubuntu/ lucid-getdeb/games Translation-en_GB Get: 2 http://archive.getdeb.net lucid-getdeb Release [7,246B] Get: 3 http://archive.getdeb.net lucid-getdeb/games Packages [68.3kB] Fetched 76.3kB in 3s (25.1kB/s)
Reading package lists... Done cjp@cjp-desktop:~$ sudo apt-get install build-essential git-core checkinstall yasm texi2html libfaac-dev \ > libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev \ > libvorbis-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev Reading package lists... Done Building dependency tree
Reading state information... Done git-core is already the newest version. Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:
The following packages have unmet dependencies. libsdl1.2-dev: Depends: libglu1-mesa-dev but it is not going to be installed E: Broken packages
cjp@cjp-desktop:~$ d d: command not found cjp@cjp-desktop:~$ git clone git://git.videolan.org/x264 fatal: destination path 'x264' already exists and is not an empty directory. cjp@cjp-desktop:~$ cd x264 cjp@cjp-desktop:~/x264$ ./configure --enable-static Unknown option --enable-static, ignored Found no assembler Minimum version is yasm-0.7.0 If you really want to compile without asm, configure with --disable-asm. cjp@cjp-desktop:~/x264$ make Makefile:3: config.mak: No such file or directory ./configure Found no assembler Minimum version is yasm-0.7.0 If you really want to compile without asm, configure with --disable-asm. make: *** [config.mak] Error 1 cjp@cjp-desktop:~/x264$ sudo checkinstall --pkgname=x264 --default --pkgversion="3:$(./version.sh | \ > awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes sudo: checkinstall: command not foundAll I want to do is put a video on my Nokia 5800 mobile phone but it all seems like hard work:sad:

Chris

ron999
July 31st, 2011, 09:52 PM
All I want to do is put a video on my Nokia 5800 mobile phone :sad:

You're in the wrong place pal.
Put some effort into your original thread and you might get a response.

Here:- http://ubuntuforums.org/showthread.php?t=1815602

cpcpcp
August 1st, 2011, 08:37 PM
You're in the wrong place pal.
Put some effort into your original thread and you might get a response.

Here:- http://ubuntuforums.org/showthread.php?t=1815602

Why do you think I am in the wrong place?
I am after help in installing the latest version of ffmpeg as FakeOutdoorsman's instructions for the install failed for me.

The reason I want the latest version is to convert a video file to play on my Nokia mobile phone (which is the subject of another thread - on which FakeOutdoorsman has been able to assist!!).:o

I now just need ffmpeg installed to try the solution and if all else fails I will re- install the original Ubuntu distro version

Chris

qyot27
August 2nd, 2011, 07:23 AM
Well, that log noted two things:
Broken dependencies
No assembler (yasm, in this case)

So you need to fix the broken dependencies issue. That's totally unrelated to this thread and I can never seem to remember the proper course of action to address that situation, so use search to track down the answer for that, unless someone else responds with that info.

Then, you need to make sure you run every preparatory command in this thread's first post - because it tells the system to install yasm, thus that should be a non-issue.

madeinfamous
August 5th, 2011, 09:49 PM
@ FakeOutdoorsman



"Install libvpx (optional)
4. This is used to encode VP8 video. If you follow this step, add --enable-libvpx to the FFmpeg ./configure line in step 5."


should be:


./configure --enable-vp8


thank you!

andrew.46
August 5th, 2011, 10:40 PM
should be:


./configure --enable-vp8


Hmmm...... not here:



andrew@skamandros~/source/ffmpeg_build/ffmpeg/ffmpeg$ ./configure --help | grep -i vpx
--enable-libvpx enable VP8 support via libvpx [no]

FakeOutdoorsman
August 5th, 2011, 10:47 PM
I think madeinfamous is refering to the libvpx configure. Amirite? Da/nyet? Although it doesn't seem to make a difference for FFmpeg...unless I missed something. I don't use this encoder often myself. Perhaps a reason why --enable-vp8 needs to be included might clear things up.

madeinfamous
August 6th, 2011, 01:28 PM
hi :)


@siva:~/ffmpeg/libvpx$ ./configure --enable-libvpx
Unknown option "--enable-libvpx".
See ./configure --help for available options.



--enable-vp8 VP8 codec support


ubuntu natty amd64

have a nice day!

FakeOutdoorsman
August 6th, 2011, 07:38 PM
The --enable-libvpx configuration option is intended for FFmpeg, not libvpx:

If you follow this step, add --enable-libvpx to the FFmpeg ./configure line in step 5.

madeinfamous
August 7th, 2011, 12:49 PM
@ FakeOutdoorsman

oh my bad, I am terribly ashamed! :oops:

probably due to fatigue ... :)

thank you for pointing this out!

have a nice week!

spielnicht
August 12th, 2011, 04:41 PM
Thanks for the great guide.

Quick question, is RMVB fully supported by simply following this guide?? Only reason I ask is that I get an error when converting RMVB ("Unsupported Video Codec"). Funny thing, is that the conversion does go on and finishes...but only to discover that the audio and picture are slightly out of sync.

Thoughts???

FakeOutdoorsman
August 12th, 2011, 07:22 PM
Please show your command and the complete terminal output. What players did you use? Does it play normally with ffplay?

MarioMey
August 13th, 2011, 03:51 AM
Sorry if what I'm going to ask was discuss... I can't read 180 pages.

I compiled FFMPEG, there wasn't problems. I expected to have version 0.8 of ffmpeg, but now I have N-31831-g931187e version... What is this strange number?

It's ok, I don't care the number. But now, I would need the dependencies that are in this page: http://packages.ubuntu.com/oneiric/ffmpeg. I thought they were to be compiled when compiling ffmpeg, but no. I downloaded some of them from the page, but there're some problems when trying to install them... version problems... I can't install them.

Should I compile all of them?

I need ffmpeg 0.8, because a branch of Blender requires it.
I need to compile ffmpeg, because I want to encode in x264.

shreepads
August 13th, 2011, 05:05 AM
Hi

Is there a way of compiling the latest ffmpeg and x264 code but without installing it, so that it is run when needed from command line? Essentially not have to use sudo (other than to install necessary dependencies from the standard repositories).

I am a little worried about affecting other apps that I have installed as a result of doing this and having to deal with apt-get problems. I have done this before for mplayer (like this (http://ubuntuforums.org/showthread.php?t=1637794), to get VDPAU support) so I think there should be a way of doing this.

I'm using 64-bit Lucid (desktop) latest from the standard repositories. Only additions outside the standard repos are PPAs for Handbrake and PiTiVi (gstreamer).

Thanks!
Shreepad

shreepads
August 13th, 2011, 02:14 PM
Please ignore, found the solution here (http://www.unix.com/302530919-post2.html) ...

Had a mix of different size video clips to merge in PiTiVi, which was making an absolute dog's breakfast while resizing.. Looks great with ffmpeg!!


Hi

Is there a way of compiling the latest ffmpeg and x264 code but without installing it, so that it is run when needed from command line? Essentially not have to use sudo (other than to install necessary dependencies from the standard repositories).

I am a little worried about affecting other apps that I have installed as a result of doing this and having to deal with apt-get problems. I have done this before for mplayer (like this (http://ubuntuforums.org/showthread.php?t=1637794), to get VDPAU support) so I think there should be a way of doing this.

I'm using 64-bit Lucid (desktop) latest from the standard repositories. Only additions outside the standard repos are PPAs for Handbrake and PiTiVi (gstreamer).

Thanks!
Shreepad

qyot27
August 13th, 2011, 04:14 PM
Is there a way of compiling the latest ffmpeg and x264 code but without installing it, so that it is run when needed from command line? Essentially not have to use sudo (other than to install necessary dependencies from the standard repositories).

I am a little worried about affecting other apps that I have installed as a result of doing this and having to deal with apt-get problems. I have done this before for mplayer (like this (http://ubuntuforums.org/showthread.php?t=1637794), to get VDPAU support) so I think there should be a way of doing this.
Even though you solved it yourself, for anyone else reading this is the course of action/reasoning needed:

--prefix=$HOME/yourdirectory will cause 'make install' to install the desired package to the 'yourdirectory' directory in $HOME ($HOME, ~/, and /home/username all point to the same place). Because you are installing it to an area of the system that your user has control over, there's no need to use sudo.

If this needs to be linked against other projects that have been installed to $HOME/yourdirectory, you then must specify those with --extra-cflags and --extra-ldflags commands, or in some cases, with PKG_CONFIG_PATH or FFMPEG_CFLAGS or so on. It depends on the programs involved and what their build systems dictate.

Finally, when running those programs which are not on your PATH, you must use ./ (for example, ./ffmpeg or ./x264) when calling them, lest they fail to run.

ron999
August 13th, 2011, 11:16 PM
Hi
In post #1 way back at page 1.
What's the difference between the commands
Part 3:- Get the current source files, compile, and install x264
and
Part 7:- This allows x264 to accept just about any input that FFmpeg...
:confused:

andrew.46
August 14th, 2011, 12:03 AM
If you follow section 7 you will be able to use many different formats as inputs for x264 from the commandline. Which is to say you can input many different containers and codecs, without this x264 is somewhat limited in the containers and formats it will deal with as inputs.

Totally unnecessary if you do not use x264 directly from the commandline. The option will show here:



andrew@skamandros~$ x264 --help | head -n 13
x264 core:116 r2057 0ba8a9c
Syntax: x264 [options] -o outfile infile

Infile can be raw (in which case resolution is required),
or YUV4MPEG (*.y4m),
or Avisynth if compiled with support (no).
or libav* formats if compiled with lavf support (yes) or ffms support (no).
Outfile type is selected by filename:
.264 -> Raw bytestream
.mkv -> Matroska
.flv -> Flash Video
.mp4 -> MP4 if compiled with GPAC support (yes)
Output bit depth: 8 (configured at compile time)


It has been a while since I have looked at L-SMASH integrated x264 but I would guess that one day having an L-SMASH copy + FFmpeg import abilities would substantially increase the value of x264 as a commandline application in its own right.

qyot27
August 14th, 2011, 12:40 AM
It has been a while since I have looked at L-SMASH integrated x264 but I would guess that one day having an L-SMASH copy + FFmpeg import abilities would substantially increase the value of x264 as a commandline application in its own right.
Eh, IMO that depends on one's feelings toward multi-format or singular-format encoders.

Of course, this is also different between Linux and Windows. x264 has supported AviSynth for nearly as long as x264 has been worked on, which is, well, a really long time, development-wise (http://git.videolan.org/?p=x264.git;a=commit;h=29dee22af6b6174f54bb621f103 8c0604a42d21e) (that's revision 161).

Since AviSynth is Windows-only, they're the only ones that got the benefit*; to achieve equivalent functionality on Linux, it was necessary to either A) use an x264-equipped build of FFmpeg, or B) pipe data into x264. LAVF/FFMS2 support was meant to supersede users having to use pipes and to increase x264's possible user friendliness.

*yes, it is fully possible to use AviSynth and a Windows build of x264 in Wine, although you won't be able to use DirectShowSource() or possibly other system-dependent filters. Windows x264 builds actually work better under Wine than they do on Windows, at least as far as I saw when I compared the performance a few years ago.

L-SMASH is primarily an alternative MP4 muxer; the audio encoding support is actually a separate project that gets included in the L-SMASH branch and patch for reasons of convenience.



As Windows users had that input-agnostic functionality for almost 5 years before that, though, that's why I mentioned it. Over there, x264 is typically used by itself (disclaimer for trusting anything online, but it is certainly true when looking at many encoding GUIs: they just call x264 directly and may do external muxing in a subsequent stage). That was true well before LAVF/FFMS2 support, and afterward. LAVF/FFMS2 on Windows really serves more of the purpose of providing multi-format input support for those users that have an aversion to using AviSynth.

andrew.46
August 14th, 2011, 01:03 AM
L-SMASH is primarily an alternative MP4 muxer; the audio encoding support is actually a separate project that gets included in the L-SMASH branch and patch for reasons of convenience.

I was not aware of that, is this the audio branch:

https://github.com/Kovensky/x264-audio/

qyot27
August 14th, 2011, 01:07 AM
I was not aware of that, is this the audio branch:

https://github.com/Kovensky/x264-audio/
Yep, as the 'kaudio' branch on x264_L-SMASH is identical to that repository. I don't know how far along progress is on the audio portions, though.

FakeOutdoorsman
August 14th, 2011, 01:32 AM
Part 7:- This allows x264 to accept just about any input that FFmpeg... :confused:

Yeah... I should probably elaborate that a bit more on the guide to make it more clear, but I probably won't get to it for a few days. I saw the sun today for the first time in three weeks. It's been cloudy.

FakeOutdoorsman
August 14th, 2011, 01:49 AM
I compiled FFMPEG, there wasn't problems. I expected to have version 0.8 of ffmpeg, but now I have N-31831-g931187e version... What is this strange number?
I assume N stands for Michael Niedermayer, the Self-Appointed (I think) FFmpeg Benevolent Dictator For Life (SA-FFbdfl). 31831 is a Subversion style version number indicating that your version of FFmpeg is the 31831th update to the source. g931187e is similar to 31831, and is the shortened Git hash that corresponds to a certain commit.


But now, I would need the dependencies that are in this page: http://packages.ubuntu.com/oneiric/ffmpeg. I thought they were to be compiled when compiling ffmpeg, but no.
Are you using Oneiric already? Compiling FFmpeg as shown in this guide will not create all of these packages shown in your link, but it should provide most of the files that these packages contain. So no, you shouldn't have to install the packages on your link.


Should I compile all of them?
No, because if you followed this guide you probably should already have the necessary files for anything that you're compiling that depends on a recent FFmpeg.


I need ffmpeg 0.8, because a branch of Blender requires it.
What branch? Where are you getting this Blender version?


I need to compile ffmpeg, because I want to encode in x264.
You can also encode with x264 via the repository FFmpeg (or libav as of Natty since Ubuntu dropped FFmpeg for libav) if you install an additional package as shown here:

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

andrew.46
August 14th, 2011, 01:49 AM
I saw the sun today for the first time in three weeks. It's been cloudy.

Come to Australia :)

qyot27
August 14th, 2011, 03:00 AM
I assume N stands for Michael Niedermayer, the Self-Appointed (I think) FFmpeg Benevolent Dictator For Life (SA-FFbdfl). 31831 is a Subversion style version number indicating that your version of FFmpeg is the 31831th update to the source. g931187e is similar to 31831, and is the shortened Git hash that corresponds to a certain commit.
Technically, 31831 is the number of revisions since the N tag. The N tag is assigned to the first commit, hence, the number of commits since the first commit.

To treat it like a Subversion revision, you actually have to add 1, because the method used there - of counting since a tag - means the tag is understood as essentially a 'revision 0', whereas Subversion treats the first revision as 1 (as does using git rev-list to just count the total # of revisions). I actually replace version.sh with a local version that prints the revision info in a way I like better, wherein 'N-31831-g931187e' would change to 'r31832 git-931187e', which I find easier to parse mentally.



Come to Australia :D
I know I'd love to, even if only to escape this blasted heat (http://www.weather.com/weather/today/Saint+Petersburg+FL+USFL0438) (even though I could go to Seattle for that relief too; it's a lot closer - not that I could afford any sort of vacation, though).

andrew.46
August 14th, 2011, 03:39 AM
I know I'd love to, even if only to escape this blasted heat (http://www.weather.com/weather/today/Saint+Petersburg+FL+USFL0438) (even though I could go to Seattle for that relief too; it's a lot closer - not that I could afford any sort of vacation, though).

Hmmm... perhaps you should not come to Australia in summer then :). Temps of 104 Fahrenheit are not that uncommon...

qyot27
August 14th, 2011, 04:06 AM
Hmmm... perhaps you should not come to Australia in summer then :). Temps of 104 Fahrenheit are not that uncommon...
Oh, I'd definitely be sure to make any such trip during the Southern Hemisphere's Fall or Winter. Which works out, because it's roughly the opposite of the Northern Hemisphere's Spring and Summer.

I'd be a reverse snowbird.

spielnicht
August 15th, 2011, 05:24 PM
Please show your command and the complete terminal output. What players did you use? Does it play normally with ffplay?

I played it back with Totem on my linux box and even tried it on my Windows box and my Xoom...all with exact same results.

Command
ffmpeg -i sample.rmvb -acodec libfaac -aq 100 -vcodec libx264 -preset slow -crf 22 -threads 0 sample.mp4

Output
ffmpeg -i sample.rmvb -acodec libfaac -aq 100 -vcodec libx264 -preset slow -crf 22 -threads 0 sample.mp4
ffmpeg version N-31826-gd912e44, Copyright (c) 2000-2011 the FFmpeg developers
built on Aug 12 2011 09:48:35 with gcc 4.5.2
configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
libavutil 51. 11. 1 / 51. 11. 1
libavcodec 53. 10. 0 / 53. 10. 0
libavformat 53. 6. 0 / 53. 6. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 29. 1 / 2. 29. 1
libswscale 2. 0. 0 / 2. 0. 0
libpostproc 51. 2. 0 / 51. 2. 0
[NULL @ 0x33cf560] Unsupported video codec
[rm @ 0x33bd460] max_analyze_duration 5000000 reached at 5063000
Input #0, rm, from 'sample.rmvb':
Metadata:
title :
author :
copyright :
comment :
Duration: 00:43:07.63, start: 0.000000, bitrate: 510 kb/s
Stream #0.0: Audio: cook, 44100 Hz, stereo, s16, 64 kb/s
Stream #0.1: Video: rv40, yuv420p, 700x460, 429 kb/s, 12.05 fps, 12 tbr, 1k tbn, 12 tbc
Stream #0.2: Data: [0][0][0][0] / 0x0000

mysoogal
August 20th, 2011, 11:09 PM
i created this script after installing the latest ffmpeg

this script will encode to Webm,Theora OGG,MP4- with Qt-faststart, and Flash FLV.




#!/bin/bash
DIR=/var/www
find $DIR -type f |
while read i
do

ffmpeg -i "$i" "$i".webm

sleep 5

ffmpeg -i "$i" -y -vcodec libx264 -s qvga -acodec libfaac -ab 96k -ac 2 -b 200K -threads 4 -flags +loop -cmp +chroma -partitions 0 -me_method epzs -subq 1 -trellis 0 -refs 1 -coder 0 -me_range 16 -g 300 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -maxrate 10M -bufsize 10M -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 "$i".mp4

sleep 5

qt-faststart "$i".mp4 "$i".qt.mp4

sleep 5

rm "$i".mp4

sleep 5


ffmpeg -i "$i" -ar 22050 -ab 32 -f flv -s 320x240 "$i".flv

sleep 5

ffmpeg -i "$i" -s 720x576 -aspect 16:9 \
-vcodec libtheora -g 15 -qscale 8 \
-acodec libvorbis -ac 2 -aq 6 \
-sn "$i".ogg
done

mocha
August 21st, 2011, 09:45 AM
Does anyone know if the latest pulls of ffmpeg have x11grab working again? There was a problem recently as far as I know.

FakeOutdoorsman
August 22nd, 2011, 12:19 AM
Looks like it's still not working as expected. I submitted this as a bug report 3 weeks ago (Ticket 373: e35c674d breaks alsa input (https://ffmpeg.org/trac/ffmpeg/ticket/373)), but it's received little attention. I might have to report it to libav as well since the commit that broke this was merged from that project, but I don't like their bug tracker at all and haven't motivated myself to get over that hump yet.

Until it gets fixed you could use the last commit that worked (http://ubuntuforums.org/showpost.php?p=11096593&postcount=151), and/or make a comment on the bug report.

andrew.46
August 27th, 2011, 12:12 AM
Yet another good reason to use the latest FFmpeg with the recent addition of a Windows Media Image decoder (WMVP/WVP2). Details here (http://git.videolan.org/?p=ffmpeg.git;a=commit;h=45ecda855405f102bcc5d8fba dc5f2376e8e9c42). I tested with the following:


wget http://samples.mplayerhq.hu/V-codecs/WMVP/Arlington.wmv

and it all worked very nicely :).

Edit: And the addition is seen also in MPlayer, see screenshot...

vagrale13
August 27th, 2011, 03:59 PM
In some days newer version Ubuntu (Oneiric Ocelot 11.10) will be available and so today i tried to install lastest FFmpeg and x264 on it.
With commands for Natty i think works fine.
I have some warnings to config.log but i don' t know if this is problem
If someone want to see to config.log here

menachem
September 7th, 2011, 01:14 AM
My question: How do I use your instructions to create and install libavcodec as an external codec instead of internal to ffmpeg? Is there a way to accomplish what I want without having to do that?

To explain:

This has probably been discusses in this thread already, but I couldn't find this issue.

I'm running:
Lubuntu - 11:04
Mplayer - 2:1.0~rc4.dfsg1-1ubuntu3+medibuntu1
libavcodec-extra-52 - 4:0.6.2-1ubuntu2+medibuntu1
ffmpeg - latest build following instruction in this thread

I am trying to play this file with mplayer, but it doesn't work: rtsp://rs-au.JewishAudio.org:554/ohr-tmimim/gafne-sz/5760-ki-setse-1.mp3

I get the following error message:
Initiated "audio/X-MP3-DRAFT-00" RTP subsession on port 42884
================================================== ========================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
ADecoder init failed :(
ADecoder init failed :(
Requested audio codec family [mpg123] (afm=mpg123) not available.
Enable it at compilation.
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
Cannot find codec 'mp3float' in libavcodec...
ADecoder init failed :(
ADecoder init failed :(
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
Unknown/missing audio format -> no sound
ADecoder init failed :(
Requested audio codec family [mad] (afm=libmad) not available.
Enable it at compilation.
Opening audio decoder: [acm] Win32/ACM decoders
Loading codec DLL: 'l3codeca.acm'
Loaded DLL driver l3codeca.acm at 640a000
ACM_Decoder: Unappropriate audio format
Could not load/initialize Win32/ACM audio codec (missing DLL file?).
ADecoder preinit failed :(
ADecoder init failed :(
Opening audio decoder: [hwmpa] MPEG audio pass-through (fake decoder)
Cannot sync MPA frame: 0
ADecoder init failed :(
ADecoder init failed :(
Cannot find codec for audio format 0x55.
Audio: no sound
Video: no video


ffplay is able to play the file, here is the information it gives:
ffplay version N-32309-g09c5f99, Copyright (c) 2003-2011 the FFmpeg developers
built on Sep 4 2011 10:31:47 with gcc 4.5.2
configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-libvpx --enable-decoder=mp3float
libavutil 51. 16. 0 / 51. 16. 0
libavcodec 53. 13. 0 / 53. 13. 0
libavformat 53. 11. 0 / 53. 11. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 37. 0 / 2. 37. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0


The way I see it, mplayer is failing because it is using the old, external libavcodec instead of the compiled ffmpeg which uses a newer, internal libavcodec.

However, I can't uninstall the external libavcodec without also uninstalling mplayer, since mplayer depends on libavcodec.

To try and solve this problem I want to compile ffmpeg with libavcodec as an external library, use that to replace the existing library and see if mplayer will use it.


So I figured out that I can add --enable-shared to the ./configure line to make shared libraries.

My question is, how do I run the checkinstall command to make a libavcodec package? Is this even what I need to do to solve this problem?

Any help would be greatly appreciated.

ron999
September 7th, 2011, 01:33 AM
Any help would be greatly appreciated.

Hi
That stream plays OK for me with mPlayer.
I compiled mPlayer using the tutorial here:- http://ubuntuforums.org/showthread.php?t=1542240
This method compiles mPlayer with it's own version of FFmpeg codecs.
Maybe this is the route to follow instead of messing with your own FFmpeg.


MPlayer SVN-r34007-4.5.2 (C) 2000-2011 MPlayer Team

Playing rtsp://rs-au.JewishAudio.org:554/ohr-tmimim/gafne-sz/5760-ki-setse-1.mp3.
Resolving rs-au.JewishAudio.org for AF_INET6...

Couldn't resolve name for AF_INET6: rs-au.JewishAudio.org
Resolving rs-au.JewishAudio.org for AF_INET...
Connecting to server rs-au.JewishAudio.org[75.99.96.252]: 554...

rtsp_session: session can not be established.
STREAM_LIVE555, URL: rtsp://rs-au.JewishAudio.org:554/ohr-tmimim/gafne-sz/5760-ki-setse-1.mp3
Stream not seekable!
file format detected.
Initiated "audio/X-MP3-DRAFT-00" RTP subsession on port 59204
================================================== ========================
Requested audio codec family [mpg123] (afm=mpg123) not available.
Enable it at compilation.
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 16000 Hz, 1 ch, floatle, 32.0 kbit/6.25% (ratio: 4000->64000)
Selected audio codec: [ffmp3float] afm: ffmpeg (FFmpeg MPEG layer-3 audio)
================================================== ========================
[AO OSS] audio_setup: Can't open audio device /dev/dsp: No such file or directory
AO: [alsa] 16000Hz 1ch floatle (4 bytes per sample)
Video: no video
Starting playback...
A: 396.9 (06:36.9) of 0.0 (unknown) 3.4%


MPlayer interrupted by signal 2 in module: play_audio
A: 397.0 (06:36.9) of 0.0 (unknown) 3.4%

Exiting... (Quit)

andrew.46
September 7th, 2011, 01:40 AM
The way I see it, mplayer is failing because it is using the old, external libavcodec instead of the compiled ffmpeg which uses a newer, internal libavcodec.

Mind you I run the latest MPlayer compiled against new internal libavcodec and MPlayer still fails on the stream, hanging indefinitely after the following:



mplayer 'rtsp://rs-au.JewishAudio.org:554/ohr-tmimim/gafne-sz/5760-ki-setse-1.mp3'
MPlayer SVN-r34067-4.5.2 (C) 2000-2011 MPlayer Team
Loading extension-related profile 'extension.mp3'

Playing rtsp://rs-au.JewishAudio.org:554/ohr-tmimim/gafne-sz/5760-ki-setse-1.mp3.
Resolving rs-au.JewishAudio.org for AF_INET6...

Couldn't resolve name for AF_INET6: rs-au.JewishAudio.org
Resolving rs-au.JewishAudio.org for AF_INET...
Connecting to server rs-au.JewishAudio.org[75.99.96.252]: 554...

rtsp_session: session can not be established.
STREAM_LIVE555, URL: rtsp://rs-au.JewishAudio.org:554/ohr-tmimim/gafne-sz/5760-ki-setse-1.mp3
Stream not seekable!
file format detected.
Initiated "audio/X-MP3-DRAFT-00" RTP subsession on port 56308



and the alternative command is not much better:



mplayer 'ffmpeg://rtsp://rs-au.JewishAudio.org:554/ohr-tmimim/gafne-sz/5760-ki-setse-1.mp3'

ron999
September 7th, 2011, 01:54 AM
Mind you I run the latest MPlayer compiled against new internal libavcodec and MPlayer still fails on the stream, hanging indefinitely...
Perhaps it's a geographical reason.
Does it play with ffplay or cvlc?

andrew.46
September 7th, 2011, 02:15 AM
That stream plays OK for me with mPlayer.
I compiled mPlayer using the tutorial here:- http://ubuntuforums.org/showthread.php?t=1542240
This method compiles mPlayer with it's own version of FFmpeg codecs.
Maybe this is the route to follow instead of messing with your own FFmpeg.

Hmmm..... but I follow this tutorial as well and the stream does not play for me :(. Not sure about the geographical issue, plays with FFplay but fails on vlc. Interesting.....

mc4man
September 7th, 2011, 06:59 AM
Hmmm..... but I follow this tutorial as well and the stream does not play for me :(. Not sure about the geographical issue, plays with FFplay but fails on vlc. Interesting.....
See the same here, pretty much as shown by menachem, this is with a couple of different mplayers & mplayer2
Just won't play.

Worst case you could use ffmpeg to grab the stream, either to save & playback at leisure or play while grabbing (give it a min or so headstart, then start player on the .wav or .mp3

ffmpeg to wav wouldn't produce to big a file, maybe about 2MB per min.
Or you could let ffmpeg convert back to mp3 or pipe to lame
Ex.

ffmpeg -i rtsp://rs2.SichosInEnglish.org:554/sie/heritage/01.mp3 heritage-1.wav
or
ffmpeg -i rtsp://rs2.SichosInEnglish.org:554/sie/heritage/01.mp3 -f wav - |lame -V6 - heritage-1.mp3

Another possibility, while not ideal, is to pipe directly from ffmpeg to a player - ex. (maybe there's a way to get vlc to cache a bit?

ffmpeg -i rtsp://rs2.SichosInEnglish.org:554/sie/heritage/01.mp3 -f wav - |vlc -

andrew.46
September 7th, 2011, 08:01 AM
See the same here, pretty much as shown by menachem, this is with a couple of different mplayers & mplayer2
Just won't play.

Glad it is not just me :)

FakeOutdoorsman
September 8th, 2011, 07:01 PM
Wanted: FFmpeg Maintainer for Ubuntu (or Debian)
As of Natty, Ubuntu (and Debian unstable) has switched from FFmpeg to the libav fork. The "ffmpeg" package and binary is available, but it is from libav and not FFmpeg. In my opinion, forcing users to switch to the fork instead of providing both packages for the user to decide what to use was an unfortunate decision.

Currently, as far as I know, FFmpeg is not available for Natty+. See Ubuntu renaming FFmpeg to libav (https://lists.ubuntu.com/archives/technical-board/2011-June/000911.html) for a few more details.

I don't know much about maintaining a package, but I (and the FFmpeg developers) would be glad to offer any help for those interested.

ashwin_cse
September 12th, 2011, 11:52 AM
FFmpeg is a versatile tool to encode and decode a multitude of video and audio formats. x264 encodes high-quality H.264 video.

.....
....
.....

Install x264
3. Get the current source files, compile, and install x264.


cd
git clone git://git.videolan.org/x264
cd x264
./configure --enable-static
make
sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | \
awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes \
--fstrans=no --default



......
.......
.....

Adding lavf support to x264 (optional)
7. This allows x264 to accept just about any input that FFmpeg can handle and is useful if you want to directly use x264.

cd ~/x264
make distclean
./configure --enable-static
make
sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | \
awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes \
--fstrans=no --default
That's it for installation. You can keep the x264, libvpx, and ffmpeg directories in your home directory if you plan on updating later. See Updating FFmpeg and x264 below for more details.

.....
.....



What is the difference between above two steps ? I see only the codec name changed except that we are cd'ing in to the same directory and running the same set of commands (essentially). Since distclean does nothing but clean up previous run of ./configure. So how is it providing new feature by running the same compilation process again and creating and installing the same deb package. Since it says optional and issues as stated above, i choose to skip. If clarification can be provided it will be great.

Thanks,

with regards,
ashwin

ron999
September 12th, 2011, 11:58 AM
What is the difference between above two steps ?
I asked that question in post #1812

qyot27
September 12th, 2011, 01:26 PM
What is the difference between above two steps ? I see only the codec name changed except that we are cd'ing in to the same directory and running the same set of commands (essentially). Since distclean does nothing but clean up previous run of ./configure. So how is it providing new feature by running the same compilation process again and creating and installing the same deb package. Since it says optional and issues as stated above, i choose to skip. If clarification can be provided it will be great.
x264 can use LAVF input if it detects a usable install of FFmpeg. Notice that the first x264 set was issued before compiling FFmpeg, therefore it will not have the option of using LAVF to open files. The later step recompiles x264 after FFmpeg is installed, detecting LAVF automatically.

LAVF input (and FFMS input, if that had been covered) allows the user to give x264 any general video file directly. Any way you look at the steps though, a recompile is going to be necessary somewhere in the process. Either x264 has to be rebuilt (as per this guide), or FFmpeg has to be rebuilt (in cases where the user wants to keep the LAVF and FFMS components streamlined (http://ubuntuforums.org/showpost.php?p=11025444&postcount=1781), and needs a stripped-down version of FFmpeg).

ashwin_cse
September 12th, 2011, 01:56 PM
x264 can use LAVF input if it detects a usable install of FFmpeg. Notice that the first x264 set was issued before compiling FFmpeg, therefore it will not have the option of using LAVF to open files. The later step recompiles x264 after FFmpeg is installed, detecting LAVF automatically.

LAVF input (and FFMS input, if that had been covered) allows the user to give x264 any general video file directly. Any way you look at the steps though, a recompile is going to be necessary somewhere in the process. Either x264 has to be rebuilt (as per this guide), or FFmpeg has to be rebuilt (in cases where the user wants to keep the LAVF and FFMS components streamlined (http://ubuntuforums.org/showpost.php?p=11025444&postcount=1781), and needs a stripped-down version of FFmpeg).

Thanks qyot27 for the beautiful explanation. That clears the air. Thanks.

with regards,
ashwin

ron999
September 12th, 2011, 03:06 PM
Yes, thanks qyot27.
Re-compile x264 again after FFmpeg.
I understand now.:D

FakeOutdoorsman
September 12th, 2011, 07:50 PM
I updated the guide on step 7 with a link to qyot27's explanation. You can give it a try with the most simple of examples:

x264 input.foo -o output.mkv

Some advantages of using this method:

avoids a layer of complexity and potential bugs by encoding directly with x264 instead of through ffmpeg
access to specific x264 options that may be missing in ffmpeg
no more named pipes to feed input to x264


Disadvantages:

slightly more compiling
have to deal with audio and subsequent muxing separately (ignoring stuff like L-SMASH)
lacks many of the filters that are included in ffmpeg

mc4man
September 12th, 2011, 08:33 PM
Wanted: FFmpeg Maintainer for Ubuntu (or Debian)
As of Natty, Ubuntu (and Debian unstable) has switched from FFmpeg to the libav fork. The "ffmpeg" package and binary is available, but it is from libav and not FFmpeg. In my opinion, forcing users to switch to the fork instead of providing both packages for the user to decide what to use was an unfortunate decision.

Currently, as far as I know, FFmpeg is not available for Natty+. See Ubuntu renaming FFmpeg to libav (https://lists.ubuntu.com/archives/technical-board/2011-June/000911.html) for a few more details.

I don't know much about maintaining a package, but I (and the FFmpeg developers) would be glad to offer any help for those interested.
I guess someone could ppa this, though to do so properly they'd need to test current apps that depend on the shared libs & if there are any issues then provide new builds of those apps.

Can't see ubuntu/debian offering anymore than 1 or the other - the last I checked they both use the same names for the libs which if so would be problematic
(I've somewhat stopped paying attention to who uses what, be it a how-to, mplayer, mplayer2 ect. ect.
An interesting conversation may be between a ffmpeg (real) dev and Reinhard Tartler as to the reasons to use libav

(what I did find a pita was that when searching ffmpeg in synaptic no shared libs are found
This is because while libav still uses the 'ffmpeg' name, ffmpeg is not ever mentioned in the lib descriptions

prupert
September 14th, 2011, 12:15 AM
Hi

Just a little note for anyone interested, my little install / update script, that handily automates fakeoutdoorsman's awesomeness here is finally getting a major update, so it follows the current guide.

It also combines the install and update scripts into one and also has it's own (very basic) auto-update function.

The new version can be found here in the next couple of days:

http://code.google.com/p/x264-ffmpeg-up-to-date/

prupert
September 15th, 2011, 12:01 AM
And just another little update to say the new script has now been released: http://code.google.com/p/x264-ffmpeg-up-to-date/

It supports:

Natty, Maverick, Lucid, Hardy
Initial install and subsequent updates all in one script
Ability to check and then update the script if there is a new version available
A basic config file so it can be run with no user interaction via cron


I'll be adding a new feature (hopefully tomorrow) so it will only download and build from source if git says there is a newer version.

I'll try to keep this version updated, but as it took me a year to update the old version, due to work and kids, don't hold your breath.

FakeOutdoorsman
September 15th, 2011, 12:33 AM
Thanks for the update. I haven't tried the script myself, but you may want to consider adding --depth 1 to your FFmpeg git command such as:

git clone --depth 1 git://git.videolan.org/ffmpeg
From man git-clone:

--depth <depth>
Create a shallow clone with a history truncated to the specified number of revisions. A shallow repository has a number of limitations (you cannot clone or fetch from it, nor push from nor into it), but is adequate if you are only interested in the recent history of a large project with a long history, and would want to send in fixes as patches.
This would currently create a ~40 MB ffmpeg directory, but if --depth 1 is omitted it would end up ~80 MB.

I debated adding it to this guide, but once in a while a checkout to a specific commit is suggested to avoid bugs and I don't think that can be done with such a shallow clone. I think it would be fine for most users though. I wish I was more familiar with Git. Indecision...

ShodanjoDM
September 15th, 2011, 12:42 AM
Pardon my curiousity - and maybe I should appologize for not reading the whole thread first to find whether this was asked before or not.

From a complete newbie's perspective (regarding video encoder/decoder stuff), is there any visible differences in playback quality between using standard packages and compiling them yourself?

Like maybe reducing video artifacts or smoother color gradation and so on?

FakeOutdoorsman
September 15th, 2011, 01:24 AM
Short answer: it depends. Most users probably wouldn't notice a difference, but of course it depends on what the user is doing. However, compiling the latest source can add new features, fix bugs (and introduce new bugs), and is customizable to your needs.

If you're using ffmpeg by itself and doing a lot of encoding (especially with a more modern and developmentally active encoder such as x264), then you may want to compile. Or if you're experiencing a known bug the newest source may already contain a fix.

If you're using something from the repository that depends on ffmpeg, then you'll want to stick with that. Of course you could have both the repo ffmpeg and a new compiled one, but that would require a few simple changes to the guide.

Note that Ubuntu doesn't use ffmpeg (the binary) from FFmpeg (the project) anymore as of Natty. The maintainer switched to libav which is a recent fork of FFmpeg.

ShodanjoDM
September 15th, 2011, 02:49 PM
Thank you.

I'm planning to upgrade my DSLR to a more capable one with HD video capability so I'll have to learn about video editing and encoding when the time comes. But I think I'll stick with prebuild packages from the repository for now.

prupert
September 15th, 2011, 10:31 PM
Thanks for the update. I haven't tried the script myself, but you may want to consider adding --depth 1 to your FFmpeg git command such as:

git clone --depth 1 git://git.videolan.org/ffmpeg
From man git-clone:

This would currently create a ~40 MB ffmpeg directory, but if --depth 1 is omitted it would end up ~80 MB.

I debated adding it to this guide, but once in a while a checkout to a specific commit is suggested to avoid bugs and I don't think that can be done with such a shallow clone. I think it would be fine for most users though. I wish I was more familiar with Git. Indecision...

I can see the advantage, but if it risks causing the occasional issue, it might be worth avoiding it. Plus, since the user is already building from source, which takes quite a while, and with the fast download speeds available these days, I think it best to leave as is for now.

However, if you add it to your instructions, I'll add it to my script;)

Dmole
September 16th, 2011, 10:42 PM
{{{
# git clone git://review.webmproject.org/libvpx
Initialized empty Git repository in /opt/libvpx/libvpx/.git/
review.webmproject.org[0: 140.211.167.235]: errno=Connection timed out
fatal: unable to connect a socket (Connection timed out)
}}}

vs

{{{
#git clone http://git.chromium.org/webm/libvpx.git
Initialized empty Git repository in /opt/libvpx/libvpx/.git/
remote: Counting objects: 12138, done.
remote: Compressing objects: 100% (2573/2573), done.
remote: Total 12138 (delta 9435), reused 12101 (delta 9415)
Receiving objects: 100% (12138/12138), 3.89 MiB | 504 KiB/s, done.
Resolving deltas: 100% (9435/9435), done.
}}}

andrew.46
September 16th, 2011, 11:04 PM
Perhaps try a snapshot:


wget http://webm.googlecode.com/files/libvpx-v0.9.7-p1.tar.bz2

mc4man
September 17th, 2011, 01:04 AM
{{{
# git clone git://review.webmproject.org/libvpx
vs
#git clone http://git.chromium.org/webm/libvpx.git

see here -
http://www.webmproject.org/code/

FakeOutdoorsman
September 17th, 2011, 06:45 AM
Thanks Dmole for letting me know and mc4man for the new URL. I updated the guides. The link mc4man provides mentions that the new URL should be changed in your local clone by editing ~/libvpx/.git/config, but I prefer:

cd ~/libvpx
git config remote.origin.url http://git.chromium.org/webm/libvpx.git
...which should update it for you.

andrew.46
September 17th, 2011, 10:20 PM
Soon this guide will hit the big one:


Views: 994,283

Incredible work FakeOutdoorsman!!!

prupert
September 17th, 2011, 10:35 PM
Soon this guide will hit the big one:



Incredible work FakeOutdoorsman!!!

Seconded, and if we all do the same, it will get there a hell of a lot quicker ;)

Amazed there isn't a built in ability within FFmpeg to do this, given how it is so often updated. But, hey, that's where my script fits in ;)

CLAROX
September 22nd, 2011, 06:40 PM
Great guide. Thanks a lot. One problem

When I configure FFMPEG I get the error:



libavcodec/libavcodec.a(libx264.o): In function `X264_frame':
/home/******/ffmpeg/libavcodec/libx264.c:128: undefined reference to `x264_picture_init'
libavcodec/libavcodec.a(libx264.o): In function `X264_init':
/home/******/ffmpeg/libavcodec/libx264.c:259: undefined reference to `x264_param_default_preset'
/home/******/ffmpeg/libavcodec/libx264.c:465: undefined reference to `x264_param_apply_fastfirstpass'
/home/******/ffmpeg/libavcodec/libx264.c:468: undefined reference to `x264_param_apply_profile'
/home/******/ffmpeg/libavcodec/libx264.c:503: undefined reference to `x264_encoder_open_118'
collect2: ld returned 1 exit status
make: *** [ffmpeg_g] Error 1

x264 ok but ffmpeg ......


thanks......

|Anthony|
September 23rd, 2011, 01:20 PM
@prupert


Hi

Just a little note for anyone interested, my little install / update script, that handily automates fakeoutdoorsman's awesomeness here is finally getting a major update, so it follows the current guide.

It also combines the install and update scripts into one and also has it's own (very basic) auto-update function.

The new version can be found here in the next couple of days:

http://code.google.com/p/x264-ffmpeg-up-to-date/

when i run:

sudo sh ffmpegupdate.shi get this error:

386: Syntax error: "(" unexpected (expecting "}")The corresponding line in your script is:

DISTRO=( $(cat /etc/lsb-release | grep CODE | cut -c 18-) )I assume that it will fault at every similar line in your script. (there are other instances like that)

What to do?
I don't want to go hacking up your code if it works for everyone but me lol.

I should also mention that i modified something, not sure if what i did caused the error, or if it was even needed but here it is:

From:

apt-get -y install nasm build-essential git-core checkinstall yasm texi2html libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libvorbis-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev 2>> $LOG >> $LOG
To:

apt-get -y install nasm build-essential git-core checkinstall yasm texi2html libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libvorbis-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libpostproc-dev libswscale-dev 2>> $LOG >> $LOG

And

From:

./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab --enable-libmp3lame 2>> $LOG >> $LOG
To:

./configure --enable-vdpau --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-avfilter --enable-avfilter-lavf --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libx264 --enable-runtime-cpudetect --enable-libxvid --enable-x11grab --enable-postproc --enable-swscale --enable-libmp3lame 2>> $LOG >> $LOG

FakeOutdoorsman
September 23rd, 2011, 07:28 PM
Soon this guide will hit the big one:

Incredible work FakeOutdoorsman!!!
Thanks! Although half of those numbers are probably me, and your contributions have been much appreciated.


Great guide. Thanks a lot. One problem

When I configure FFMPEG I get the error:



libavcodec/libavcodec.a(libx264.o): In function `X264_frame':
/home/******/ffmpeg/libavcodec/libx264.c:128: undefined reference to `x264_picture_init'
libavcodec/libavcodec.a(libx264.o): In function `X264_init':
/home/******/ffmpeg/libavcodec/libx264.c:259: undefined reference to `x264_param_default_preset'
/home/******/ffmpeg/libavcodec/libx264.c:465: undefined reference to `x264_param_apply_fastfirstpass'
/home/******/ffmpeg/libavcodec/libx264.c:468: undefined reference to `x264_param_apply_profile'
/home/******/ffmpeg/libavcodec/libx264.c:503: undefined reference to `x264_encoder_open_118'
collect2: ld returned 1 exit status
make: *** [ffmpeg_g] Error 1

x264 ok but ffmpeg ......


thanks......
This probably means that you have two versions of x264 installed at the same time in two different locations. It's actually a good thing that FFmpeg is complaining, because otherwise it could use the incorrect x264. Remove the old x264 (which could possibly be the libx264-dev package from the repository) and try again.

prupert
September 24th, 2011, 10:09 AM
@prupert



when i run:

sudo sh ffmpegupdate.shi get this error:

386: Syntax error: "(" unexpected (expecting "}")The corresponding line in your script is:

DISTRO=( $(cat /etc/lsb-release | grep CODE | cut -c 18-) )I assume that it will fault at every similar line in your script. (there are other instances like that)

What to do?
I don't want to go hacking up your code if it works for everyone but me lol.

I should also mention that i modified something, not sure if what i did caused the error, or if it was even needed but here it is:

From:

apt-get -y install nasm build-essential git-core checkinstall yasm texi2html libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libvorbis-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev 2>> $LOG >> $LOG
To:

apt-get -y install nasm build-essential git-core checkinstall yasm texi2html libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libvorbis-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libpostproc-dev libswscale-dev 2>> $LOG >> $LOG

And

From:

./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab --enable-libmp3lame 2>> $LOG >> $LOG
To:

./configure --enable-vdpau --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-avfilter --enable-avfilter-lavf --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libx264 --enable-runtime-cpudetect --enable-libxvid --enable-x11grab --enable-postproc --enable-swscale --enable-libmp3lame 2>> $LOG >> $LOG

Hmm, I don't get that when I run it and others have reported it working, so I guess it is down to the modifications you have made. I am looking at a way to allow users to add the kind of additional config options like you have, but in a slightly easier way to reduce the chance of breaking the script.

Can you post the modified version of the script here or on the google code site and I will have a look.

|Anthony|
September 24th, 2011, 02:28 PM
@prupert

I listed all modifications that i made in my post. Here is the modified script in it's entirety:
https://docs.google.com/leaf?id=0B8_ebxl7goQtNmZmZmMzMWMtMDcwZi00YjQ3LWI4O TAtMTVmNWYxZjRiMWQ3&hl=en_US
If you would like to add me as a member to your code.google project, i could upload it there.

A user-friendly front end to your script could be to write it using zenity ;) Let me know if you would like some assistance making the modifications to have a zenity front end.

prupert
September 24th, 2011, 03:17 PM
@prupert

I listed all modifications that i made in my post. Here is the modified script in it's entirety:
https://docs.google.com/leaf?id=0B8_ebxl7goQtNmZmZmMzMWMtMDcwZi00YjQ3LWI4O TAtMTVmNWYxZjRiMWQ3&hl=en_US
If you would like to add me as a member to your code.google project, i could upload it there.

A user-friendly front end to your script could be to write it using zenity ;) Let me know if you would like some assistance making the modifications to have a zenity front end.

Cool, I'll check your version out.

You don't need to be a member of my project to post comments on google code, just use your google login.

I did consider providing a zenity interface, but as the script makes some potentially big changes to your system, I wanted it to be a little daunting for those who know nothing of the command line, so they knew the seriousness of what they were doing. Giving sudo access to a script that they got off the internet is not always the best idea, though in this case it is. Hence, it is terminal only (thus you can also schedule it via cron).

FakeOutdoorsman
September 26th, 2011, 06:13 AM
Added a lossless H.264 encoding example for anyone who wants to monkey with that.

vagrale13
September 26th, 2011, 08:32 AM
@FakeOutdoorsman (http://ubuntuforums.org/member.php?u=162846)
I think in the end of first post (http://ubuntuforums.org/showpost.php?p=4907079&postcount=1)

Recent Updates


2011-10-25: (Natty/Maverick) Add lossless H.264 encoding example

you mean 2011-09-25 :popcorn:

FakeOutdoorsman
September 26th, 2011, 06:46 PM
Thanks. Fixed. I wasn't sure if anyone actually read that section.

FakeOutdoorsman
September 26th, 2011, 09:30 PM
The lossless presets have been removed upstream. They were out of date and slow.

The old way:

ffmpeg -i input -vcodec libx264 -vpre lossless_ultrafast -threads 0 output

The new way:

ffmpeg -i input -vcodec libx264 -preset ultrafast -crf 0 -threads 0 output
or

ffmpeg -i input -vcodec libx264 -preset ultrafast -qp 0 -threads 0 output
Either one should give the same result. If you used the old lossless_max preset the equivalent would be -preset veryslow -crf 0.

|Anthony|
September 29th, 2011, 11:34 PM
@prupert

Did you find any errors?

Pithikos
October 5th, 2011, 01:41 AM
Thanks a lot for the script! It saved my **** from headaches! :P

Just in case someone is running Mint Ubuntu you have to edit two variables in the scripts.
Just under:

DISTRO=( $(cat /etc/lsb-release | grep CODE | cut -c 18-) )Add:

DISTRO="natty";(or whatever version of Ubuntu your Mint corresponds to)

And under:

DISTRIB=( $(cat /etc/lsb-release | grep ID | cut -c 12-) )Add:

DISTRIB="Ubuntu";

gregburnham
October 5th, 2011, 08:04 PM
Ok, so I've run the script and everything works, but when I do:

ffmpeg -codecs

I get (with a bunch of other stuff)

D V D h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10

I want to encode to H.264, is that possible?

Thank,
Greg

ron999
October 5th, 2011, 08:24 PM
Ok, so I've run the script and everything works, but when I do:

ffmpeg -codecs

I get (with a bunch of other stuff)

D V D h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10

I want to encode to H.264, is that possible?

Thank,
Greg
Hi
If this is on the list you can:-
EV libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10

gregburnham
October 5th, 2011, 09:19 PM
Hi
If this is on the list you can:-
EV libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10

Sadly, that is not on the list - how can I enable encoding to H.264?

andrew.46
October 5th, 2011, 09:40 PM
Could you show the full output of:


ffmpeg -codecs | grep libx264

This should give a few hints as to the problem...

gregburnham
October 5th, 2011, 09:57 PM
ffmpeg version N-33294-gf9bd979, Copyright (c) 2000-2011 the FFmpeg developers
built on Oct 5 2011 12:02:17 with gcc 4.4.3
configuration:
libavutil 51. 19. 0 / 51. 19. 0
libavcodec 53. 19. 0 / 53. 19. 0
libavformat 53. 14. 0 / 53. 14. 0
libavdevice 53. 4. 0 / 53. 4. 0
libavfilter 2. 43. 6 / 2. 43. 6
libswscale 2. 1. 0 / 2. 1. 0

gregburnham
October 5th, 2011, 10:10 PM
Hold the horses, stop the presses and call off the search party. I changes the configure options, recompiled and it looks like it'll work!

Thanks for the feedback!!

andrew.46
October 5th, 2011, 10:17 PM
I changes the configure options, recompiled and it looks like it'll work!

Great news :). Your full output should now look something like this:



andrew@skamandros~$ ffmpeg -codecs | grep libx264
ffmpeg version N-33293-gec1ffae, Copyright (c) 2000-2011 the FFmpeg developers
built on Oct 5 2011 17:33:24 with gcc 4.5.2
configuration: --prefix=/usr --mandir=/usr/man --enable-postproc --enable-avfilter --enable-pthreads --enable-shared --disable-static --disable-ffserver --enable-libvorbis --enable-libmp3lame --enable-libx264 --enable-libfaac --enable-libvpx --enable-zlib --enable-libxvid --enable-libfreetype --enable-x11grab --enable-nonfree --enable-gpl --enable-version2
libavutil 51. 19. 0 / 51. 19. 0
libavcodec 53. 19. 0 / 53. 19. 0
libavformat 53. 14. 0 / 53. 14. 0
libavdevice 53. 4. 0 / 53. 4. 0
libavfilter 2. 43. 6 / 2. 43. 6
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
EV libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10

andrew.46
October 6th, 2011, 09:31 PM
I have failed while attempting to copy metadata from input file to output file with the latest FFmpeg. Has anybody had success with this? For example:



andrew@skamandros~/music/Bartók_4tets$ ffmpeg -i Bartók_4tet_1.ogg -map_metadata 0:0 test.flac
ffmpeg version N-33293-gec1ffae, Copyright (c) 2000-2011 the FFmpeg developers
built on Oct 5 2011 17:33:24 with gcc 4.5.2
configuration: --prefix=/usr --mandir=/usr/man --enable-postproc --enable-avfilter --enable-pthreads --enable-shared --disable-static --disable-ffserver --enable-libvorbis --enable-libmp3lame --enable-libx264 --enable-libfaac --enable-libvpx --enable-zlib --enable-libxvid --enable-libfreetype --enable-x11grab --enable-nonfree --enable-gpl --enable-version2
libavutil 51. 19. 0 / 51. 19. 0
libavcodec 53. 19. 0 / 53. 19. 0
libavformat 53. 14. 0 / 53. 14. 0
libavdevice 53. 4. 0 / 53. 4. 0
libavfilter 2. 43. 6 / 2. 43. 6
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
Input #0, ogg, from 'Bartók_4tet_1.ogg':
Duration: 00:29:04.40, start: 0.000000, bitrate: 186 kb/s
Stream #0:0: Audio: vorbis, 44100 Hz, stereo, s16, 192 kb/s
Metadata:
TITLE : String Quartet no.1 op.7 (1908-1909)
ARTIST : Emerson String Quartet
ALBUM : Béla Bartók - 6 String Quartets
Invalid metadata type 0.


I suspect I am missing something basic here and I was keen to display my ignorance here rather on ffmpeg-users :).

FakeOutdoorsman
October 7th, 2011, 02:16 AM
I would call it either a syntax change or a regression because this works on a previous revision. I didn't get to investigate it thoroughly however.

FFmpeg should automatically attempt to copy metadata from the input to the output, IIRC. I'm not sure how long this has been the default.

In an unrelated side-note I failed to notice for some time that -threads 0 appears to be on by default with libx264, so I updated the example commands.

andrew.46
October 7th, 2011, 09:57 PM
Oh well I shall retreat to my little script that adds the metadata in combination with FFmpeg. Certainly ogg to flac does not work with metadata transfer, I have not tested other audio codecs.

FakeOutdoorsman
October 9th, 2011, 08:51 PM
Looks like this is the commit that changed things:

ffmpeg: make -map_metadata work consistently with the other options (http://git.videolan.org/?p=ffmpeg.git;a=commit;h=5a9e42ec45df40c565aced708 0e2f9933d914c80)

FakeOutdoorsman
October 11th, 2011, 02:57 AM
Today at #ffmpeg-devel:

@michaelni | -vf 'scale=256:256,mp=geq=st(0\,0)+st(1\,0)+st(2\,0)+w hile(lt(hypot(st(3\,2*ld(0)*ld(1)+Y/100-1.3)\,st(0\,ld(0)^2-ld(1)^2+X/100-1.7)+0*st(1\,ld(3)))\,2)*lt(ld(2)\,260)\,st(2\,ld( 2)+10)):128:128'
Which I suppose can be played back with (there is probably a better way, but I'm supposed to be working now):

ffplay -f lavfi 'color=black,scale=256:256,mp=geq=st(0\,0)+st(1\,0 )+st(2 \
\,0)+while(lt(hypot(st(3\,2*ld(0)*ld(1)+Y/100-1.3)\,st(0\,ld(0)^2-ld(1)^2+X \
/100-1.7)+0*st(1\,ld(3)))\,2)*lt(ld(2)\,260)\,st(2\,ld( 2)+10)):128:128'

Update: Another one: [FFmpeg-cvslog] eval:add hypot() (http://ffmpeg.org/pipermail/ffmpeg-cvslog/2011-October/041637.html)

-vf 'scale=256:256,mp=geq=random(1)/hypot(X-cos(N*0.07)*W/2-W/2\,Y-sin(N*0.09)*H/2-H/2)^2*1000000*sin(N*0.02):128:128'

FakeOutdoorsman
October 15th, 2011, 02:19 AM
Updated the guide for Ubuntu Oneiric Ocelot 11.10. Other changes:
Added --depth 1 to the FFmpeg git command. This will create a "shallow" local repository of about half the total file size, but a user won't be able to git checkout to a specific commit. I don't think many users do this so it should be fine for most users. See git help clone for a better explanation.

Removed libxvidcore-dev. Does anyone use this anymore? The native encoder (mpeg4) seems fairly comparable to me.

qyot27
October 15th, 2011, 07:00 AM
Hahaha, apparently FFMS2 is in the repositories (http://packages.ubuntu.com/search?keywords=ffms2&searchon=names&suite=all&section=all). Why didn't I realize this during the Natty cycle?

Just a funny coincidence I guess, although if instructions for it were to be added it would make more sense for it to be more up-to-date than r473 (SVN is at r578 right now), and whatever strange things might happen with the repo version being a shared, rather than static, library.

I still have yet to build anything on Oneiric; too busy messing with getting the DE kinks worked out.

videox
October 15th, 2011, 01:40 PM
how do i do this on my mac

Your version of ffmpeg located at /usr/local/bin/ffmpeg doesn't support AAC audio or H264 video.
You need to upgrade your ffmpeg software

stressat
October 16th, 2011, 04:08 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) ???

I solved it:
ffmpeg -f alsa -i pulse -f fbdev -i /dev/fb0 -r 30 video-output.avi

1- Must be put vga=792 to the end of kernel line in /boot/grub/menu.lst ( /boot/grub/grub.conf )
2- Works fine with fbterm and screen.

http://www.youtube.com/watch?feature=player_embedded&v=NGPVYbL5VKQ :P

superadu
October 20th, 2011, 05:02 PM
Hi

When I tried installing x264 by the above commands I am getting the following error after performing make on x264

input/timecode.o: In function `open_file':
timecode.c.text+0x615): undefined reference to `cli_input'
timecode.c.text+0x623): undefined reference to `cli_input'
timecode.c.text+0x62b): undefined reference to `cli_input'
timecode.c.text+0x633): undefined reference to `cli_input'
timecode.c.text+0x63b): undefined reference to `cli_input'
input/timecode.o:timecode.c.text+0x643): more undefined references to `cli_input' follow
collect2: ld returned 1 exit status
make: *** [x264] Error 1

How can I fix this?

Thanks

andrew.46
October 21st, 2011, 11:07 PM
I personally build my copy of FFmpeg with:



--disable-avconv


as it seems that Libav developers will eventually move further away from FFmpeg. Will this guide eventually adopt this option or are the waters a little too muddy at this stage to decide?

FakeOutdoorsman
October 22nd, 2011, 12:27 AM
How can I fix this?
I can't duplicate your error in Oneiric. Did you make any modifications to the guide? What version of Ubuntu are you using?


I personally build my copy of FFmpeg with:



--disable-avconv


as it seems that Libav developers will eventually move further away from FFmpeg. Will this guide eventually adopt this option or are the waters a little too muddy at this stage to decide?
Good question. Does including avconv introduce any issues for you?

andrew.46
October 22nd, 2011, 03:26 AM
Good question. Does including avconv introduce any issues for you?

No, it simply installs a binary and set of man pages that I will never use as well as reminding me too much of the crazy FFmpeg and Libav split :(.

superadu
October 23rd, 2011, 04:05 PM
I can't duplicate your error in Oneiric. Did you make any modifications to the guide? What version of Ubuntu are you using?


No I did not make any modifications to the guide.
I am using Ubuntu Maverick 10.10 which is on my work machine.

I have Lucid Lynx 10.04 on my laptop and your guide works fine on that but somehow it fails on my workstation

~Drü
October 24th, 2011, 03:12 AM
I'm trying watch something here and keep receving this message:

Could not find GStreamer caps mapping for FFmpeg codec 'h264', and you are using an external libavcodec. This is most likely due to a packaging problem and/or libavcodec having been upgraded to a version that is not compatible with this version of gstreamer-ffmpeg. Make sure your gstreamer-ffmpeg and libavcodec packages come from the same source/repository.

i'm using Ubuntu Oneiric Ocelot 11.10.

andrew.46
October 25th, 2011, 11:02 PM
Looks like a wma lossless decoder is on the horizon (http://git.videolan.org/?p=ffmpeg.git;a=commit;h=123b1fac5c0a18061d7fa9a78 69e537e81d16506), hopefully not too long now...

FakeOutdoorsman
October 26th, 2011, 12:01 AM
Looks like a wma lossless decoder is on the horizon (http://git.videolan.org/?p=ffmpeg.git;a=commit;h=123b1fac5c0a18061d7fa9a78 69e537e81d16506), hopefully not too long now...

Ut Video decoding is a recent addition. This is a lossless codec good for use in editors because it seeks fairly quickly. Ut Video is also actively developed which is always good. I might recommend this codec for my Windows friends who use Adobe Premiere.

andrew.46
October 26th, 2011, 12:26 AM
Ut Video decoding is a recent addition

I sometimes wish that my old friend MPLayer was developed as enthusiastically :(. Found some UT Video samples here (http://ffmpeg.org/trac/ffmpeg/ticket/534). Mind you the name of the gentleman who wrote this ticket looks familiar so I suspect you may have seen these samples before :).

prupert
October 26th, 2011, 08:37 PM
A script I have written using the instructions here is erroring out on Lucid, with an issue with yasm, saying it is too old, see logs here:


Initialized empty Git repository in /usr/local/src/x264/.git/
Found yasm 0.8.0.2194
Minimum version is yasm-1.0.0
If you really want to compile without asm, configure with --disable-asm.
Makefile:3: config.mak: No such file or directory
./configure
Found yasm 0.8.0.2194
Minimum version is yasm-1.0.0
If you really want to compile without asm, configure with --disable-asm.
make: *** [config.mak] Error 1

Any ideas? Obviously I can use --disable-asm from x264, but it looks like according to the instructions for Lucid this shouldn't be an issue.

ron999
October 26th, 2011, 09:55 PM
Any ideas? Obviously I can use --disable-asm from x264, but it looks like according to the instructions for Lucid this shouldn't be an issue.

Hi
I had this problem when I was using Lucid.
Something changed with x264, so yasm-0.8.0 isn't accepted now.
Need to compile yasm-1.1.0

This is the method I used:-


sudo apt-get install build-essential checkinstall


sudo apt-get build-dep yasm


wget http://www.tortall.net/projects/yasm/releases/yasm-1.1.0.tar.gz && \
tar -xf yasm-1.1.0.tar.gz && cd yasm-1.1.0 && ./configure


make


sudo checkinstall --pakdir "$HOME/Desktop" --pkgname yasm --pkgversion 1.1.0 \
--backup=no --default

FakeOutdoorsman
October 26th, 2011, 10:32 PM
Thanks for the update. I haven't tested Lucid for a long time. I updated the Lucid guide with Yasm instructions that I copied from the Hardy version of the guide. I then tested it and everything compiled just fine.

ndejonge
October 26th, 2011, 11:35 PM
Just now did everything in the first post of this thread.

Ubuntu version 11.10:

- - - - - - - - - -
norbert@ren:~$ grep DISTRIB_RELEASE /etc/lsb-release
DISTRIB_RELEASE=11.10
- - - - - - - - - -

Running into a video_size problem:

- - - - - - - - - -
norbert@ren:~$ ffmpeg -s 100x100 -f alsa -ac 2 -i pulse -f x11grab -r 25 -i :0.0+100,100 -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0 output.mkv
ffmpeg version git-2011-10-26-7d7e302, Copyright (c) 2000-2011 the FFmpeg developers
built on Oct 26 2011 23:53:17 with gcc 4.6.1
configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
libavutil 51. 22. 0 / 51. 22. 0
libavcodec 53. 23. 0 / 53. 23. 0
libavformat 53. 17. 0 / 53. 17. 0
libavdevice 53. 4. 0 / 53. 4. 0
libavfilter 2. 45. 0 / 2. 45. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
Option video_size not found.
- - - - - - - - - -

Also tried --video_size and -video_size.
No success.

FakeOutdoorsman
October 27th, 2011, 12:43 AM
Your command is attempting to apply the -s option to your pulse input. Note that the placement of your options will determine which input(s) and oututs(s) they will be applied. Try moving -s so it applies to your video input:

ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 25 -s 100x100 -i :0.0+100,100 -acodec pcm_s16le -vcodec libx264 -preset ultrafast -crf 0 output.mkv
Other changes in this example:

-threads 0 is now default with libx264, so I removed it.
-vpre has been depreciated for -preset with libx264.
lossless encoding is now achieved by using a "normal" preset with the addition of -crf 0 or -qp 0 (this applies for 8-bit encoding; 10-bit is probably different).

ndejonge
October 27th, 2011, 12:45 AM
Thanks, works now.

FakeOutdoorsman
October 29th, 2011, 12:27 AM
Apple Lossless Audio Codec (ALAC) is now open source under the Apache 2.0 license. Here's how to compile alacconvert.

1. Install some build dependencies:

sudo apt-get install build-essential checkinstall subversion

2. Get the source files with subversion:

svn co http://svn.macosforge.org/repository/alac/trunk alacconvert

3. Get a patch and apply it [1]:

wget https://aur.archlinux.org/packages/al/alacconvert/alacconvert.tar.gz
tar xzvf alacconvert.tar.gz
cd alacconvert/convert-utility
patch -Np0 -i ../move-lflags.patch


4. Compile and install:

make
sudo checkinstall --pkgname=alacconvert --pkgversion="$(LANG=C svn info | grep Revision | \
awk '{ print $NF }')-svn" --backup=no --deldoc=yes --fstrans=no --default \
install -D alacconvert /usr/local/bin/alacconvert

5. Usage. To encode:

alacconvert input.wav output.caf
To decode:

alacconvert input.caf output.wav

I'd be interested to know if there is an alternative method of getting alacconvert to compile without the patch. I expect FFmpeg to eventually utilize libalac which would then make alacconvert redundant in my opinion.

[1] Patch credit: http://mtakagi.tumblr.com/post/12027648706/apple-lossless-audio-codec-freebsd

andrew.46
October 29th, 2011, 03:21 AM
I'd be interested to know if there is an alternative method of getting alacconvert to compile without the patch.

It is a little ugly but the following does the same as the patch:



sed -i_bak 's/$(CC) $(LFLAGS) $(OBJS) -o alacconvert/$(CC) $(OBJS) -o alacconvert $(LFLAGS)/' makefile


Should be a neater way to do this though....

FakeOutdoorsman
October 29th, 2011, 03:47 AM
Thanks for the sed solution, but I was revealing my ignorance of LFLAGS because I was wondering if the patch is really the best solution to it not compiling correctly. I found the patch here: Apple Lossless Audio Codec ためしに FreeBSD でビルドしてみたら makefile を少し修正するだけでビルドできてしまってつまらなかった。 (http://mtakagi.tumblr.com/post/12027648706/apple-lossless-audio-codec-freebsd)

However, maybe your sed method would be good for the Arch Linux PKGBUILD, but then I couldn't conveniently borrow the patch file for this thread.

andrew.46
October 29th, 2011, 06:26 AM
Hmmm... I am not sure. I crafted a beautifully detailed ticket at the apple site:

http://alac.macosforge.org/trac/newticket

but the ticket would not submit with a bunch of python errors on the remote site :(. Should keep the complaints down anyway if bugs cannot be submitted!

FakeOutdoorsman
October 29th, 2011, 06:53 PM
I was wondering why there were no bugs. Perhaps a message to ealdrich at apple would prod them into fixing it.

In other news, FFmpeg now has a ProRes encoder (http://git.videolan.org/?p=ffmpeg.git;a=commit;h=70bab5847e12e50f9095e9761 0c3454a934d4039).

andrew.46
October 29th, 2011, 10:52 PM
I was wondering why there were no bugs. Perhaps a message to ealdrich at apple would prod them into fixing it.

I have mixed feelings about pursuing it too much further: the encoder produces files that I have yet been unable to play with any media software available to me, there is a compile problem, the bug-reporting mechanism is broken....

Mguel
October 30th, 2011, 03:37 AM
Hi, great guide, thanks FakeOutdoorsman.

But I had one problem which prevent me from getting ffmpeg installed.

On the step:
$ hash x264 ffmpeg ffplay ffprobe
I get error messages:
bash: hash: ffmpeg: not found
bash: hash: ffplay: not found
bash: hash: ffprobe: not found

Something similiar it seams that happened to http://ubuntuforums.org/showpost.php?p=10134997&postcount=1388 but he didn't post again.

I checked as suggested for him:
$ echo $SHELL
and get:
/bin/bash

If I run:
$ ffmpeg -version
I get:
The program 'ffmpeg' is currently not installed. You can install it by typing:
sudo apt-get install ffmpeg


BTW I'm using Lubuntu 11.10, so maybe it has something to do with being a more lightweight ubuntu

I would appreciate any help, thanks!

Mguel
October 30th, 2011, 05:28 PM
Or is it a way to do manually what hash command is supposed to do?

Searching on google for hash man, it states it:
Remember the full pathnames of commands specified as name arguments, so they need not be searched for on subsequent invocations.


Maybe create a link from /usr/bin to the place where it was downloaded/compiles ~/ffmpeg or move the executable there?

FakeOutdoorsman
October 30th, 2011, 09:19 PM
...I have yet been unable to play with any media software available to me...
I noticed this after I made the guide, unfortunately. So much for realtime, crappily tested guide writing...


Hi, great guide, thanks FakeOutdoorsman.

But I had one problem which prevent me from getting ffmpeg installed.

On the step:

$ hash x264 ffmpeg ffplay ffprobe
I get error messages:
bash: hash: ffmpeg: not found
bash: hash: ffplay: not found
bash: hash: ffprobe: not found
Strange. Did the ffmpeg, ffplay, and ffprobe binaries actually get installed?

$ ls /usr/local/bin/ff*


Or is it a way to do manually what hash command is supposed to do?
The hash command in this guide isn't terribly important. When the ffmpeg binary from the repository is executed, and then replaced by a compiled ffmpeg while using the same shell session, the shell will still think ffmpeg is installed to /usr/bin instead of /usr/local/bin. Using hash tells the shell to remember the new location of the binary. Or something like that.

You can try "hash -r". That will, "forget all previously remembered utility locations". If that doesn't resolve the issue then the problem probably isn't with hash.

Mguel
October 30th, 2011, 09:35 PM
Strange. Did the ffmpeg, ffplay, and ffprobe binaries actually get installed?

$ ls /usr/local/bin/ff*

Hi, thanks a lot for the answer!:

Nope, it did not get installed:

$ ls /usr/local/bin/ff*
ls: cannot access /usr/local/bin/ff*: No such file or directory


there are only the following files on /usr/local/bin:

$ ls /usr/local/bin/
vp8_scalable_patterns vpxdec vpxenc x264

if I manually copy the ff* files from ~/ffmpeg to /usr/bin or /usr/local/bin?



PS: I'm not cursing when I mention ff* files LOL

FakeOutdoorsman
October 30th, 2011, 10:13 PM
Something must have gone wrong with the Install FFmpeg step. Navigate to the ffmpeg source directory, run make distclean, and update your source code:

cd ~/ffmpeg
make distclean
git pull

Then continue with Step 5 starting with the ./configure line. Make note if it fails again and when it fails: either ./configure, make, or checkinstall.


if I manually copy the ff* files from ~/ffmpeg to /usr/bin or /usr/local/bin?
That's a somewhat messy way of doing it and will not integrate the package into the package management system like checkinstall will.

Mguel
October 30th, 2011, 10:17 PM
OK!!!

I'll do it and report back the results

Edit: during make execution I get many warnings, but the process goes on with no interruption so far... the same as the first time


Edit2 sudo checkinstall... seems ok (the same as first time):

Copying files to the temporary directory...OK

Stripping ELF binaries and libraries...OK

Compressing man pages...OK

Building file list...OK

Building Debian package...OK

Installing Debian package...OK

Erasing temporary files...OK

Deleting doc-pak directory...OK

Deleting temp dir...OK


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

Done. The new package has been installed and saved to

/home/user/ffmpeg/ffmpeg_201110301826-git-1_i386.deb

You can remove it from your system anytime using:

dpkg -r ffmpeg

************************************************** ********************
Edit 3... strange... no errors on hash command
hash x264 ffmpeg ffplay ffprobe


Edit 4... ffmpeg installed!!!! thanks a lot!! :D
$ ffmpeg -version
ffmpeg version git-2011-10-30-49aa397, Copyright (c) 2000-2011 the FFmpeg developers
built on Oct 30 2011 18:25:25 with gcc 4.6.1
...

andrew.46
October 31st, 2011, 07:41 AM
Apple fixed their trac bug-reporting system so I have filed a bug on the compile difficulties for alacconvert:

Cannot build alacconvert under Slackware 13.37: makefile problem?
http://alac.macosforge.org/trac/ticket/4

Interesting to see how keen the response is :)

mc4man
October 31st, 2011, 06:14 PM
I have mixed feelings about pursuing it too much further: the encoder produces files that I have yet been unable to play with any media software available to me

It would seem that atm ffmpeg will reject these .caf files (based on 'magic cookie'

The only player i've seen that will play is apples' quicktime player (on windows or mac

andrew.46
November 1st, 2011, 11:31 PM
Keen mp3 encoders might be interested to know that a new version of lame came out a week or 2 ago:


andrew@skamandros~$ lame --version | head -n 1
LAME 32bits version 3.99 (http://lame.sf.net)

robla64
November 2nd, 2011, 06:35 PM
delete

ron999
November 3rd, 2011, 12:14 AM
Looks like a wma lossless decoder is on the horizon (http://git.videolan.org/?p=ffmpeg.git;a=commit;h=123b1fac5c0a18061d7fa9a78 69e537e81d16506), hopefully not too long now...

It's included now, but doesn't seem to work properly yet.

ffmpeg -codecs | grep -i wmalossless
ffmpeg version N-34354-g0b3e9d5
....
....
D A wmalossless Windows Media Audio 9 Lossless

mc4man
November 3rd, 2011, 03:11 AM
It's included now, but doesn't seem to work properly yet.

I guess it's got to start somewhere - wmal is detected properly & not rejected by either ffplay or ffmpeg, just can't do a decode atm
(a ffmpeg conversion to wav or flac creates a header & pretty much nothing else

andrew.46
November 3rd, 2011, 10:34 PM
I noticed this after I made the guide, unfortunately. So much for realtime, crappily tested guide writing...

Looks like FFplay, FFmpeg and MPlayer will now decode the files produced by alacconvert so all is well :).

Support new ALAC magic cookie in caf files. (http://git.videolan.org/?p=ffmpeg.git;a=commit;h=80af00b4b23a38dd8c63b892c d103af0d9407452)

PayPaul
November 5th, 2011, 02:55 PM
This question may have been asked before but I don't have any idea or time to parse through the umpteen pages in this thread to find it. How do I know which version of ffmpeg I have on my system. Do I even have x264. I did a check of formats currently supported and found what seems to cover just about everything.. I don't wish to reinvent the wheel if my wheel isn't broken.

prupert
November 5th, 2011, 09:23 PM
Just type ffmpeg at the command line and it will show you, this is what I get:



rupert@netbook:~$ ffmpeg
ffmpeg version N-32936-g58c6149, Copyright (c) 2000-2011 the FFmpeg developers
built on Sep 25 2011 20:56:07 with gcc 4.5.2
configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
libavutil 51. 17. 0 / 51. 17. 0
libavcodec 53. 17. 0 / 53. 17. 0
libavformat 53. 13. 0 / 53. 13. 0
libavdevice 53. 4. 0 / 53. 4. 0
libavfilter 2. 43. 5 / 2. 43. 5
libswscale 2. 1. 0 / 2. 1. 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'

andrew.46
November 5th, 2011, 10:16 PM
Do I even have x264.

And for x264:



andrew@skamandros~$ x264 --version
x264 0.119.2106 07efeb4
(libswscale 2.1.0)
built on Nov 5 2011, gcc: 4.5.2
configuration: --bit-depth=10 --chroma-format=all
x264 license: GPL version 2 or later
libswscale license: nonfree and unredistributable
WARNING: This binary is unredistributable!



I did a check of formats currently supported and found what seems to cover just about everything.. I don't wish to reinvent the wheel if my wheel isn't broken.

If your current FFmpeg fills your needs I would suspect there is no need to build your own. But in time you will find the substantial limitations of the Ubuntu packaged FFmpeg and that is where this guide comes into its own.

ron999
November 5th, 2011, 11:07 PM
... wmal is detected properly & not rejected by either ffplay or ffmpeg, just can't do a decode atm...

Hi
In the meantime... mPlayer will convert these wma lossless to wav.
(Maybe it uses the extra all-20110131 codecs, not sure.)
Also there are some wma2wav.exe programs that might work with WINE.
Then afterwards convert from wav to the required format.

This is a method using mPlayer, FFmpeg and a named pipe.
Does the job in one operation.
(Change the red parts to suit).8-)


# Make sure no pipe.pipe file already exists. && \
rm -f pipe.pipe && \
# && \
mkfifo pipe.pipe && \
mplayer -noconsolecontrols \
-vc null -vo null \
-ao pcm:fast:file=pipe.pipe \
luckynight.wma & \
ffmpeg -y -i pipe.pipe -acodec libmp3lame -aq 4 luckynight.mp3 && \
rm -f pipe.pipe

Borrowed the idea from here:- http://incise.org/transcoding-music.html

...

andrew.46
November 5th, 2011, 11:28 PM
Or perhaps:



transcode -H 0 -x null,mplayer -i luckynight.wma -y null,tcaud \
--lame_preset standard -E 44100,16,2 -m luckynight.mp3


but only for the 32bit MPlayer of course and Transcode's MPlayer import module:



andrew@skamandros~$ ls -1 $( tcmodinfo -p )/import*.so | grep mplayer
/usr/lib/transcode/import_mplayer.so

PayPaul
November 5th, 2011, 11:56 PM
I did get a nice long description of all the add-ons that are included with ffmpeg including some warnings about mismatches. What sort of problems could those cause? How do I fix them? I just did some security updates but I'm not certain if anything associated with ffmpeg was in those updates.


FFmpeg version 0.6.2-4:0.6.2-1ubuntu1.1, Copyright (c) 2000-2010 the Libav developers
built on Sep 16 2011 17:00:39 with gcc 4.5.2
configuration: --extra-version=4:0.6.2-1ubuntu1.1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-vaapi --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
WARNING: library configuration mismatch
libavutil configuration: --extra-version=4:0.6.2-1ubuntu2 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-vaapi --enable-libopenjpeg --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libfaad --enable-libdirac --enable-libfaad --enable-libmp3lame --enable-librtmp --enable-libx264 --enable-libxvid --enable-libdc1394 --enable-shared --disable-static
libavcodec configuration: --extra-version=4:0.6.2-1ubuntu2 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-vaapi --enable-libopenjpeg --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libfaad --enable-libdirac --enable-libfaad --enable-libmp3lame --enable-librtmp --enable-libx264 --enable-libxvid --enable-libdc1394 --enable-shared --disable-static
libavformat configuration: --extra-version=4:0.6.2-1ubuntu2 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-vaapi --enable-libopenjpeg --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libfaad --enable-libdirac --enable-libfaad --enable-libmp3lame --enable-librtmp --enable-libx264 --enable-libxvid --enable-libdc1394 --enable-shared --disable-static
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
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}...
Thanks for that nice simple command.

FakeOutdoorsman
November 6th, 2011, 07:59 PM
...including some warnings about mismatches. What sort of problems could those cause? How do I fix them?
You can ignore those warnings. They are a result from the way the maintainer created the package and will not cause you any issues.

PayPaul
November 6th, 2011, 08:55 PM
You can ignore those warnings. They are a result from the way the maintainer created the package and will not cause you any issues.

I don't mean to fuss about it and appreciate the heads up but do those warnings indicate that the maintainer created a faulty package? Weird.

beew
November 12th, 2011, 12:10 AM
Hi,

I have followed your great tutorial to install ffmpeg and x264 on Ubuntu 11.04. It went through very smoothly and so far everything seems to be working. Thanks a lot!

I have a few questions though, I would greatly appreciate your thoughts on them.

I notice that ffmpeg is installed in /usr/local/bin/. Now many applications use ffmpeg as backend, do I need to make a symbolic like to /usr/bin/, since it may be where ffmpeg is expected to be?

When compiling ffmpeg I saw that it was building libvacodec and some othe libva packages. Prior to building ffmpeg with your instructions I have installed libvacodecs-extra52 (and other libva--extra packages) from Ubuntu restricted extras and Medibuntu. I think with your method of building ffmpeg the extra codecs are already built into the libraries. So far i haven't notice any conflict with my previously installed "extra" packages.. I am wondering if I have to install these packages in the future if I plan to build ffmpeg this way, would they be superfluous?

Has there been report of compatibility issue in using this build as the "system" ffmpeg? I was building k3b from debian source and was told that if I have installed ffmpeg from this tutorial I would have to revert to the old "stripped" version first and then rebuild ffmpeg after compiling k3b. I am wondering if this example may indicate some compatibility issues in system-wide deployment of this build.

Finally, I have pinned ffmpeg and x264 so that they won't get "upgraded' by the package manager. Would they get out of sync with the rest of the system when other things are getting updated, or are these packages pretty self contain?

Thanks again.

mc4man
November 12th, 2011, 01:05 AM
Has there been report of compatibility issue in using this build as the "system" ffmpeg? I was building k3b from debian source and was told that if I have installed ffmpeg from this tutorial I would have to revert to the old "stripped" version first and then rebuild ffmpeg after compiling k3b. I am wondering if this example may indicate some compatibility issues in system-wide deployment of this build.

beew -
Just to 'clear' that up for anyone answering this - this issue building k3b wasn't 'stripped', ect.
k3b uses libavcodec/libavformat-dev, with the ffmpeg static build installed it was using those headers instead of the ones in /usr/include
It's possible k3b could be statically linked but even then it would need patching for newer ffmpeg sources, it was easier & probably better to get ffmpeg 'out of the way' during the build.

beew
November 12th, 2011, 02:22 AM
Hi, mc4man.

Thanks for the clarification. So does it mean that the same would apply for building other programs that would use those dev files unless they are statically linked to their own version of ffmpeg?

Now I think I have two sets of libavcodecs, one statically built with ffmpeg following this guide and then there is another installed with restricted extras and Medibuntu before. But I have to make sure when I go home later. One of my questions was basically I am not sure which one will be used by what...

Thanks again.. this is all kind of new to me and I easily get confused..

andrew.46
November 12th, 2011, 02:31 AM
Just to add a little more confusion, it is possible to direct the application you are compiling to use a specific version of FFmpeg + friends by explicitly giving PKG_CONFIG_PATH before compiling. On my own system I use this to give SoX, Transcode and a few other applications an FFmpeg that they will compile against:



export PKG_CONFIG_PATH="/home/andrew/source/ffmpeg_old/usr/lib/pkgconfig"


This copy of FFmpeg is a bare-bones copy without FFmpeg/FFplay/FFserver/docs etc and is a very useful technique when you wish to run the git FFmpeg as your 'system' copy. Currently my 'ffmpeg_old' is 0.7.6 as this maintains features of 0.6 while containing multiple bugfixes and improvements.

mc4man
November 12th, 2011, 04:38 AM
?

Now I think I have two sets of libavcodecs, one statically built with ffmpeg following this guide and then there is another installed with restricted extras and Medibuntu before. But I have to make sure when I go home later. One of my questions was basically I am not sure which one will be used by what...


No - you only have 1 set of the 'libavcodes', those are the shared libs that you've installed from medibuntu, they end in .so (shared object file'

Sources that were built against their 'corresponding' -dev packages will then depend on (use), those shared libs. So that would be all the repo/ppa apps/plugins that depend on the ffmpeg libs'.
To see run this something like this, using the exact name of the repo libavcodec package, on 11.10 it's llbavcodec53 or libavformat53, ect.

apt-cache rdepends libavcodec53

So if you build a source that uses the repo/ppa libavcodec-dev, libavformat-dev, ect. they will also then depend on (use) the shared libs, libavcodec53, libavformat53 ect. That was the case with k3b, we built against the repo libavcodec-dev, libavformat-dev, so it now depends on those shared libs.

When you build a source statically or against a static depend then it will not depend on the associated shared libs. A clear example is this how-to, ffmpeg is a static build, using a static x264

So the ffmpeg binary does not depend on any of the ffmpeg shared libs, nor on libx264. It does depend on all of the .so's associated with the -dev packages you installed or had installed prior to building ffmpeg

You can see this clearly here if run when your static, 'ala this how-to' ffmpeg is installed - there will be no libx264* or libavcodec53, ect. listed

ldd /usr/local/bin/ffmpeg
If you were to uninstall your ffmpeg built, install the repo ffmpeg, & run that command again you'll see the difference.

As far as the apps that use the ffmpeg binary itself. They will use whichever one that is installed. (try not to have more than 1 ffmpeg installed at once
If it's your built one then most of the time things will be fine, sometimes maybe not, they need the usually older repo version.

Hopefully this is somewhat informing, don't consider definitive or even absolutely technically correct, I mainly know whatever I think I know from observing

beew
November 12th, 2011, 09:58 PM
Hi, mc4man,

Thanks for the detailed explanation, you are the man!

How do you know if something is statically build? (I take it to mean that it is built in such a way that it is linked to its own versions of whatever libraries that it uses, rather than the system wide?)

mc4man
November 13th, 2011, 12:17 AM
How do you know if something is statically build?
Only sources that you build yourself May be. No repo/ppa source is built static only, (at least anything of concern) nor is static linking allowed (as far as I know

As far as your builds, that depends on the source, if they use a configure script then ./configure --help will usually show you.
Some, like ffmpeg, default to static only, others may default to static & shared, some, like x264, need either or both to be specified

qyot27
November 13th, 2011, 03:20 PM
The facetious answer to knowing if something is built statically is 'the binary is larger'. That still means you can see that it's larger, meaning you'd have to be comparing it to a shared build.

Basically,
Static = self-contained (and therefore larger)
Shared = not self-contained; relies on external libraries

For instance, taking Windows builds of FFmpeg as an example:
I always build as static. My static build of ffmpeg.exe is 10 megabytes.

Zeranoe's shared build of ffmpeg.exe is only 126 kilobytes, but has to have all of its dependency dlls either in the same folder or on the PATH to be usable. These dlls are much larger - avcodec-53.dll alone is 13 megabytes (there can be size differences due to feature support; my static builds don't have any external libraries included except for zlib, bzip2, and xvidcore).

In short, the difference between static and shared is where the 'mass' is - in a static build, the binary itself has all of the mass; in a shared build, the binary is small and depends on libraries in order to function, with the libraries having all the mass.

FakeOutdoorsman
November 14th, 2011, 04:36 AM
Mandelbrot set:

ffplay -f lavfi mandelbrot

beew
November 14th, 2011, 09:43 PM
Hi,

Kazam screen caster has stopped working, I am not sure if this has to do with switching to this build of ffmpeg, or if the problem lies elsewhere. This is the terminal output.


Xlib.protocol.request.QueryExtension
ffmpeg -f alsa -i pulse -f x11grab -r 30 -s 1366x768 -i :0.0+0,0 -ac 2 -acodec flac -ab 128k -vcodec libx264 -vpre lossless_ultrafast -threads 0 /tmp/tmpvCzVAk.mkv
ffmpeg version git-2011-11-11-985e768, Copyright (c) 2000-2011 the FFmpeg developers
built on Nov 11 2011 06:06:01 with gcc 4.5.2
configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-libvpx
libavutil 51. 24. 1 / 51. 24. 1
libavcodec 53. 31. 0 / 53. 31. 0
libavformat 53. 20. 0 / 53. 20. 0
libavdevice 53. 4. 0 / 53. 4. 0
libavfilter 2. 47. 2 / 2. 47. 2
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
[alsa @ 0x92c9ae0] Estimating duration from bitrate, this may be inaccurate
Input #0, alsa, from 'pulse':
Duration: N/A, start: 1321233958.242020, bitrate: N/A
Stream #0:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
[x11grab @ 0x92cec80] device: :0.0+0,0 -> display: :0.0 x: 0 y: 0 width: 1366 height: 768
[x11grab @ 0x92cec80] shared memory extension found
[x11grab @ 0x92cec80] Estimating duration from bitrate, this may be inaccurate
Input #1, x11grab, from ':0.0+0,0':
Duration: N/A, start: 1321233958.328359, bitrate: 1007124 kb/s
Stream #1:0: Video: rawvideo (BGRA / 0x41524742), bgra, 1366x768, 1007124 kb/s, 30 tbr, 1000k tbn, 30 tbc
File for preset 'lossless_ultrafast' not found
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/kazam/app.py", line 159, in cb_save_requested
shutil.move(self.screencast.get_recording_filename (), uri)
File "/usr/lib/python2.7/shutil.py", line 292, in move
copy2(src, real_dst)
File "/usr/lib/python2.7/shutil.py", line 127, in copy2
copyfile(src, dst)
File "/usr/lib/python2.7/shutil.py", line 81, in copyfile
with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: '/tmp/tmpvCzVAk.mkv'

Please advise, and my apologies if problem is not with ffmpeg, in that case I will start a different thread. Thanks.

FakeOutdoorsman
November 14th, 2011, 09:49 PM
I'm not familiar with Kazam, but if you want to use it you will have to somehow change the FFmpeg encoding command from:

-vpre lossless_ultrafast -threads 0
to

-preset ultrafast -crf 0
The method of presets has changed, and Kazam appears to be using the old preset system. The -threads 0 is superfluous now that it should be the default with libx264.

beew
November 15th, 2011, 09:15 PM
I'm not familiar with Kazam, but if you want to use it you will have to somehow change the FFmpeg encoding command from:

-vpre lossless_ultrafast -threads 0to

-preset ultrafast -crf 0The method of presets has changed, and Kazam appears to be using the old preset system. The -threads 0 is superfluous now that it should be the default with libx264.

Hi, thanks for the reply. Kazam is a gui,if I use it I wouldn't want to do it in the terminal. I am not sure how to change the encoding command since it seems to be hard coded. I will see what I happens if I try making screencast directly with ffmpeg instead.

ppqq
November 20th, 2011, 12:13 PM
Hi, I've been editing mpeg movies in Avidemux and when I play the output file there is a fraction of a second of blocky picture where the movie was cut and joined.

I suspect this is not Avidemux but the encoder that it uses, so is that ffmpeg?

As far as i know I followed the instructions at the beginning of this thread to install the codecs, not too long ago. I run ubuntu natty, 64bit on core duo, cq40 laptop, 4gb.

any help would be appreciated!
thanks

FakeOutdoorsman
November 20th, 2011, 08:11 PM
I believe Avidemux contains some FFmpeg code, but I don't think it uses any FFmpeg libraries as a dependency, so following this guide probably won't make Avidemux change its behavior.

Are you simply cutting and joining clips? This can often be deceptively tricky if you are not willing to re-encode (depending on your input formats).

qyot27
November 20th, 2011, 10:26 PM
Avidemux does use libavcodec to do any encoding (not sure if static, however), but that still leaves two different scenarios:

1) The blocking is due to not cutting on I frame or GOP boundaries. In this case, the 'blocking' would probably look more like smearing, since it doesn't have all the data. To remedy this, programs might use a smart encoding process that will decode only those portions affected by a bad merge so that all the data is retained, and then re-encode that portion so that all there aren't any adverse artifacts.

2) You're encountering a case of libavcodec's bad rate control, especially in the event of joins that incur a smart encoding method (again, I don't know if Avidemux does smart encoding). My tests of libavcodec as an MPEG-2 encoder a few years ago showed that it had pretty bad RC that was most obvious at the very beginning of a stream and then lessened as encoding progressed. I've not done tests with a current version to know whether this has been improved - FFmpeg's git log does show that there have been fairly recent commits that affected the MPEG-2 encoder, so it's possible that it has. That's no guarantee that Avidemux is using that updated code, though (especially in the case of Avidemux under Natty; the more recent MPEG-2 commits were from September).

ppqq
November 21st, 2011, 05:29 AM
I could see that happening, the join smearing where I've moved single frames and made a cut, and not on key frames.

it's making all my films look so amateurish!! actual frames are being ground up in the process.

I've just read up .. about mpeg editors (http://tangentsoft.net/video/mpeg/edit.html) and realise now that editing mpeg is not the easiest or best thing to do!

the thing is I tend to put all my MTS files from my hd camera through Kdenlive to make mpeg files for dvds, and only after the mpegs are made I might need to cut out parts (kdenlive makes freezes happen with me) or re-edit them for m4v encoding with handbrake. It would NOT be that practical to put the MTS through kdenlive all over again (that's at least 4x movie length for encode time on my intel core duo) to make another edit.

putting the mpeg movie into kdenlive again and rendering with cuts gives a movie with no smearing. it's just its a lot easier to edit in avidemux.

------
OK, I've found that converting the movie to DV with avidemux re-encodes and hence gives no blocky transitions, the output of this DV from handbrake is good quality too. My problem was with avidemux not re-encoding but sticking the mpeg pieces together which is not a good idea.

But oh help, DV files are huge, so I might have to do all the work in kdenlive and render to a good mpeg2 setting.

leekyuh
November 23rd, 2011, 12:48 PM
I fixed the compile error on OpenCV "relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC" on my Ubuntu 11.10 64 bit system.

The cure was to add " --enable-pic --enable-shared" in addition to "--enable static" while configuring x264. Also I had to add " --enable-pic --enable-shared" while configuring ffmpeg.

Thanks to:
http://thebitbangtheory.wordpress.com/2011/10/23/how-to-install-opencv-2-3-1-in-ubuntu-11-10-oneiric-ocelot-with-python-support/#comment-71

Jerriy
November 23rd, 2011, 06:05 PM
HELP

I'm unable to install this from step 4 (http://ubuntuforums.org/showpost.php?p=9868359&postcount=1289) onwards. I get connection error message


****@******:~$ cd
****@******:~$ git clone git://git.videolan.org/x264
Initialized empty Git repository in /home/****/x264/.git/
git.videolan.org[0: 88.191.250.118]: errno=Connection refused
fatal: unable to connect a socket (Connection refused)
****@******:~$ cd x264
bash: cd: x264: No such file or directory
****@******:~$ ./configure --enable-static
bash: ./configure: No such file or directory
****@******:~$ make
make: *** No targets specified and no makefile found. Stop.
****@******:~$ sudo checkinstall --pkgname=x264 --default --pkgversion="3:$(./version.sh | \
> awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes

FakeOutdoorsman
November 23rd, 2011, 07:01 PM
Some users may not be able to use Git. For example, the Git server may refuse the connection or a firewall on the users end might be interfering. Here are two alternative methods to get the x264, libvpx, and FFmpeg project files:

Using Git over http
The guide uses the git protocol for the git clone command. The files can also be retrieved over http instead and will probably not be blocked by firewalls. This method is slower, but will still give the user the same files. Note that the command may sit for a long time with little user feedback. To retrieve the files via http instead, use:

git clone http://git.videolan.org/git/x264.git

Using Snapshots
You can also skip Git completely and use snapshots instead. A snapshot is a routinely updated collection of all project source files continently compressed into a single file.

x264

cd
wget ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
tar xvjf last_x264.tar.bz2
cd x264-snapshot-*
Then continue with the ./configure line in the Install x264 section. Now for libvpx if you decide to use it too:

libvpx

cd
wget "http://git.chromium.org/gitweb/?p=webm/libvpx.git;a=snapshot;h=HEAD;sf=tgz" -O libvpx-snapshot.tar.gz
tar xzvf libvpx-snapshot.tar.gz
cd libvpx-HEAD-*
Then continue with the ./configure line in the Install libvpx section. The FFmpeg snapshot is similar:

FFmpeg

cd
wget "http://git.videolan.org/?p=ffmpeg.git;a=snapshot;h=HEAD;sf=tgz" -O ffmpeg-snapshot.tar.gz
tar xzvf ffmpeg-snapshot.tar.gz
cd ffmpeg-HEAD-*
Now, as with the others, continue with the ./configure line in the Install FFmpeg section. Follow the rest of the guide normally.

mc4man
November 23rd, 2011, 10:18 PM
. Note that the command may sit for a long time with little user feedback.

Just to mention because I've seen this confuse a few users who thought their terminal/command had 'frozen'

In gnome/nautilus 3 it's been decided to timeout the cursor blink at 10 secs
I find it annoying & reset much higher

Can be seen with this

~$ gsettings get org.gnome.desktop.interface cursor-blink-timeout
10

And altered with this, value as desired


gsettings set org.gnome.desktop.interface cursor-blink-timeout 200

Jerriy
November 24th, 2011, 05:56 AM
Thanks for the heads up, FakeOutdoorsman. It is indeed a sort firewall issue (git protocol apparently had no permission to pass through) basically the problem is caused as a result of the fact that I didn't recognize that git protocol before (I'm no Linux pro so it didn't even catch my eye that there was a different protocol... I was thinking it was the IP or some other thing that was the problem. So now rather than follow up on your alternative suggestions I'll go back to the original instruction step and see how that goes first...

PDA1
November 24th, 2011, 07:08 AM
Excellent work folks.

Is there a simple set of instructions to install the latest stable version of FFMPEG for Ubuntu 10.04?

I really need help with this stuff.

Thanks.

FakeOutdoorsman
November 24th, 2011, 09:23 AM
I consider FFmpeg from Git to be stable (for my purposes) on most occasions, but others have disagreed with me. Of couse a project with such active development will encounter issues, but most of the time they are fixed in a timely manner. Once again, others have disagreed with me on this point.

If you don't feel comfortable using the bleeding-edge, then you can try a recent release version. For a typical user a release version probably won't have any advantages over FFmpeg from Git other than they are called a "release" to ease any anxiety from stability concerns.

Compiling and installing a release version is fairly similar to using FFmpeg from Git as shown in the guide. Just download your desired release version from the FFmpeg download (http://ffmpeg.org/download.html) page, extract the archive file, and then continue with the guide starting with the appropriate ./configure line.

As for x264, there is a stable branch. x264 updates are usually pushed in one big dump every month or two. This includes fixes and other non-fix updates. The stable branch will include the most recent fixes, but the other non-fix updates won't be included in stable until the next set of updates. This allows the developers to catch any unforseen bugs that can be fixed before the next push to stable, and therefore hopefully decreasing the number of bugs encountered by the user. That's the idea at least, as I understand it, but I don't know how many bugs have actually been avoided in stable. To switch to the stable branch for x264, enter the following command before the x264 ./configure command:

git checkout stable

PDA1
November 24th, 2011, 01:59 PM
Thanks for helping me but I got an error message when I tried to get the mp3 from a video file.

Below is the entire results from the command line input to the end;




echo@echo-laptop:~/Downloads$ ffmpeg -i rrr.mp4 dkdik.mp3
ffmpeg version git-2011-11-24-957867a, Copyright (c) 2000-2011 the FFmpeg developers
built on Nov 24 2011 07:50:58 with gcc 4.4.3
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-x11grab
libavutil 51. 27. 0 / 51. 27. 0
libavcodec 53. 37. 0 / 53. 37. 0
libavformat 53. 21. 0 / 53. 21. 0
libavdevice 53. 4. 0 / 53. 4. 0
libavfilter 2. 49. 0 / 2. 49. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'rrr.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2011-09-11 20:34:31
Duration: 00:09:58.73, start: 0.000000, bitrate: 610 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360, 508 kb/s, 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 95 kb/s
Metadata:
creation_time : 2011-09-11 20:34:32
handler_name :
Output #0, mp3, to 'dkdik.mp3':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2011-09-11 20:34:31
Stream #0:0(und): Audio: none, 44100 Hz, stereo, s16, 128 kb/s
Metadata:
creation_time : 2011-09-11 20:34:32
handler_name :
Stream mapping:
Stream #0:1 -> #0:0 (aac -> ?)
Encoder (codec none) not found for output stream #0:0



Any idea how to fix it?

Thank you

FakeOutdoorsman
November 24th, 2011, 09:19 PM
Your FFmpeg configure line is missing --enable-libmp3lame. This is required if you want to encode mp3, although the error message could be improved. I assume you followed the 10.04 version of the guide and skipped step 5 or simply omitted the instructions to add --enable-libmp3lame. This happens on occasion, and I will consider changing the guide because I feel that note about adding --enable-libmp3lame is often ignored or overlooked.

What you can do:
Recompile ffmpeg and follow step 5,
Or Pipe from ffmpeg to LAME,
Or uninstall your compiled ffmpeg and install it from the repository instead

If you're impatient just install lame:

sudo apt-get install lame
Then pipe the audio from ffmpeg to lame:

ffmpeg -i input.mp4 -f wav - | lame - output.mp3

Or install ffmpeg from the repository and enable the mp3 encoder. It's easy to do since you'll just need to install two packages and is described under Option B here:

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

Then you can use your same command from post #1950, but I recommend adding -aq 4 to improve the quality of the output because the default settings use an unusually low bitrate (64 kilobits/s [but maybe default is 128k now]) for most purposes.

PDA1
November 24th, 2011, 10:24 PM
I think I discovered the problem;

The first 3 lines (see the attached picture) weren't checked off. Installation was successful (so I think) once they were checked off. We'll see.

Thank you for the help.

FakeOutdoorsman
November 24th, 2011, 10:28 PM
The Canonical Partner Repositories do not provide anything that is required by this guide.

PDA1
November 24th, 2011, 11:19 PM
I have no idea why I now have the mp3 codec. I made many attempts to install ffmpeg using your guide to no success until those 2 or 3 items were checked off.

Perhaps in Step 7 (for Ubuntu 10.04) adding the mp3 (or whatever it's called) to the ./configure line at a specific part of one of the code lines is important. The successful time I placed the additional code line just after the words "./configure" instead of at the end of the entire ./configure line.

I'm just a computer user and not a programmer and have little ability to work around things which are understandable by experienced users.

I've asked this question 10,000 times and it never gets easier for me to understand but all I want to do is take any video (usually off of Y T) and put it on my iPod 160 G Classic. Everyone has a code line that works for them but only a few times have those lines worked for me. This is so frustrating.

FakeOutdoorsman
November 25th, 2011, 12:07 AM
Perhaps in Step 7 (for Ubuntu 10.04) adding the mp3 (or whatever it's called) to the ./configure line at a specific part of one of the code lines is important.
Yes, as I mentioned previously, and as the guide stated, adding --enable-libmp3lame is required if you want to encode mp3 files.


The successful time I placed the additional code line just after the words "./configure" instead of at the end of the entire ./configure line.
Placement of --enable-libmp3lame on the ffmpeg ./configure line does not matter as long as it is there.


I'm just a computer user and not a programmer and have little ability to work around things which are understandable by experienced users.
I am also not a programmer.

I changed the 10.04 guide to make it more user friendly by removing the extra complexity of the optional sections. Now users can simply copy and paste the code boxes without reading the additional instructions (which probably happens much more than I expect) and still get all of the features offered by the guide. I will do this to the other guides where applicable for consistency.

Also, although I try to write the guides from the viewpoint of a beginner, compiling may not be for everyone. I have an additional guide that shows how to install ffmpeg from the repository and enable the disabled-by-default encoders for formats such as mp3 and aac:

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


I've asked this question 10,000 times and it never gets easier for me to understand but all I want to do is take any video (usually off of Y T) and put it on my iPod 160 G Classic. Everyone has a code line that works for them but only a few times have those lines worked for me. This is so frustrating.

Picky devices are picky. Did you see my answer (http://ubuntuforums.org/showthread.php?p=11486441#post11486441) to your other recent post?

qyot27
November 25th, 2011, 04:48 AM
Thanks for helping me but I got an error message when I tried to get the mp3 from a video file.

Below is the entire results from the command line input to the end;


echo@echo-laptop:~/Downloads$ ffmpeg -i rrr.mp4 dkdik.mp3
[snip]
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 95 kb/s
[snip]

Any idea how to fix it?

I've asked this question 10,000 times and it never gets easier for me to understand but all I want to do is take any video (usually off of Y T) and put it on my iPod 160 G Classic. Everyone has a code line that works for them but only a few times have those lines worked for me. This is so frustrating.
As the readout showed, the audio stream in the file is AAC. iPods support that format, so you don't have to convert anything (although it might need to be run through qtfaststart).

For instance,

ffmpeg -i inputfile.mp4 -vn -acodec copy outputfile.m4a
The -vn disables the video, and -acodec copy transfers the audio to a new, smaller file. If you know the audio is MP3 and not AAC, then just change the .m4a on the output filename to .mp3 (because while it's totally standard-compliant to put MP3 into the MP4 container, I have no clue whether devices are weird about that).

PDA1
November 25th, 2011, 04:57 AM
I really love all of that hi-tech lingo.....but have no idea what it means. I'm rather dumb- all I want to do is take any video like from Y T and convert it to a playable format for my iPod. From what I've seen and tried about 95% of the code lines DO NOT work, are old and out of date and won't work with current ffmpeg stuff.

popper
November 25th, 2011, 12:23 PM
I have no idea why I now have the mp3 codec.
I'm just a computer user and not a programmer and have little ability to work around things which are understandable by experienced users.

I've asked this question 10,000 times and it never gets easier for me to understand but all I want to do is take any video (usually off of Y T) and put it on my iPod 160 G Classic. Everyone has a code line that works for them but only a few times have those lines worked for me. This is so frustrating.

well lets see :D
goggling the spec as YOU didn't say what that iPod 160 G Classic device takes
http://support.apple.com/kb/SP572

"Video
H.264 video, up to 1.5 Mbps, 640 by 480 pixels, 30 frames per second, Low-Complexity version of the H.264 Baseline Profile with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; H.264 video, up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Baseline Profile up to Level 3.0 with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; MPEG-4 video, up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats"

"Audio
Frequency response: 20Hz to 20,000Hz
Audio formats supported: AAC (8 to 320 Kbps), Protected AAC (from iTunes Store), MP3 (8 to 320 Kbps), MP3 VBR, Audible (formats 2, 3, 4, Audible Enhanced Audio, AAX, and AAX+), Apple Lossless, AIFF, and WAV"

SO given the latest ffmpeg/avconv that would be

video coded to H.264/x264/AVC baseline profile (NOT mp4 aka divx/xvid) at a max 2.5 Mbp 640 by 480, and audio codec AAC (not Mp3) at 128Kb/s is fine (320Kbit/s or even 192KBit/s IS OTT) inside an .MP4 container ... given that AVC and AAC go together as intended....and do not make the sharp input video fuzzy as hell like divx/xvid does every single time..

so the line you want is probably this

avconv.exe if your using their latest GIT as their ffmpeg will be renamed soon or

ffmpeg -threads 4 -i "infile.whatever" -f mp4 -vcodec libx264 -crf 18 -minrate 600k -maxrate 1500k -bufsize 1500k -refs 3 -preset slow -vprofile Baseline -level 3.0 -flags2 -bpyramid -wpredp 0 -strict experimental -acodec aac -ac 2 -ab 128k -vf hqdn3d,unsharp=5:5:0.5,scale=640:480 "outfile.MP4"

this is OC untested as i don't have that device and iv just modified my usual MKV to MP4 CRF line to suit and add the scale etc.... so there may be syntax typing errors in that line that need sorting, but it should work as is given the data above.

edit:
so i made a quick sample encode with the line and it seems to work fine although not as sharp as it could be but thats down to the re-scale to a far lower screen size OC, so test that and see if it plays OK for you.
http://www.mediafire.com/?2egrbf61jf5ejn6

and given that screen size and not knowing what the actual ratio is of your infile ("mediainfo" is good for finding that info out per file) then you may want/need to add ,setdar=16:9 after the scale part to make it display widescreen/16:9 ratio files properly

so the main points are your device takes the better AVC.AAC codecs so use them over the fuxxy and old divx/xvid to get far better visual quality and file size when you re-encode properly.

you may need/want to change the "1500k" parts to read "765k" if you're device is an older one that only takes slower bit rates to play video smoothly apparently, but try 2500k first then 1500k as above as theres no point throwing away good bit-rate detail if you dont need/want to.

that line is using CRF-18 for keeping as much quality as possible which is considered high usually BUT the -minrate,maxrate, and bufsize counter act that to restrict the video stream to the given lower bitrate as is required and is good.

PDA1
November 25th, 2011, 02:08 PM
As the readout showed, the audio stream in the file is AAC. iPods support that format, so you don't have to convert anything (although it might need to be run through qtfaststart).

For instance,

ffmpeg -i inputfile.mp4 -vn -acodec copy outputfile.m4aThe -vn disables the video, and -acodec copy transfers the audio to a new, smaller file. If you know the audio is MP3 and not AAC, then just change the .m4a on the output filename to .mp3 (because while it's totally standard-compliant to put MP3 into the MP4 container, I have no clue whether devices are weird about that).


Wow! your code for getting only the audio (m4a) was REALLY fast. Most of the time I convert to MP3 which takes a long time for most files I have.

Here's what I typically do to get the audio- ffmpeg -i INPUT.mp4 OUTPUT.mp3

The reason I use mp3 is (being the dope that I am) because M4A isn't a familiar extension to me and I'm concerned about moving any audio (or video) file to another media player (like something other than an iPod) and most play MP3.

Thanks for the help.

popper
November 25th, 2011, 02:30 PM
Wow! your code for getting only the audio (m4a) was REALLY fast. Most of the time I convert to MP3 which takes a long time for most files I have.

Here's what I typically do to get the audio- ffmpeg -i INPUT.mp4 OUTPUT.mp3

The reason I use mp3 is (being the dope that I am) because M4A isn't a familiar extension to me and I'm concerned about moving any audio (or video) file to another media player (like something other than an iPod) and most play MP3.

Thanks for the help.

actually you misunderstand that line , ill try and explain, qyot27's ffmpeg -i inputfile.mp4 -vn -acodec copy outputfile.m4a says take any input file even with video and audio but dont even try and copy or encode any video contained in there to the new container , and COPY (hence the -acodec copy part) any audio inside there TO a new .m4a container file.

digital video/audio files are basically made up of 3 or more parts, the video codec, the audio codec and any other data such as subtitles placed inside a container, a container being MP4, MKV or the antiquated avi container that everyone should avoid using/making today etc

the basic rule i follow these days is anything that cant take AVC, AAC inside a MP4 or MKV container in 2011 needs scrapping ASAP and its way past time to go and get something that can. :)

PDA1
November 25th, 2011, 02:40 PM
Here's the thing I find odd- I used to able to download videos from Y T (or other sources) in mp4 format and put them on my iPod. Now, after upgrading to iTunes 10.5 and re-installing XP most mp4's need some sort of conversion before they can play perfectly on my iPod. It's a pain-in-the-neck and I'm sick of it.

As I said some other place Linux just doesn't have an easy program that'll manage music for iPod and that's why I'm stuck with that stupid Windows/iTunes stuff.

popper
November 25th, 2011, 03:03 PM
Here's the thing I find odd- I used to able to download videos from Y T (or other sources) in mp4 format and put them on my iPod. Now, after upgrading to iTunes 10.5 and re-installing XP most mp4's need some sort of conversion before they can play perfectly on my iPod. It's a pain-in-the-neck and I'm sick of it.

As I said some other place Linux just doesn't have an easy program that'll manage music for iPod and that's why I'm stuck with that stupid Windows/iTunes stuff.

well thats apple for you :) changing all sorts of things on your device behind your back, LOL, that's why people today are preferring to buy ARM/NEON dual and quad core Devices this year with a nice Linux OS installed and ready for ARM x264/ffmpeg encoding :) (Yes ARM with NEON SIMD devices can run "x264/ffmpeg directly" unless their default locked as standard like apple)

well try that sample i made for you and see if it plays fine on the pod, i can give you a windows bat script that will convert all your files to that format if it plays fine i dont know bash shell script so someone else can convert that for linux use later perhaps...

PDA1
November 25th, 2011, 03:32 PM
Yes, the file you provided loads and plays on the iPod perfectly.

I'm running Ubuntu 10.04 which is where I download the Y T videos. Then I put them on a USB drive and move 'em over to Windows/iTunes.

Frankly, I want to have as little to do with Windows as possible.

Thank you for the help.

Say, here's a the ffmpeg- i information from a video I downloaded. It transfers and plays on the iPod BUT the width of the video is partially cut off on the iPod screen. Any idea why?



echo@echo-laptop:~/Downloads$ ffmpeg -i rp.mp4
ffmpeg version git-2011-11-24-957867a, Copyright (c) 2000-2011 the FFmpeg developers
built on Nov 24 2011 16:13:53 with gcc 4.4.3
configuration: --enable-libmp3lame --enable-libvpx --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-x11grab
libavutil 51. 27. 0 / 51. 27. 0
libavcodec 53. 37. 0 / 53. 37. 0
libavformat 53. 21. 0 / 53. 21. 0
libavdevice 53. 4. 0 / 53. 4. 0
libavfilter 2. 49. 0 / 2. 49. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'rp.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2011-09-11 20:34:31
Duration: 00:09:58.73, start: 0.000000, bitrate: 610 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360, 508 kb/s, 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 95 kb/s
Metadata:
creation_time : 2011-09-11 20:34:32
handler_name :
At least one output file must be specified

andrew.46
November 25th, 2011, 09:49 PM
As I said some other place Linux just doesn't have an easy program that'll manage music for iPod and that's why I'm stuck with that stupid Windows/iTunes stuff.

But FFmpeg is easy :).

Jerriy
November 25th, 2011, 09:58 PM
I consider FFmpeg from Git to be stable (for my purposes) on most occasions, but others have disagreed with me. Of couse a project with such active development will encounter issues, but most of the time they are fixed in a timely manner. Once again, others have disagreed with me on this point.

If you don't feel comfortable using the bleeding-edge, then you can try a recent release version. For a typical user a release version probably won't have any advantages over FFmpeg from Git other than they are called a "release" to ease any anxiety from stability concerns.

Compiling and installing a release version is fairly similar to using FFmpeg from Git as shown in the guide. Just download your desired release version from the FFmpeg download (http://ffmpeg.org/download.html) page, extract the archive file, and then continue with the guide starting with the appropriate ./configure line.

As for x264, there is a stable branch. x264 updates are usually pushed in one big dump every month or two. This includes fixes and other non-fix updates. The stable branch will include the most recent fixes, but the other non-fix updates won't be included in stable until the next set of updates. This allows the developers to catch any unforseen bugs that can be fixed before the next push to stable, and therefore hopefully decreasing the number of bugs encountered by the user. That's the idea at least, as I understand it, but I don't know how many bugs have actually been avoided in stable. To switch to the stable branch for x264, enter the following command before the x264 ./configure command:

git checkout stableI have succeeded in solving the git problem and moved up to the final 7th step (http://ubuntuforums.org/showpost.php?p=9868359&postcount=1289). That's where my next problem occured. Apparently libfaac is not found (although I checked synaptic and there is an item called "libfaac0" but it's already istalled! So I've bumped into another odd problem, namely: I don't even know what the problem is :p
****@******:~$ cd
****@******:~$ git clone --depth 1 git://source.ffmpeg.org/ffmpeg
Initialized empty Git repository in /home/****/ffmpeg/.git/
remote: Counting objects: 7436, done.
remote: Compressing objects: 100% (5262/5262), done.
remote: Total 7436 (delta 4734), reused 3646 (delta 2039)
Receiving objects: 100% (7436/7436), 9.59 MiB | 1.96 MiB/s, done.
Resolving deltas: 100% (4734/4734), done.
****@******:~$ cd ffmpeg
****@******:~/ffmpeg$ ./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb \
> --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx \
> --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
ERROR: libfaac not found

If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org 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.
****@******:~/ffmpeg$ make
Makefile:2: config.mak: No such file or directory
Makefile:45: /common.mak: No such file or directory
Makefile:82: /libavutil/Makefile: No such file or directory
Makefile:148: /doc/Makefile: No such file or directory
Makefile:149: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'. Stop.
****@******:~/ffmpeg$ sudo checkinstall --pkgname=ffmpeg --pkgversion="5:$(./version.sh)" --backup=no \
> --deldoc=yes --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@****** ]
1 - Summary: [ Package created with checkinstall 1.6.1 ]
2 - Name: [ ffmpeg ]
3 - Version: [ 5:git-2011-11-25-9e794d1 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ checkinstall ]
7 - Architecture: [ i386 ]
8 - Source location: [ ffmpeg ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ ffmpeg ]

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

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

========================= Installation results ===========================
Makefile:2: config.mak: No such file or directory
Makefile:45: /common.mak: No such file or directory
Makefile:82: /libavutil/Makefile: No such file or directory
Makefile:148: /doc/Makefile: No such file or directory
Makefile:149: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'. Stop.

**** Installation failed. Aborting package creation.

Cleaning up...OK

Bye.

****@******:~/ffmpeg$ hash x264 ffmpeg ffplay ffprobe
bash: hash: ffmpeg: not found
bash: hash: ffplay: not found
bash: hash: ffprobe: not found

FakeOutdoorsman
November 25th, 2011, 10:07 PM
ERROR: libfaac not found
Did you install the libfaac-dev package as shown in step 2?

sudo apt-get install libfaac-dev
cd ~/ffmpeg
make distclean
git pull
Then continue with the ./configure line as shown in step 7.

Jerriy
November 26th, 2011, 02:15 AM
^ That's not solving it

I went back and re-read the results and noticed something I overlooked before: that during step 2 things were not exactly going on as planned:
****@******:~$ sudo apt-get update
Hit http://ppa.launchpad.net lucid Release.gpg
Ign http://ppa.launchpad.net/banshee-team/ppa/ubuntu/ lucid/main Translation-en_US
Hit http://ppa.launchpad.net lucid Release.gpg
Hit http://gb.archive.ubuntu.com lucid Release.gpg
Ign http://gb.archive.ubuntu.com/ubuntu/ lucid/main Translation-en_US
Ign http://gb.archive.ubuntu.com/ubuntu/ lucid/universe Translation-en_US
Ign http://ppa.launchpad.net/chromium-daily/stable/ubuntu/ lucid/main Translation-en_US
Hit http://ppa.launchpad.net lucid Release.gpg
Ign http://ppa.launchpad.net/debfx/virtualbox/ubuntu/ lucid/main Translation-en_US
Hit http://ppa.launchpad.net lucid Release.gpg
Ign http://ppa.launchpad.net/ferramroberto/extra/ubuntu/ lucid/main Translation-en_US
Hit http://ppa.launchpad.net lucid Release.gpg
Ign http://ppa.launchpad.net/gnuzilla-team/ppa/ubuntu/ lucid/main Translation-en_US
Hit http://ppa.launchpad.net lucid Release.gpg
Hit http://debian.anonymous-proxy-servers.net lucid Release.gpg
Ign http://debian.anonymous-proxy-servers.net/ lucid/main Translation-en_US
Ign http://gb.archive.ubuntu.com/ubuntu/ lucid/restricted Translation-en_US
Ign http://gb.archive.ubuntu.com/ubuntu/ lucid/multiverse Translation-en_US
Hit http://gb.archive.ubuntu.com lucid-updates Release.gpg
Ign http://gb.archive.ubuntu.com/ubuntu/ lucid-updates/universe Translation-en_US
Ign http://gb.archive.ubuntu.com/ubuntu/ lucid-updates/main Translation-en_US
Ign http://gb.archive.ubuntu.com/ubuntu/ lucid-updates/multiverse Translation-en_US
Ign http://gb.archive.ubuntu.com/ubuntu/ lucid-updates/restricted Translation-en_US
Hit http://security.ubuntu.com lucid-security Release.gpg
Ign http://security.ubuntu.com/ubuntu/ lucid-security/universe Translation-en_US
Ign http://security.ubuntu.com/ubuntu/ lucid-security/main Translation-en_US
Hit http://packages.medibuntu.org lucid Release.gpg
Ign http://ppa.launchpad.net/jre-phoenix/ppa/ubuntu/ lucid/main Translation-en_US
Hit http://ppa.launchpad.net lucid Release.gpg
Ign http://ppa.launchpad.net/kubuntu-ppa/beta/ubuntu/ lucid/main Translation-en_US
Hit http://ppa.launchpad.net lucid Release.gpg
Ign http://ppa.launchpad.net/midori/ppa/ubuntu/ lucid/main Translation-en_US
Hit http://ppa.launchpad.net lucid Release.gpg
Hit http://archive.canonical.com lucid Release.gpg
Ign http://archive.canonical.com/ lucid/partner Translation-en_US
Hit http://debian.anonymous-proxy-servers.net lucid Release
Hit http://gb.archive.ubuntu.com lucid-backports Release.gpg
Ign http://gb.archive.ubuntu.com/ubuntu/ lucid-backports/universe Translation-en_US
Ign http://gb.archive.ubuntu.com/ubuntu/ lucid-backports/main Translation-en_US
Ign http://security.ubuntu.com/ubuntu/ lucid-security/multiverse Translation-en_US
Ign http://security.ubuntu.com/ubuntu/ lucid-security/restricted Translation-en_US
Ign http://download.skype.com stable Release.gpg
Hit http://security.ubuntu.com lucid-security Release
Ign http://ppa.launchpad.net/mozillateam/firefox-stable/ubuntu/ lucid/main Translation-en_US
Hit http://ppa.launchpad.net lucid Release.gpg
Ign http://ppa.launchpad.net/mozillateam/thunderbird-stable/ubuntu/ lucid/main Translation-en_US
Hit http://ppa.launchpad.net lucid Release.gpg
Hit http://archive.canonical.com lucid Release.gpg
Ign http://archive.canonical.com/ubuntu/ lucid/partner Translation-en_US
Ign http://gb.archive.ubuntu.com/ubuntu/ lucid-backports/multiverse Translation-en_US
Ign http://gb.archive.ubuntu.com/ubuntu/ lucid-backports/restricted Translation-en_US
Hit http://gb.archive.ubuntu.com lucid Release
Hit http://archive.canonical.com lucid Release
Hit http://gb.archive.ubuntu.com lucid-updates Release
Hit http://debian.anonymous-proxy-servers.net lucid/main Packages
Ign http://download.skype.com/linux/repos/debian/ stable/non-free Translation-en_US
Hit http://security.ubuntu.com lucid-security/universe Packages
Ign http://ppa.launchpad.net/openshot.developers/ppa/ubuntu/ lucid/main Translation-en_US
Hit http://ppa.launchpad.net lucid Release.gpg
Ign http://ppa.launchpad.net/rvm/smplayer/ubuntu/ lucid/main Translation-en_US
Hit http://ppa.launchpad.net lucid Release.gpg
Ign http://ppa.launchpad.net/tiheum/equinox/ubuntu/ lucid/main Translation-en_US
Hit http://ppa.launchpad.net lucid Release.gpg
Hit http://archive.canonical.com lucid Release
Hit http://gb.archive.ubuntu.com lucid-backports Release
Ign http://packages.medibuntu.org/ lucid/free Translation-en_US
Ign http://ppa.launchpad.net/tualatrix/ppa/ubuntu/ lucid/main Translation-en_US
Hit http://ppa.launchpad.net lucid Release.gpg
Ign http://ppa.launchpad.net/ubuntu-mozilla-security/ppa/ubuntu/ lucid/main Translation-en_US
Hit http://ppa.launchpad.net lucid Release.gpg
Hit http://security.ubuntu.com lucid-security/main Packages
Hit http://security.ubuntu.com lucid-security/multiverse Packages
Hit http://security.ubuntu.com lucid-security/restricted Packages
Hit http://security.ubuntu.com lucid-security/universe Sources
Hit http://security.ubuntu.com lucid-security/main Sources
Hit http://security.ubuntu.com lucid-security/multiverse Sources
Hit http://archive.canonical.com lucid/partner Packages
Hit http://gb.archive.ubuntu.com lucid/main Packages
Hit http://gb.archive.ubuntu.com lucid/universe Packages
Hit http://gb.archive.ubuntu.com lucid/restricted Packages
Hit http://gb.archive.ubuntu.com lucid/multiverse Packages
Hit http://gb.archive.ubuntu.com lucid/main Sources
Hit http://gb.archive.ubuntu.com lucid/universe Sources
Ign http://download.skype.com stable Release
Hit http://security.ubuntu.com lucid-security/restricted Sources
Ign http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu/ lucid/main Translation-en_US
Hit http://ppa.launchpad.net lucid Release.gpg
Ign http://ppa.launchpad.net/webkit-team/ppa/ubuntu/ lucid/main Translation-en_US
Hit http://ppa.launchpad.net lucid Release
Hit http://ppa.launchpad.net lucid Release
Hit http://ppa.launchpad.net lucid Release
Hit http://archive.canonical.com lucid/partner Sources
Hit http://archive.canonical.com lucid/partner Packages
Hit http://gb.archive.ubuntu.com lucid/restricted Sources
Hit http://gb.archive.ubuntu.com lucid/multiverse Sources
Hit http://gb.archive.ubuntu.com lucid-updates/universe Packages
Hit http://gb.archive.ubuntu.com lucid-updates/main Packages
Hit http://gb.archive.ubuntu.com lucid-updates/multiverse Packages
Hit http://gb.archive.ubuntu.com lucid-updates/restricted Packages
Hit http://gb.archive.ubuntu.com lucid-updates/universe Sources
Hit http://gb.archive.ubuntu.com lucid-updates/main Sources
Hit http://gb.archive.ubuntu.com lucid-updates/multiverse Sources
Hit http://ppa.launchpad.net lucid Release
Hit http://ppa.launchpad.net lucid Release
Hit http://ppa.launchpad.net lucid Release
Hit http://ppa.launchpad.net lucid Release
Hit http://ppa.launchpad.net lucid Release
Hit http://ppa.launchpad.net lucid Release
Hit http://download.skype.com stable/non-free Packages
Hit http://ppa.launchpad.net lucid Release
Hit http://ppa.launchpad.net lucid Release
Hit http://ppa.launchpad.net lucid Release
Hit http://gb.archive.ubuntu.com lucid-updates/restricted Sources
Hit http://gb.archive.ubuntu.com lucid-backports/universe Packages
Hit http://gb.archive.ubuntu.com lucid-backports/main Packages
Hit http://gb.archive.ubuntu.com lucid-backports/multiverse Packages
Hit http://gb.archive.ubuntu.com lucid-backports/restricted Packages
Hit http://gb.archive.ubuntu.com lucid-backports/universe Sources
Hit http://ppa.launchpad.net lucid Release
Ign http://packages.medibuntu.org/ lucid/non-free Translation-en_US
Hit http://gb.archive.ubuntu.com lucid-backports/main Sources
Hit http://ppa.launchpad.net lucid Release
Hit http://gb.archive.ubuntu.com lucid-backports/multiverse Sources
Hit http://ppa.launchpad.net lucid Release
Hit http://gb.archive.ubuntu.com lucid-backports/restricted Sources
Hit http://ppa.launchpad.net lucid Release
Hit http://ppa.launchpad.net lucid Release
Hit http://ppa.launchpad.net lucid/main Packages
Hit http://ppa.launchpad.net lucid/main Packages
Hit http://ppa.launchpad.net lucid/main Packages
Hit http://ppa.launchpad.net lucid/main Packages
Hit http://ppa.launchpad.net lucid/main Packages
Hit http://ppa.launchpad.net lucid/main Packages
Hit http://ppa.launchpad.net lucid/main Packages
Hit http://ppa.launchpad.net lucid/main Packages
Hit http://ppa.launchpad.net lucid/main Packages
Hit http://ppa.launchpad.net lucid/main Packages
Hit http://ppa.launchpad.net lucid/main Packages
Hit http://ppa.launchpad.net lucid/main Packages
Hit http://ppa.launchpad.net lucid/main Packages
Hit http://ppa.launchpad.net lucid/main Packages
Hit http://ppa.launchpad.net lucid/main Packages
Hit http://ppa.launchpad.net lucid/main Packages
Hit http://ppa.launchpad.net lucid/main Packages
Hit http://packages.medibuntu.org lucid Release
Ign http://getswiftfox.com unstable Release.gpg
Hit http://download.virtualbox.org lucid Release.gpg
Hit http://packages.medibuntu.org lucid/free Packages
Hit http://packages.medibuntu.org lucid/non-free Packages
Ign http://download.virtualbox.org/virtualbox/debian/ lucid/contrib Translation-en_US
Ign http://getswiftfox.com/builds/debian/ unstable/non-free Translation-en_US
Hit http://packages.medibuntu.org lucid/free Sources
Hit http://download.virtualbox.org lucid Release
Hit http://packages.medibuntu.org lucid/non-free Sources
Ign http://getswiftfox.com unstable Release
Hit http://download.virtualbox.org lucid/contrib Packages
Ign http://getswiftfox.com unstable/non-free Packages
Ign http://getswiftfox.com unstable/non-free Packages
Hit http://getswiftfox.com unstable/non-free Packages
Reading package lists... Done
****@******:~$ sudo apt-get install build-essential git-core checkinstall texi2html libfaac-dev \
> libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev \
> libvorbis-dev libx11-dev libxfixes-dev zlib1g-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
build-essential set to manually installed.
git-core is already the newest version.
checkinstall is already the newest version.
libfaac-dev is already the newest version.
libx11-dev is already the newest version.
libx11-dev set to manually installed.
libxfixes-dev is already the newest version.
libxfixes-dev set to manually installed.
zlib1g-dev is already the newest version.
zlib1g-dev set to manually installed.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libsdl1.2-dev: Depends: libpulse-dev but it is not going to be installed
libvorbis-dev: Depends: libvorbis0a (= 1.2.3-3ubuntu1) but 1.3.1-1ubuntu1~ppa1~lucid1 is to be installed
Depends: libvorbisenc2 (= 1.2.3-3ubuntu1) but 1.3.1-1ubuntu1~ppa1~lucid1 is to be installed
Depends: libvorbisfile3 (= 1.2.3-3ubuntu1) but 1.3.1-1ubuntu1~ppa1~lucid1 is to be installed
I went to synaptic and noticed that I wasn't able to install the files and to me the problem seems to be that there is a version discrepancy in my system. I tried to see where that came from and my suspicion is that I use certain "ppa"s or "builds" of a couple of programs including Pulseaudio. That version incompatibility seems to be the root cause of the problem so far as I can see but as I'm not expert I can't prove that. Why else is it possible that there are stuff in the repository yet I can't install them?!?!

FakeOutdoorsman
November 26th, 2011, 04:15 AM
That's the most PPAs I've ever seen anyone use (I generally avoid them myself). You need to track down which one(s) is causing your problems. mc4man is usually good at navigating issues like this. Maybe he can help pinpoint which repository is to blame.

mc4man
November 26th, 2011, 06:31 AM
^ That's not solving it

I went back and re-read the results and noticed something I overlooked before: that during step 2 things were not exactly going on as planned
libvorbis-dev: Depends: libvorbis0a (= 1.2.3-3ubuntu1) but 1.3.1-1ubuntu1~ppa1~lucid1 is to be installed
Depends: libvorbisenc2 (= 1.2.3-3ubuntu1) but 1.3.1-1ubuntu1~ppa1~lucid1 is to be installed
Depends: libvorbisfile3 (= 1.2.3-3ubuntu1) but 1.3.1-1ubuntu1~ppa1~lucid1 is to be installed
[/CODE]I went to synaptic and noticed that I wasn't able to install the files and to me the problem seems to be that there is a version discrepancy in my system. I tried to see where that came from and my suspicion is that I use certain "ppa"s or "builds" of a couple of programs including Pulseaudio. That version incompatibility seems to be the root cause of the problem so far as I can see but as I'm not expert I can't prove that. Why else is it possible that there are stuff in the repository yet I can't install them?!?!

The vorbis packages you have installed, (blue) are likely from this ppa
https://launchpad.net/~lucid-bleed/+archive/ppa
or this variation of
https://launchpad.net/~lucid-bleed/+archive/lucidbleed-exp

So as it stands you'd need to add either ppa to your sources, then you could install libvorbis-dev OR just go one of the pages, click on "View package details", expand the vorbis entry & download & install libvorbis-dev, it's the same in either ppa

As far as libpulse-dev, who knows..., search out pulse in synaptic & post the complete name of your installed libpulse packages - if you highlight it, > properties you can see & maybe some additional info

Additionally -
In synaptic - click on the "Origin" tab on left side, this will list all your current sources & packages available & installed from - you should be able to figure some things out by highlighting the various ppa's & then seeing what you have installed from them

If you used lucidbleed experimental to upgrade packages previously then you'd probably be better off re-enabling that ppa depending on what you installed from there.

Overall the amount of ppa's you have enabled is fairly ripe ground for trouble, particularly if you've just done 'blanket updates', & not paid attention to what packages may have been replaced.

Jerriy
November 26th, 2011, 03:18 PM
Thanks guys I solved the step2 problems (added the ppa mc4man suggested for the vorbis stuff and downgraded/streamlined the libpulse-dev dependencies and it all went OK.

So I went on with the steps and the next problem showed up during step 5 (http://ubuntuforums.org/showpost.php?p=9868359&postcount=1289):
****@******:~$ sudo apt-get remove libmp3lame-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libmp3lame-dev is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
****@******:~$ sudo apt-get install nasm
Reading package lists... Done
Building dependency tree
Reading state information... Done
nasm is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
****@******:~$ cd
****@******:~$ wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.tar.gz
--2011-11-26 15:02:06-- http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.tar.gz
Connecting to 127.0.0.1:8118... connected.
Proxy request sent, awaiting response... 301 Moved Permanently
Location: http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.tar.gz/download?use_mirror=switch [following]
--2011-11-26 15:02:07-- http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.tar.gz/download?use_mirror=switch
Connecting to 127.0.0.1:8118... connected.
Proxy request sent, awaiting response... 200 OK
Length: 16767 (16K) [text/html]
Saving to: `lame-3.99.tar.gz.2'

100%[================================================== ================================================== =======================>] 16,767 --.-K/s in 0s

2011-11-26 15:02:08 (172 MB/s) - `lame-3.99.tar.gz.2' saved [16767/16767]

****@******:~$ tar xzvf lame-3.99.tar.gz

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Exiting with failure status due to previous errors
****@******:~$ cd lame-3.99
bash: cd: lame-3.99: No such file or directory
****@******:~$ ./configure --enable-nasm --disable-shared
bash: ./configure: No such file or directory
****@******:~$ make
make: *** No targets specified and no makefile found. Stop.
****@******:~$ sudo checkinstall --pkgname=lame-ffmpeg --pkgversion="3.99" --backup=no --default \
> --deldoc=yes

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

*** No known documentation files were found. The new package
*** won't include a documentation directory.

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

This package will be built according to these values:

0 - Maintainer: [ root@****** ]
1 - Summary: [ Package created with checkinstall 1.6.1 ]
2 - Name: [ lame-ffmpeg ]
3 - Version: [ 3.99 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ checkinstall ]
7 - Architecture: [ i386 ]
8 - Source location: [ **** ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ lame-ffmpeg ]

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

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

========================= Installation results ===========================
make: *** No rule to make target `install'. Stop.

*** Installation failed. Aborting package creation.

Cleaning up...OK

Bye.Now what?

ron999
November 26th, 2011, 04:22 PM
Now what?
Connecting to 127.0.0.1:8118... connected.
Proxy request sent, awaiting response... 200 OK
Length: 16767 (16K) [text/html]
Saving to: `lame-3.99.tar.gz.2'

100%[================================================== ================================================== =======================>] 16,767 --.-K/s in 0s

2011-11-26 15:02:08 (172 MB/s) - `lame-3.99.tar.gz.2' saved [16767/16767]

****@******:~$ tar xzvf lame-3.99.tar.gz

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Exiting with failure status due to previous errors

There's a problem unzipping lame.
That's probably because you've already downloaded it and there are probably multiple copies on your hard drive....
lame-3.99.tar.gz
lame-3.99.tar.gz.1
lame-3.99.tar.gz.2
etc.

So look for all these lame tar.gz files and delete them, then try again from:-

wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.tar.gz

Jerriy
November 26th, 2011, 05:32 PM
^ I did that and that went well but then the very next line of instruction failed:
****@******:~$ tar xzvf lame-3.99.tar.gz

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Exiting with failure status due to previous errors
****@******:~$ cd lame-3.99
bash: cd: lame-3.99: No such file or directory
****@******:~$ ./configure --enable-nasm --disable-shared
bash: ./configure: No such file or directory
****@******:~$ make
make: *** No targets specified and no makefile found. Stop.
****@******:~$ sudo checkinstall --pkgname=lame-ffmpeg --pkgversion="3.99" --backup=no --default \
> --deldoc=yes

ron999
November 26th, 2011, 05:49 PM
Works for me.

mc4man
November 26th, 2011, 06:20 PM
Jerriy - try step 5 like this, then maybe you can move along, copy & paste the complete code box as 1 command


cd
mkdir -p lame_build; cd lame_build; \
wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.tar.gz; \
tar xzvf lame-3.99.tar.gz; cd lame-3.99; \
./configure --enable-nasm --disable-shared; \
make; sudo checkinstall --pkgname=lame-ffmpeg --pkgversion="3.99" --backup=no \
--default --deldoc=yes

Jerriy
November 26th, 2011, 08:59 PM
^ That was to no avail:
****@******:~$ cd
****@******:~$ mkdir -p lame_build; cd lame_build; \
> wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.tar.gz; \
> tar xzvf lame-3.99.tar.gz; cd lame-3.99; \
> ./configure --enable-nasm --disable-shared; \
> make; sudo checkinstall --pkgname=lame-ffmpeg --pkgversion="3.99" --backup=no \
> --default --deldoc=yes
--2011-11-26 19:33:59-- http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.tar.gz
Connecting to 127.0.0.1:8118... connected.
Proxy request sent, awaiting response... 301 Moved Permanently
Location: http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.tar.gz/download?use_mirror=netcologne [following]
--2011-11-26 19:34:00-- http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.tar.gz/download?use_mirror=netcologne
Connecting to 127.0.0.1:8118... connected.
Proxy request sent, awaiting response... 200 OK
Length: 16823 (16K) [text/html]
Saving to: `lame-3.99.tar.gz'

100%[================================================== ================================================== ========================>] 16,823 --.-K/s in 0s

2011-11-26 19:34:01 (159 MB/s) - `lame-3.99.tar.gz' saved [16823/16823]


gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Exiting with failure status due to previous errors
bash: cd: lame-3.99: No such file or directory
bash: ./configure: No such file or directory
make: *** No targets specified and no makefile found. Stop.
[sudo] password for ****:

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

*** No known documentation files were found. The new package
*** won't include a documentation directory.

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

This package will be built according to these values:

0 - Maintainer: [ root@****** ]
1 - Summary: [ Package created with checkinstall 1.6.1 ]
2 - Name: [ lame-ffmpeg ]
3 - Version: [ 3.99 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ checkinstall ]
7 - Architecture: [ i386 ]
8 - Source location: [ lame_build ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ lame-ffmpeg ]

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

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

========================= Installation results ===========================
make: *** No rule to make target `install'. Stop.

**** Installation failed. Aborting package creation.

Cleaning up...OK

Bye.

****@******:~/lame_build$ cd
****@******:~$ mkdir -p lame_build; cd lame_build; \
> wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.tar.gz; \
> tar xzvf lame-3.99.tar.gz; cd lame-3.99; \
> ./configure --enable-nasm --disable-shared; \
> make; sudo checkinstall --pkgname=lame-ffmpeg --pkgversion="3.99" --backup=no \
> --default --deldoc=yes
--2011-11-26 20:55:41-- http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.tar.gz
Connecting to 127.0.0.1:8118... connected.
Proxy request sent, awaiting response... 301 Moved Permanently
Location: http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.tar.gz/download?use_mirror=heanet [following]
--2011-11-26 20:55:42-- http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.tar.gz/download?use_mirror=heanet
Connecting to 127.0.0.1:8118... connected.
Proxy request sent, awaiting response... 200 OK
Length: 16760 (16K) [text/html]
Saving to: `lame-3.99.tar.gz'

100%[================================================== ================================================== ========================>] 16,760 --.-K/s in 0s

2011-11-26 20:55:43 (139 MB/s) - `lame-3.99.tar.gz' saved [16760/16760]


gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Exiting with failure status due to previous errors
bash: cd: lame-3.99: No such file or directory
bash: ./configure: No such file or directory
make: *** No targets specified and no makefile found. Stop.
[sudo] password for ****:

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

*** No known documentation files were found. The new package
*** won't include a documentation directory.

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

This package will be built according to these values:

0 - Maintainer: [ root@****** ]
1 - Summary: [ Package created with checkinstall 1.6.1 ]
2 - Name: [ lame-ffmpeg ]
3 - Version: [ 3.99 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ checkinstall ]
7 - Architecture: [ i386 ]
8 - Source location: [ lame_build ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ lame-ffmpeg ]

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

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

========================= Installation results ===========================
make: *** No rule to make target `install'. Stop.

*** Installation failed. Aborting package creation.

Cleaning up...OK

Bye.

mc4man
November 26th, 2011, 09:20 PM
Then maybe just open the folder with lame-3.99.tar.gz, r. click on > extract here & then proceed from at the lame-3.99 prompt


./configure --enable-nasm --disable-shared; \
make; sudo checkinstall --pkgname=lame-ffmpeg --pkgversion="3.99" --backup=no \
--default --deldoc=yes

Or try changing the tar command posted above or from step 5 to
tar xvf lame-3.99.tar.gz

Jerriy
November 26th, 2011, 10:57 PM
I can't seem to be able to extract "lame-3.99.tar.gz" in any folder or even desktop

qyot27
November 26th, 2011, 11:01 PM
The problem is that the lame tarball isn't being downloaded at all. The size isn't right, which confirms this (the tarball isn't 16KB, but an HTML error page certainly is - hence the reason it complains about the file not being in gzip format).

Compare filesizes:
2011-11-26 19:34:01 (159 MB/s) - `lame-3.99.tar.gz' saved [16823/16823]

And then me, having downloaded lame-3.99.tar.gz from the provided link above:
2011-11-26 16:57:07 (466 KB/s) - `lame-3.99.tar.gz' saved [1441166/1441166]

The difference is that mine correctly downloaded, and hence really is a tarball, and it extracts fine. Check the proxy settings you're using, or just bypass the problem entirely and download the tarball through your web browser.

Jerriy
November 27th, 2011, 12:12 AM
qyot27, yes that's the case. So I went directly to the sourceforge via my browser and downloaded it and it worked!....

Then I went thru the instructions until step 7 (http://ubuntuforums.org/showpost.php?p=9868359&postcount=1289) and then (you guessed it!) the next mysterious problem showed up that I'm at a loss to solve:

****@******:~/libvpx$ cd
****@******:~$ git clone --depth 1 git://source.ffmpeg.org/ffmpeg
fatal: destination path 'ffmpeg' already exists and is not an empty directory.
****@******:~$ cd ffmpeg
****@******:~/ffmpeg$ ./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb \
> --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx \
> --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
ERROR: libvpx decoder version must be >=0.9.1

If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org 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.
****@******:~/ffmpeg$ make
Makefile:2: config.mak: No such file or directory
Makefile:45: /common.mak: No such file or directory
Makefile:82: /libavutil/Makefile: No such file or directory
Makefile:148: /doc/Makefile: No such file or directory
Makefile:149: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'. Stop.
****@******:~/ffmpeg$ sudo checkinstall --pkgname=ffmpeg --pkgversion="5:$(./version.sh)" --backup=no \
> --deldoc=yes --default

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



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

This package will be built according to these values:

0 - Maintainer: [ root@****** ]
1 - Summary: [ Package created with checkinstall 1.6.1 ]
2 - Name: [ ffmpeg ]
3 - Version: [ 5:N-31031-g022f8d2 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ checkinstall ]
7 - Architecture: [ i386 ]
8 - Source location: [ ffmpeg ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ ffmpeg ]

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

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

========================= Installation results ===========================
Makefile:2: config.mak: No such file or directory
Makefile:45: /common.mak: No such file or directory
Makefile:82: /libavutil/Makefile: No such file or directory
Makefile:148: /doc/Makefile: No such file or directory
Makefile:149: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'. Stop.

**** Installation failed. Aborting package creation.

Cleaning up...OK

Bye.

qyot27
November 27th, 2011, 01:20 AM
ERROR: libvpx decoder version must be >=0.9.1
Did Step 6 complete successfully? That should have taken care of the issue of making sure libvpx was at or above version 0.9.1. Otherwise, I'd think it a problem with a repository version of libvpx-dev (or whatever the exact package name is) not being new enough.

The solution would likely be to 'completely remove' (sudo apt-get purge if using the Terminal) the libvpx packages and then do Step 6 again.

PDA1
November 27th, 2011, 02:05 AM
I figured it out!

This is amazing- the width problem is solved simply by changing the Video Settings on the iPod itself.

In Video---Settings----turn OFF "fit to full screen" (or whatever it's called).

Jerriy
November 27th, 2011, 03:06 AM
Did Step 6 complete successfully? I guess not, so I purged it and installed that then voila! all went well. I think that has been the cause of some of my previous problems as well: every time I resume installation I should have purged everything incl folders that was installed and not only do the delete stuff mentioned in "step one".

Anyways, now step 6 and 7 completed, which means I have FFMPEG installed, yay!

Now let's see if it all works :o

popper
November 27th, 2011, 04:31 PM
I figured it out!

This is amazing- the width problem is solved simply by changing the Video Settings on the iPod itself.

In Video---Settings----turn OFF "fit to full screen" (or whatever it's called).

LOL yes but did you re-code any video with that line i gave you for yourself to try....

heres that windows bat file with the working line 3 pages back BTW, if any Linux bash writer reading wants to help you out and convert it to the equivalent Linux use.so you dont need to use windows again :)

just make the bat, call it say multi-encode.bat or whatever, make an empty dir on the top of your USB stick , put the bat,your ffmpeg/avconv
the current windows http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-git-2c44aed-win32-static.7z will be fine* for that OS until someone converts the bat to linux bash then you can use this threads linux ffmpeg (static version) on there OC) and ALL your files for conversion in there.

make another dir in there called \encoded in this case as thats where the bat will want to locally save all its encodes, and change the ("%srcPATH%*.mkv") part of the bat to whatever your files extension is if not .mkv , double click the multi-encode.bat to start it off and forget about it till its done all the files in that dir for you ( and OC using a quirk of windows bat you get to have the "iPod-160G-Classic-" pre-pended to all your files :) )

the REM at the end of the script is just for reference as i cant usually be bothered to open another txt file with all the cheat sheets options etc :D

.....cut
@echo on

set srcPATH=.\
set dstPATH=.\encoded\iPod-160G-Classic-

FOR %%A in ("%srcPATH%*.mkv") DO (
avconv.exe -threads 4 -i "%%A" -f mp4 -vcodec libx264 -crf 18 -minrate 600k -maxrate 1500k -bufsize 1500k -refs 3 -preset slow -vprofile Baseline -level 3.0 -flags2 -bpyramid -wpredp 0 -strict experimental -acodec aac -ac 2 -ab 128k -vf hqdn3d,unsharp=5:5:0.5,scale=640:480 "%dstPATH%%%~nA.MP4"
)
pause

REM -vf yadif, gradfun, hqdn3d, unsharp=5:5:0.5, setdar=16:9, scale=640:480

...cut

* actually that http://ffmpeg.zeranoe.com/builds/ is worth a second look as they auto build that windows version with Linux Ubuntu Desktop 10.04 http://ffmpeg.zeranoe.com/builds/readme/win32/static/ffmpeg-git-2c44aed-win32-static-readme.txt and always keep the Current Zeranoe FFmpeg Builds External Libraries and External Libraries Source Code links at the most current so could be useful for making an auto build script for this thread etc...

beew
November 28th, 2011, 01:15 AM
Hi,

Sorry if this is the wrong thread but I think it has something to do with ffmpeg, which I compiled using this great guide I was trying to build bino on Ubuntu 11.10 and got stuck, the "make" command produced this


mb@oot:~$ cd bino
mb@oot:~/bino$ make
make all-recursive
make[1]: Entering directory `/home/mb/bino'
Making all in po
make[2]: Entering directory `/home/mb/bino/po'
make[2]: Leaving directory `/home/mb/bino/po'
Making all in src
make[2]: Entering directory `/home/mb/bino/src'
make all-recursive
make[3]: Entering directory `/home/mb/bino/src'
Making all in base
make[4]: Entering directory `/home/mb/bino/src/base'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/mb/bino/src/base'
make[4]: Entering directory `/home/mb/bino/src'
CXXLD bino
/usr/local/lib/libavdevice.a(lavfi.o): In function `lavfi_read_packet':
/home/mb/ffmpeg/libavdevice/lavfi.c:275: undefined reference to `av_buffersink_get_buffer_ref'
/home/mb/ffmpeg/libavdevice/lavfi.c:289: undefined reference to `av_buffersink_get_buffer_ref'
/home/mb/ffmpeg/libavdevice/lavfi.c:315: undefined reference to `avfilter_unref_buffer'
/usr/local/lib/libavdevice.a(lavfi.o): In function `lavfi_read_close':
/home/mb/ffmpeg/libavdevice/lavfi.c:73: undefined reference to `avfilter_graph_free'
/usr/local/lib/libavdevice.a(lavfi.o): In function `lavfi_read_header':
/home/mb/ffmpeg/libavdevice/lavfi.c:90: undefined reference to `avfilter_register_all'
/home/mb/ffmpeg/libavdevice/lavfi.c:92: undefined reference to `avfilter_get_by_name'
/home/mb/ffmpeg/libavdevice/lavfi.c:93: undefined reference to `avfilter_get_by_name'
/home/mb/ffmpeg/libavdevice/lavfi.c:99: undefined reference to `avfilter_graph_alloc'
/home/mb/ffmpeg/libavdevice/lavfi.c:102: undefined reference to `avfilter_graph_parse'
/home/mb/ffmpeg/libavdevice/lavfi.c:186: undefined reference to `av_buffersink_params_alloc'
/home/mb/ffmpeg/libavdevice/lavfi.c:190: undefined reference to `avfilter_graph_create_filter'
/home/mb/ffmpeg/libavdevice/lavfi.c:207: undefined reference to `av_abuffersink_params_alloc'
/home/mb/ffmpeg/libavdevice/lavfi.c:210: undefined reference to `avfilter_all_channel_layouts'
/home/mb/ffmpeg/libavdevice/lavfi.c:212: undefined reference to `avfilter_graph_create_filter'
/home/mb/ffmpeg/libavdevice/lavfi.c:221: undefined reference to `avfilter_link'
/home/mb/ffmpeg/libavdevice/lavfi.c:226: undefined reference to `avfilter_graph_config'
/home/mb/ffmpeg/libavdevice/lavfi.c:254: undefined reference to `avfilter_inout_free'
/home/mb/ffmpeg/libavdevice/lavfi.c:255: undefined reference to `avfilter_inout_free'
collect2: ld returned 1 exit status
make[4]: *** [bino] Error 1
make[4]: Leaving directory `/home/mb/bino/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/mb/bino/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/mb/bino/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mb/bino'
make: *** [all] Error 2



On the other hand installing bino from ppa which dynamically links to ffmpeg works without problem.

Thanks in advance for any help.

FakeOutdoorsman
November 28th, 2011, 02:04 AM
I'm guessing that Bino probably needs to be updated to use FFmpeg Git. Either use an older FFmpeg (I'd try FFmpeg 0.8.7), or submit a bug report (http://savannah.nongnu.org/bugs/?func=additem&group=bino) to the Bino bug tracker.

Erik1984
November 30th, 2011, 11:15 AM
Great guide! Followed the instructions on Lucid and it worked. However when building ffmpeg the compiler drops lots of warnings like:


ffserver.c:4236: warning: ‘avcodec_get_context_defaults2’ is deprecated (declared at ./libavcodec/avcodec.h:3818)


Yeah I know it are warnings not errors and ffmpeg just seems to work but is it normal to get so many warnings?

PDA1
November 30th, 2011, 02:35 PM
I did several attempted installs on one of my computers and met with failure in all of them UNTIL I treated each step of the EXCELLENT GUIDE at http://ubuntuforums.org/showpost.php?p=9868359&postcount=1289 as individual steps.

Here's what I mean;

The following is Step 7 for the Lucid installation




cd git clone --depth 1 git://source.ffmpeg.org/ffmpeg cd ffmpeg ./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb \ --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx \ --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab make sudo checkinstall --pkgname=ffmpeg --pkgversion="5:$(./version.sh)" --backup=no \ --deldoc=yes --default hash x264 ffmpeg ffplay ffprobe
No matter how hard I tried FFMPEG would not be successfully installed using the above code entered in one Paste into Terminal.

So, this is how I entered the above code into Terminal;



cd
Then....



git clone --depth 1 git://source.ffmpeg.org/ffmpeg
Then....


cd ffmpeg
Then....

./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb \ --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx \ --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
Then....




make

Then....

sudo checkinstall --pkgname=ffmpeg --pkgversion="5:$(./version.sh)" --backup=no \ --deldoc=yes --defaultFinally....


hash x264 ffmpeg ffplay ffprobe
Like I said....no matter how many times I tried to install FFMPEG using the blocks of code in each of the Guide's steps the installation would never succeed. The reason could be because my computer is old or something similar.

FakeOutdoorsman
November 30th, 2011, 07:12 PM
...is it normal to get so many warnings?

It is normal. If they are particularly annoying then upstream will gladly accept any patches to correctly silence them.

qyot27
December 1st, 2011, 06:22 AM
I did several attempted installs on one of my computers and met with failure in all of them UNTIL I treated each step of the EXCELLENT GUIDE at http://ubuntuforums.org/showpost.php?p=9868359&postcount=1289 as individual steps.

[snip]

Like I said....no matter how many times I tried to install FFMPEG using the blocks of code in each of the Guide's steps the installation would never succeed. The reason could be because my computer is old or something similar.
That's because the guide isn't meant to copy/paste the entire code block at once. The only multiple-lined instructions that can be copy-pasted are the ones with \ in them, because \ allows a new line to be used without interrupting a singular command.

But it is possible to do it all at once. You just need to join the commands with &&, like this (I also used \ to increase readability; if you don't want to use the \, just make sure there aren't any new lines separating the && and the next command):

git clone --depth 1 git://source.ffmpeg.org/ffmpeg && \
cd ffmpeg && \
./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb \
--enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx \
--enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab && \
make && \
sudo checkinstall --pkgname=ffmpeg --pkgversion="5:$(./version.sh)" --backup=no \
--deldoc=yes --default && \
hash x264 ffmpeg ffplay ffprobe

The quick version:

make && make install
Is the same as running make, and then running make install after make is finished.

FakeOutdoorsman
December 1st, 2011, 07:10 PM
The FFmpeg Filtering Guide (https://ffmpeg.org/trac/ffmpeg/wiki/FilteringGuide) was created yesterday on the FFmpeg Bug Tracker and Wiki (https://ffmpeg.org/trac/ffmpeg/). The page is somewhat disorganized, but I think it will be a good place to save various filtering examples and tips. If you would like to add something just register (https://ffmpeg.org/trac/ffmpeg/register) and then simply edit the page. This page was created for users to edit, so don't hesitate to contribute (and additions can be reverted if you are afraid of breaking things).

popper
December 2nd, 2011, 01:22 PM
PDA1.

why are you asking the same questions yesterday about getting a working ffmpeg line in
http://ffmpeg.org/pipermail/ffmpeg-user/2011-December/003431.html

i thought you said the iPod 640x480 line i worked out for your device was working perfectly fine.... days ago?:confused:

and why are you still using the old -vpre syntax there when i gave you the current
newer internal -preset -vprofile etc syntax to use

rulet
December 7th, 2011, 08:15 AM
Hello, I have this error with missing preset:


r@ngf:~/Рабочий стол/1$ ffmpeg -i 1.mp4 -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre slow -crf 22 -threads 0 2.mp4
ffmpeg version git-2011-12-04-f88d5df, Copyright (c) 2000-2011 the FFmpeg developers
built on Dec 4 2011 11:21:47 with gcc 4.6.1
configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-libvpx
libavutil 51. 30. 0 / 51. 30. 0
libavcodec 53. 40. 0 / 53. 40. 0
libavformat 53. 24. 0 / 53. 24. 0
libavdevice 53. 4. 0 / 53. 4. 0
libavfilter 2. 50. 0 / 2. 50. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 1970-01-01 00:00:00
encoder : Lavf53.24.0
Duration: 06:35:03.80, start: 0.000000, bitrate: 198 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 800x596, 66 kb/s, 15 fps, 15 tbr, 15 tbn, 30 tbc
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 127 kb/s
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name :
File for preset 'slow' not found

popper
December 7th, 2011, 09:58 AM
Hello, I have this error with missing preset:
built on Dec 4 2011 11:21:47 with gcc 4.6.1

File for preset 'slow' not found


" -vpre slow" is the old syntax.... its replaced with the internal " -preset slow" now , you might also want to add a "-vprofile high" to the line if you care about better visual quality too, or even add some filters.

-vf gradfun,hqdn3d,unsharp=5:5:0.5,setdar=16:9
works nicely on just about all DAR (display aspect ratio) 16:9 ration videos, replace setdar=16:9 with =4:3 were required or remove the ,setdar= filter if you have other ratio input files to re-code, hqdn3d and especially unsharp=5:5:0.5 having the most notable visually improved quality effect IMO, try them and compare.

rulet
December 7th, 2011, 10:21 AM
Thanks for the answer, -preset slow works. I just need recoding for compession for now, in other words, the most smallest file with the best quality. Maybe you have any ideas how to compress it better then in that command which I've wrote.

popper
December 7th, 2011, 10:59 AM
Thanks for the answer, -preset slow works. I just need recoding for compession for now, in other words, the most smallest file with the best quality. Maybe you have any ideas how to compress it better then in that command which I've wrote.


some people don't seem to like my answer to that one :) as they prefer unrestricted bit-rate within the confines of the CRF setting and wasting drive space needlessly , BUT if you want to give it a try i do this all the time and its fine for everyday use (not for archiving or a first backup OC) remove the minrate., maxrate etc for these one off keeps;)

ffmpeg.exe -threads 4 -i "inputfile.whatever" -f mp4 -vcodec libx264 -crf 18 -minrate 800k -maxrate 900k -bufsize 900k -refs 3 -preset fast -vprofile high -flags2 -bpyramid -wpredp 0 -strict experimental -acodec aac -ac 2 -ab 128k -vf gradfun,hqdn3d,unsharp=5:5:0.5 "outfile.MP4"

ffmpeg.exe -threads 4 -i "inputfile.whatever" -f mp4 -vcodec libx264 -crf 18 -minrate 800k -maxrate 1500k -bufsize 1500k -refs 3 -preset fast -vprofile high -flags2 -bpyramid -wpredp 0 -strict experimental -acodec aac -ac 2 -ab 128k -vf gradfun,hqdn3d,unsharp=5:5:0.5 "outfile.MP4"

ffmpeg.exe -threads 4 -i "inputfile.whatever" -f mp4 -vcodec libx264 -crf 16 -minrate 800k -maxrate 2000k -bufsize 2000k -refs 3 -preset fast -vprofile high -flags2 -bpyramid -wpredp 0 -strict experimental -acodec aac -ac 2 -ab 128k -vf gradfun,hqdn3d,unsharp=5:5:0.5 "outfile.MP4"

as you can see only the maxrate and bufsize change and match each other for simplicity of a seconds worth of buffering.

and you get a larger file with each change, i find 900k , 1100k and 1300k to be fine for most web streaming and every day use ,and thats also why the combined
" -flags2 -bpyramid -wpredp 0" are there for the older VLC browser plugin to be able to play the -vprofile high produced output files....

and notice how i use CRF 18 or even lower... as the min/max resticts that anyway so trying to keep as good a visual quality as it can.

also notice how i don't even try and re-scale the input on purpose, as i don't like the jaggys that always produces, just lowering the max bit-rate is perfectly fine in my book to whatever limit you prefer for a given input file.

for things like David Attenborough Frozen Planet 1080P TS you might want to use the -maxrate1600k to 2500k range OC if you care to reduce that down for good every day visual playback on less powerful old single core laptops etc, works for me :)

rulet
December 7th, 2011, 11:26 AM
Well, I tried your first command


ffmpeg -threads 4 -i "inputfile.whatever" -f mp4 -vcodec libx264 -crf 18 -minrate 800k -maxrate 900k -bufsize 900k -refs 3 -preset fast -vprofile high -flags2 -bpyramid -wpredp 0 -strict experimental -acodec aac -ac 2 -ab 128k -vf gradfun,hqdn3d,unsharp=5:5:0.5 "outfile.MP4"

but that's even makes larger file then with that command that I used before. Seems like the video-file is already compessed as it possible with normal quality.

qyot27
December 7th, 2011, 11:43 AM
Faster presets = lower quality at same filesize or larger filesize for same quality, considering the use of CRF. Use a slower preset if you want to maintain the quality with a smaller filesize.

There's also the option of using 10-bit H.264 (requires a 10-bit build of x264), and/or using Wine in order to have access to AviSynth and thereby get better filtering possibilities.

popper
December 7th, 2011, 11:55 AM
Faster presets = lower quality at same filesize or larger filesize for same quality, considering the use of CRF. Use a slower preset if you want to maintain the quality with a smaller filesize.

There's also the option of using 10-bit H.264 (requires a 10-bit build of x264), and/or using Wine in order to have access to AviSynth and thereby get better filtering possibilities.

ohh yeah forgot that and was looking at an older script of mine, so -preset slow or -preset slower will be better but take more time to finish so try those too OC


actually talking about AviSynth , do you/anyone have or can make a working self contained rar of the needed files and how-to text using Wine ,as using that with QTGMC de-interlace script will produce far greater quality But far slower even on a i5 sandy bridge , than the internal ffmpeg jaggy "yadif" de-interlace filter, assuming OC that the QTGMC etc even work's on Linux/Wine.

and some better de-ringing advice for working avisynth scripts rather than using the internal ffmpeg/avconv gradfun filter as its not very good but all we have really

popper
December 7th, 2011, 01:11 PM
Well, I tried your first command


but that's even makes larger file then with that command that I used before. Seems like the video-file is already compessed as it possible with normal quality.

that doesn't really surprise me given the smaller oddball re-scaled
Video: h264 (High) (avc1 / 0x31637661), yuv420p, 800x596, 66 kb/s, 15 fps, 15 tbr, 15 tbn, 30 tbc

i don't really like re-scaled anything as it usually looks crap when played back on generic full screen monitors etc , unless it's to make it actually play on a given device that cant take generic dvd/BR sizes of 16:9/4:3 ratio files such as the mac device a few pages back. but hows the -preset slower looking, still larger or the same size now as your original line, what about the quality at full screen size, the same, better,worse ?

qyot27
December 7th, 2011, 02:13 PM
actually talking about AviSynth , do you/anyone have or can make a working self contained rar of the needed files and how-to text using Wine ,as using that with QTGMC de-interlace script will produce far greater quality But far slower even on a i5 sandy bridge , than the internal ffmpeg jaggy "yadif" de-interlace filter, assuming OC that the QTGMC etc even work's.
I rarely ever purely deinterlace things and my computer is far too slow (P3 Coppermine-based Celeron) to even attempt to use QTGMC - I still rely on TDeint or TomsMoComp. Heck, it takes 45-50 minutes for me to just build FFmpeg on here (the entire basic FFmpeg->FFMS2->x264 8/9/10bit->full FFmpeg process takes something on the order of 3 hours).

What I would recommend is - if one has access to Windows - to get all their needed AviSynth plugins worked out there, and then just copy them over to the same folder under Wine. If something doesn't work, then refer to the AviSynth MediaWiki to find alternatives that do. Of course, if one's first experiences with AviSynth are under Linux it would be virtually the same - just that you have to keep in mind Wine's organization hierarchy. It helps to add a bookmark to drive_c in Nautilus' or PCManFM's sidebar (Konqueror and Dolphin probably have a similar feature but I've not used KDE in a couple years) so you can just jump right there if needed.

The single biggest thing (to my knowledge) that AviSynth-under-Wine lacks is the use of DirectShowSource, since Wine can't use DirectShow. AVISource will work so long as ffdshow's VFW interface is installed and configured*, and MPEG2Source (an SSE-optimized version of DGDecode.dll is available on the main HCenc release page), FFmpegSource 1.x, and FFMS2 will all work since they're self-contained.

*I would suggest doing this on Windows and telling ffdshow to export the settings to a .reg file. The .reg can then be imported into Wine's regedit. This is because ffdshow's decoders can't be configured under Wine, or at least they couldn't last time I checked.


and some better de-ringing advice for working avisynth scripts rather than using the internal ffmpeg/avconv gradfun filter as its not very good but all we have really
For debanding, I used to use gradfun2db, but have since moved to flash3kyuu_deband (especially since it can output in higher bit depths, and if x264 has been patched to accept high bit depths coming from AviSynth, then it's a pretty straightforward process to maintain a high bit depth workflow - note that that only works with Windows builds of x264 since Linux builds can't take AVS input at all).