Page 2 of 3

Re: Simple Howto for re-encoding (bluray) MKV's (linux)

Posted: Tue Jun 29, 2010 5:17 pm
by ridewithstyle

Re: Simple Howto for re-encoding (bluray) MKV's (linux)

Posted: Tue Jun 29, 2010 5:46 pm
by crowfax
You'll notice I said "last supported version" and not "latest version". Currently watching the development on the nightly PPA from here:

Code: Select all

## handbrake snapshots - Maintainer: John Stebbins
deb http://ppa.launchpad.net/stebbins/handbrake-snapshots/ubuntu lucid main
deb-src http://ppa.launchpad.net/stebbins/handbrake-snapshots/ubuntu lucid main
Most of the changes appear to be GUI-centric, I can't speak as to how up-to-date the x264 encoder is, but building it yourself will always give you a newer revision! :D

Re: Simple Howto for re-encoding (bluray) MKV's (linux)

Posted: Tue Jun 29, 2010 5:52 pm
by ridewithstyle
yep, I did. Should've been clearer though ;-)

I'm using the stebbins ppa as well, seem like I somehow googled too sloppy. Thanks for pointing that out

Re: Simple Howto for re-encoding (bluray) MKV's (linux)

Posted: Tue Jun 29, 2010 7:19 pm
by skittle
handbrake is ok, but i prefer to have latest x264 and really the CLI is not that hard to use anymore!

Re: Simple Howto for re-encoding (bluray) MKV's (linux)

Posted: Sat Jul 03, 2010 4:46 pm
by aravenel
I'm getting the following error when trying to compile ffmpeg. Any ideas?

Code: Select all

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

Re: Simple Howto for re-encoding (bluray) MKV's (linux)

Posted: Sat Jul 03, 2010 6:28 pm
by skittle
Hi, I am able to reproduce the error, which is probably a bug in ffmpeg. in the mean time, checkout a previous version of ffmpeg!
revision from 2010-06-01 works for me

Code: Select all

svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk --revision {2010-06-01} ffmpeg
Of course your welcome to try newer revision until it breaks :p

Re: Simple Howto for re-encoding (bluray) MKV's (linux)

Posted: Sat Jul 03, 2010 6:39 pm
by aravenel
That did it! Thanks for the help... Don't know why I didn't think to try an older version, I feel a bit silly now.

FYI, looks like there is a bug listed by ffmpeg for just this error: https://roundup.ffmpeg.org/issue2042

Hopefully they'll fix it soon!

Re: Simple Howto for re-encoding (bluray) MKV's (linux)

Posted: Sat Jul 03, 2010 8:08 pm
by skittle
talking with ffmpeg dev's, its likely because of so much disabled stuff. So try to fix it, i disable everything by default and enable only what we want!
please try the new command line in the first post!

Re: Simple Howto for re-encoding (bluray) MKV's (linux)

Posted: Sun Jul 04, 2010 4:00 pm
by aravenel
The updated ./configure seems to work for me. FYI, you have a typo in it though--it says "--enable-ecoder", when it should be "--enable-encoder".

Thanks for the quick response!

A couple of quick questions:
  • If we're only calling x264 in the encode (not resizing or piping), does ffmpeg still need to be installed? Just trying to figure out how all this works.
  • I've seen other guides where folks called ffmpeg or mencoder to do a similar encode. What's the difference between doing that and using x264 like this?
  • Where does x264 generate it's log file? The first file I tried this one seems to have quit about 2/3 through the film, but there was no useful error on the terminal--it just said "Killedframes", listed the number of encoded frames, and then dumped back to console.
Here's the output from x264:

Code: Select all

ravenel@Galadriel:/myth/video/MakeMKV/Quantum of Solace$ x264 title01.mkv --preset slow --crf 20 --tune film --level 41 --output Quantum\ of\ Solace-x264.mkv
[matroska @ 0x1c82420]Estimating duration from bitrate, this may be inaccurate
lavf [info]: 1920x1080p 1:1 @ 24000/1001 fps (vfr)
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast FastShuffle SSEMisalign LZCNT
x264 [info]: profile High, level 4.1
Killedframes: 3.68 fps, 12379.96 kb/s  

