Open Source, Embedded Systems, Computer Vision, Computational Photography, Self-Improvement
Showing posts with label x264. Show all posts
Showing posts with label x264. Show all posts
Tuesday, February 28, 2012
Tuesday, February 14, 2012
Converting AVI to YUV to H264
Using FFMPEG to transcode directly from AVI/MJPEG won't work:
$ ffmpeg -i input.avi -vcodec libx264 output.mp4
Still trying to get the commands from the following article to work:
http://www.linuxjournal.com/article/9005
$ mencoder -vf format=i420 -nosound -ovc raw -of rawvideo -ofps 24 -o tmp.yuv input.avi
$ x264 -o output.mp4 --fps 24 --bframes 2 --crf 26 --subme 6 --analyse p8x8,b8x8,i4x4,p4x4 --input-res 720x480 tmp.yuv
Using the lav2yuv command produces a raw YUV file of exactly the same size playable in VLC. The one from mencoder produces garbage.
Another example x264 invocation from http://mewiki.project357.com/wiki/X264_Settings:
$ x264 --output /dev/null --fps 30000/1001 --input-res 720x480 input.yuv
$ ffmpeg -i input.avi -vcodec libx264 output.mp4
Still trying to get the commands from the following article to work:
http://www.linuxjournal.com/article/9005
$ mencoder -vf format=i420 -nosound -ovc raw -of rawvideo -ofps 24 -o tmp.yuv input.avi
$ x264 -o output.mp4 --fps 24 --bframes 2 --crf 26 --subme 6 --analyse p8x8,b8x8,i4x4,p4x4 --input-res 720x480 tmp.yuv
Using the lav2yuv command produces a raw YUV file of exactly the same size playable in VLC. The one from mencoder produces garbage.
Another example x264 invocation from http://mewiki.project357.com/wiki/X264_Settings:
$ x264 --output /dev/null --fps 30000/1001 --input-res 720x480 input.yuv
Tuesday, November 29, 2011
ffmpeg install with libx264 (h264) on Fedora
The information for this is VERY very sparse, so here is a summary of what I have found.
Get all the fancy codecs
Install libx264
Get the libx264 package from http://www.videolan.org/developers/x264.html.
The link to the actual file is ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
Download it, then..
Install ffmpeg
Just use your browser. From http://ffmpeg.org/download.html find the latest stable release, which is currently http://ffmpeg.org/releases/ffmpeg-0.8.7.tar.bz2. Download it, then...
ffmpeg is now installed with libx264 (h264).
Courtesy: http://www.saiweb.co.uk/linux/ffmpeg-install-with-libx264-h264
It works! I'm no longer getting Unknown encoder 'libx264' message.
Use ffmpeg
For example, convert a Flash video compressed using VP8 codec to H264. Am wondering which codec produces a smaller file.
Wait, and shazam! A smaller file should be produced. But you may get this message:
This error usually comes when ldconfig does not know where to search for the libraries, so, in order to help it out, on Fedora do the following:
Add another file: custom-libs.conf
Inside, put :
save, then do
et voila again!!!
Get all the fancy codecs
# yum -y install libmatroska-devel libmkv-devel mkvtoolnix-gui ogmrip themonospot-plugin-mkv themonospot amrnb-tools amrnb-devel amrnb amrwb-tools amrwb-devel amrwb bzip2-devel bzip2-libs bzip2 libdc1394-tools libdc1394-devel libdc1394 dirac-libs dirac-devel dirac faac-devel faac faad2-libs.x86_64 faad2-devel faad2 gsm-tools gsm-devel gsm lame-libs lame-devel lame twolame-libs twolame-devel twolame openjpeg-libs openjpeg-devel openjpeg ImageMagick schroedinger-devel schroedinger speex-tools speex-devel speex libtheora-devel theora-tools byzanz istanbul libtheora libvorbis-devel vorbisgain liboggz-devel libfishsound vorbis-tools x264-libs x264-devel x264 h264enc imlib2-devel libvdpau-devel opencore-amr-devel SDL-devel texi2html xvidcore-devel yasm
Install libx264
Get the libx264 package from http://www.videolan.org/developers/x264.html.
The link to the actual file is ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
Download it, then..
# cd ~/Downloads/ # tar -xjvf last_x264.tar.bz2 # cd last_x264 # ./configure --enable-shared # make # make install # ldconfig
Install ffmpeg
Just use your browser. From http://ffmpeg.org/download.html find the latest stable release, which is currently http://ffmpeg.org/releases/ffmpeg-0.8.7.tar.bz2. Download it, then...
# cd ~/Downloads # tar xvfj ffmpeg-0.8.7.tar.bz2 # cd ffmpeg-0.8.7 # ./configure --enable-libx264 --enable-gpl --enable-shared # make # make install
ffmpeg is now installed with libx264 (h264).
Courtesy: http://www.saiweb.co.uk/linux/ffmpeg-install-with-libx264-h264
It works! I'm no longer getting Unknown encoder 'libx264' message.
Use ffmpeg
For example, convert a Flash video compressed using VP8 codec to H264. Am wondering which codec produces a smaller file.
# ffmpeg -i aflashfile.flv -vcodec libx264 convertedfile.mp4
Wait, and shazam! A smaller file should be produced. But you may get this message:
error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory
This error usually comes when ldconfig does not know where to search for the libraries, so, in order to help it out, on Fedora do the following:
# cd /etc/ld.so.conf.d
Add another file: custom-libs.conf
Inside, put :
/usr/local/lib
save, then do
# ldconfig
et voila again!!!
Subscribe to:
Posts (Atom)