Re: Simple Howto for re-encoding (bluray) MKV's (linux)

Posted: Sun Jul 04, 2010 6:34 pm
by skittle
To be more clear, we are compiling x264 with ffmpegsource2, which depends on ffmpeg. x264 by its self can only read raw files. ffms2 provides frame accurate input for x264. So we only want to compile ffmpeg for decoding video tracks, and disable everything else. If you want to pipe from mplayer to x264, then you can skip the whole ffmpeg process :)
http://code.google.com/p/ffmpegsource/

and actually it should be --enable-decoder
thanks for finding the typo!

edit3: the new command line:

Code: Select all

./configure --disable-everything --enable-gpl --enable-postproc --enable-protocols --enable-demuxer=matroska,ogg,avi,h264,mov,m4v,mpegts,mpegvideo --enable-decoder=h264,vc1,wmv*,mpeg2video,mpeg1video,mpeg4,theora,vp8 --enable-parser=h264,mpeg4video,mpegvideo,vc1,vp8
now works.

The culprit was --enable-protocols, sorry for all the trouble!

Re: Simple Howto for re-encoding (bluray) MKV's (linux)

Posted: Mon Jul 05, 2010 3:02 pm
by aravenel
Thanks, I'll give that a shot.

Is there a logfile created anywhere that I can look at to get more info as to why this might be failing 2/3 through? Any idea why x264 could be having so much trouble with the MakeMKV generated file?

Re: Simple Howto for re-encoding (bluray) MKV's (linux)

Posted: Tue Jul 06, 2010 6:09 am
by skittle
x264 does not log by default.

Code: Select all

--log-level <string>    Specify the maximum level of logging ["info"]
                                  - none, error, warning, info, debug
then redirect console output to a file. i think though, that it is likely because of previous broken x264 build with the previous bad command line!

if it still doesnt work after update please use x264 --version and x264 --fullhelp to make sure that:
a)x264 was compiled by you
b)compiled correctly with ffms2 support

Re: Simple Howto for re-encoding (bluray) MKV's (linux)

Posted: Tue Jul 06, 2010 1:15 pm
by aravenel
Knock on wood, but I *think* it worked--at the least, it made it all the way through without failing, and there's no obvious distortion/artifacts--far better than the last time around!

So my next question is this--we compiled ffmpeg with almost everything disabled. Why not just enable everything? What if I were to recompile with everything enabled? Would it still work? I ask because I'm concerned that in the future, some other application will require a part of ffmpeg that we disabled. I haven't noticed anything failing right now, but I'm just trying to figure out how all of this works.

Thanks again, this is a fantastically helpful guide!

Re: Simple Howto for re-encoding (bluray) MKV's (linux)

Posted: Tue Jul 06, 2010 5:01 pm
by skittle
You can safely delete/over write the ffmpeg binaries with a full ffmpeg install in the future if you want. ffms2 and x264 do not need ffmpeg binaries once they are compiled.

as for turning options off, its for two reasons:
WAY smaller/faster binary, and we absolutely do not want ffms2 to be compiled with audio. plus the other options reccommneded here: http://ffmpegsource.googlecode.com/svn/ ... 2-api.html
In the past most people explicetely turn off a lot of options (this leads to a huge unreadable command line) but this recently broke with ffmpeg. I think its easier and more readable to disable everything, and explicetely enable only the stuff you want!

ps: i thought that the bad ffmpeg config might be the issue, im surpised it compiled at all for you :|
pss: If your encoding from bluray, please please use --colormatrix bt709

Re: Simple Howto for re-encoding (bluray) MKV's (linux)

Posted: Mon Aug 23, 2010 9:13 am
by ccc38941
Can you post files need and the file to run?