<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>Kevin Deldycke &#187; mencoder</title> <atom:link href="http://kevin.deldycke.com/tag/mencoder/feed/" rel="self" type="application/rss+xml" /><link>http://kevin.deldycke.com</link> <description>Free software engineer &#38; wannabe videomaker</description> <lastBuildDate>Fri, 03 Feb 2012 19:08:27 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Video commands</title><link>http://kevin.deldycke.com/2006/11/video-commands/</link> <comments>http://kevin.deldycke.com/2006/11/video-commands/#comments</comments> <pubDate>Tue, 07 Nov 2006 22:31:27 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[Audio]]></category> <category><![CDATA[CLI]]></category> <category><![CDATA[divx]]></category> <category><![CDATA[dvd]]></category> <category><![CDATA[ffmpeg]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[mencoder]]></category> <category><![CDATA[MP4]]></category> <category><![CDATA[mplayer]]></category> <category><![CDATA[subtitle]]></category> <category><![CDATA[svcd]]></category> <category><![CDATA[transcode]]></category> <category><![CDATA[Video]]></category> <category><![CDATA[xvid]]></category><guid isPermaLink="false">http://kevin.deldycke.com/2006/10/usefull-commands-video/</guid> <description><![CDATA[Here are some commands to get informations about the nature of a video: Mplayer / Mencoder Change the aspect ratio of a film for the playback. Standard aspect ratio are : 1.33 (4:3), 1.66 (1.66:1), 1.77 (16:9) and 2.35 (2.35:1): &#8230; <a href="http://kevin.deldycke.com/2006/11/video-commands/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<ul><li>Here are some commands to get informations about the nature of a video:<pre class="brush: bash; title: ; notranslate">
mplayer -frames 0 -identify ./video.avi
tcprobe -i ./video.avi
ffmpeg -i ./video.avi
file ./video.avi
</pre></li></ul><h2>Mplayer / Mencoder</h2><ul><li>Change the aspect ratio of a film for the playback. Standard aspect ratio are : 1.33 (4:3), 1.66 (1.66:1), 1.77 (16:9) and 2.35 (2.35:1):<pre class="brush: bash; title: ; notranslate">
mplayer -aspect 2:1 ./video.avi
</pre></li><li>Play the video with subtitles:<pre class="brush: bash; title: ; notranslate">
mplayer -sub ./subtitle_file.txt ./video.avi
</pre></li><li>This will extract audio track no. 128, downmix the AC3 sound to PCM and write the results to <code>file.wav</code>:<pre class="brush: bash; title: ; notranslate">
mplayer -vo null -hardframedrop -aid 128 -ao pcm -aofile file.wav dvd://1
</pre></li><li>This will extract the audio, convert it to PCM and write the resulting wave file to <code>audio.wav</code>:<pre class="brush: bash; title: ; notranslate">
mplayer -vo null -hardframedrop -ao pcm:file=audio.wav myvideo.avi
</pre></li><li>Show all subtitles streams:<pre class="brush: bash; title: ; notranslate">
mplayer -vo null -ao null -frames 0 -v 2 dvd://1 &gt;&amp;1 | grep sid
</pre></li><li>Create a rotated copy of the <code>file.avi</code> video (<code>rotate=1</code> : clockwise ; <code>rotate=2</code> : anti-clockwise):<pre class="brush: bash; title: ; notranslate">
mencoder -vop rotate=2 -oac pcm -ovc lavc ./source.avi -o ./dest.avi
</pre></li><li>Preview a video composed of all jpeg files from the current folder at 15fps (mplayer only support jpeg, png, tga and sgi formats):<pre class="brush: bash; title: ; notranslate">
mplayer &quot;mf://*.jpg&quot; -mf fps=15
</pre></li><li>Create a 15fps video from all jpeg files of the current folder:<pre class="brush: bash; title: ; notranslate">
mencoder &quot;mf://*.jpg&quot; -mf fps=15 -ovc lavc -o ./dest.avi
</pre></li><li>Encode a SVCD to AVI file:<pre class="brush: bash; title: ; notranslate">
mencoder -oac lavc -ovc lavc vcd://1 -o ./svcd.avi
</pre></li><li>Transcode video to raw format (be carefull: usually the output video got annoying audio delay):<pre class="brush: bash; title: ; notranslate">
mencoder -oac pcm -ovc raw -ofps 25 -noskip ./video.wmv -o ./video.avi
</pre></li><li>Encode a video using the default mpeg4 codec at 400 kbps for video and mp3 codec at constant 32 kbps bitrate for audio:<pre class="brush: bash; title: ; notranslate">
mencoder -oac mp3lame -lameopts cbr:preset=32 -ovc lavc -lavcopts vbitrate=400 in.avi -o out.avi
</pre></li><li>Enhance the sharpness of the video:<pre class="brush: bash; title: ; notranslate">
mplayer video.avi -vf smartblur=.6:-.5:0,unsharp=l5x5:.8:c5x5:.4
</pre></li><li>Cut a video to keep the first 5.4 seconds:<pre class="brush: bash; title: ; notranslate">
mencoder big-file.avi -ss 0 -endpos 5.4 -ovc copy -oac copy -o cutted.avi
</pre></li><li>Cut a video to keep everything exept the first 5.4 seconds:<pre class="brush: bash; title: ; notranslate">
mencoder big-file.avi -ss 5.4 -ovc copy -oac copy -o cutted.avi
</pre></li><li>Show all <code>mplayer</code> filter list:<pre class="brush: bash; title: ; notranslate">
mplayer -vf help
</pre></li><li>Get help of a particular filter (<code>eq2</code> in this example):<pre class="brush: bash; title: ; notranslate">
mplayer -vf eq2=help
</pre></li><li>Here is the filter I use to light up a video taken in the dark with my cheap camera. Of course it add noise but thanks to this we can distinguish shapes in the dark.<pre class="brush: bash; title: ; notranslate">
mencoder -vf eq2=1.61:1.95:0.54:2.43 -oac pcm -ovc lavc video.avi -o bright-vid.avi
</pre></li><li>And this is the command to preview the result of the filter used above:<pre class="brush: bash; title: ; notranslate">
mplayer video.avi -vf eq2=1.61:1.95:0.54:2.43
</pre></li><li>This is how I convert raw videos taken with my digital camera into ISO standard MPEG-4 (DivX 5, XVID compatible) videos [to encode in grayscale, add <code>:gray</code> option to <code>-lavcopts</code>]:<pre class="brush: bash; title: ; notranslate">
mencoder source.avi -ovc lavc -oac lavc -ffourcc DX50 -lavcopts vcodec=mpeg4:vbitrate=400:v4mv:mbd=2:trell:autoaspect:dia=2:acodec=mp3:abitrate=32:vpass=1 -vf hqdn3d -o output.avi
mencoder source.avi -ovc lavc -oac lavc -ffourcc DX50 -lavcopts vcodec=mpeg4:vbitrate=400:v4mv:mbd=2:trell:autoaspect:dia=2:acodec=mp3:abitrate=32:vpass=2 -vf hqdn3d -o output.avi
</pre></li><li>Play all videos of the current folder fullscreen at 4x speed with 50% more brightness:<pre class="brush: bash; title: ; notranslate">
mplayer -speed 4 -brightness 50 -fs ./*.avi
</pre></li><li>Extract audio stream from a video:<pre class="brush: bash; title: ; notranslate">
mplayer -dumpaudio -dumpfile audio.ac3 video_source.mpg
</pre></li></ul><h2>FFmpeg</h2><ul><li>Concatenate a series of videos and transcode the audio output to a <code>flac</code> file. This <a href="http://ffmpeg.org/faq.html#SEC29">only works with certain multimedia container</a> (MPEG-1, MPEG-2 PS, DV):<pre class="brush: bash; title: ; notranslate">
cat M2U01802.MPG M2U01803.MPG M2U01804.MPG | ffmpeg -i - -acodec flac output.flac
</pre></li><li>Remove the first 16 seconds of video and change container to Matroska:<pre class="brush: bash; title: ; notranslate">
ffmpeg -ss 16 -i ./MVI_8763.MOV -vcodec copy -acodec copy ./MVI_8763.mkv
</pre></li><li>Extract the first frame of a video (great to generate image preview):<pre class="brush: bash; title: ; notranslate">
ffmpeg -i video.mov -r 1  -t 00:00:01 -f image2 images%05d.png
</pre></li><li>Transcode the video stream to the <a href="http://en.wikipedia.org/wiki/Huffyuv">lossless HuffYUV codec</a>:<pre class="brush: bash; title: ; notranslate">
ffmpeg -i ./MVI_1714.MOV -vcodec huffyuv -sameq ./MVI_1714-lossless.avi
</pre></li></ul><h2>Transcode</h2><ul><li>Merge multiple video into one:<pre class="brush: bash; title: ; notranslate">
avimerge -i part1.avi part2.avi -o big-file.avi
</pre></li><li>Extract the raw subtitle stream. The <code>-a 0x21</code> option correspond to the subtitle stream&#8217;s hexadecimal number (= 0&#215;20 + id of the stream):<pre class="brush: bash; title: ; notranslate">
tccat -i /space/st-tng/dic1/ -T 1 -L | tcextract -x ps1 -t vob -a 0x22 &gt; subs-en
</pre></li></ul><h2>VLC</h2><ul><li>Transcode the first video stream found in a <code>m3u</code> playlist to a 384 kbps MPEG-2 video and 48 kHz Vorbis audio, and serve the resulting stream ina Ogg container to <code>http://localhost:8888</code>. To save bandwisth we reduce by two the size of the video:<pre class="brush: bash; title: ; notranslate">
vlc -vvv http://mafreebox.freebox.fr/freeboxtv/playlist.m3u --sout '#transcode{vcodec=mp2v,vb=384,scale=0.5,acodec=vorbis,ab=48,channels=1}:standard{access=http,mux=ogg,url=:8888}' -I ncurses 2&gt; /dev/null
</pre></li></ul><h2>Others</h2><ul><li>Extract to <code>chapter.txt</code> the chapter file of the track n°1 of the DVD:<pre class="brush: bash; title: ; notranslate">
dvdxchap -t 1 /mnt/cdrom &gt; chapter.txt
</pre></li><li>Test XV video driver output via gstreamer v0.10:<pre class="brush: bash; title: ; notranslate">
gst-launch-0.10 videotestsrc ! xvimagesink
</pre></li></ul> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2006/11/video-commands/feed/</wfw:commentRss> <slash:comments>12</slash:comments> </item> <item><title>A/V sync problems: VLC better than Mencoder</title><link>http://kevin.deldycke.com/2006/04/av-sync-problems-vlc-better-than-mencoder/</link> <comments>http://kevin.deldycke.com/2006/04/av-sync-problems-vlc-better-than-mencoder/#comments</comments> <pubDate>Sun, 09 Apr 2006 22:30:38 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[mencoder]]></category> <category><![CDATA[Video]]></category> <category><![CDATA[VLC]]></category><guid isPermaLink="false">http://kevin.deldycke.com/2006/04/10/av-sync-problems-vlc-better-than-mencoder/</guid> <description><![CDATA[Today I tried to transcode a bunch of videos using my favorite script. I need to do this because the videos produced with my cheap camera use Mjpeg as video codec and raw-data as audio codec. This result of incredible &#8230; <a href="http://kevin.deldycke.com/2006/04/av-sync-problems-vlc-better-than-mencoder/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Today I tried to transcode a bunch of videos using my favorite script. I need to do this because the videos produced with my cheap camera use Mjpeg as video codec and raw-data as audio codec. This result of incredible large files. To share my videos with friends, I transcode them to mpeg4/mp3 files. This is all the dirty work my script is supposed to handle.</p><p>Unfortunately I didn&#8217;t use it since I upgraded Mandriva from 2005 to the 2006 release. As you can guess, it wasn&#8217;t working: mencoder gave me the following &#8220;Audio LAVC, couldn&#8217;t find encoder for codec mp3&#8243; error message. First, I though it was because of a bad version of ffmpeg. Looking at the source RPM from PLF repository gave me the proof that my version was compiled with the right options.</p><p>To bypass this problems, I used the -mp3lame as output audio codec. This introduced horrible A/V sync. <img src='http://kevin.deldycke.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> For 3 hours, I tried to play with mencoder options without success. I was completetly desesperated&#8230; until I tried VLC. In less than 10 minutes I was able to get the expected result: perfect A/V sync movie file !</p><p>Thanks to the <a href="http://wiki.videolan.org/index.php/Main_Page">VLC wiki</a>, I also discovered the h264 video codec, which is a good codec for low bitrates. Even if it produce bigger files compared to my older method (the latter can be found in <a href="http://kevin.deldycke.com/static/scripts/avi2mp4-2005_10_02.py">the first version of the script</a>), the quality is very awesome and video artefacts (ringings and blockings) are so reduced that it&#8217;s now very hard to distinguish. So I decided to use h264 in the <a href="http://kevin.deldycke.com/static/scripts/avi2mp4-2006_04_09.py">new version of my script</a>.</p><p>There is still an inconvenient of using VLC instead of mencoder: VLC is transcoded at real time ! I tried the &#8220;hurry-up&#8221; parameters without effects. This is sad but acceptable, since my goal is to archive my tiny videos.</p><p>To summarize, here is the command line I use to do transcoding via VLC:</p><pre class="brush: bash; title: ; notranslate">
vlc --sout-all &quot;input_video.avi&quot; :sout='#transcode{vcodec=h264, acodec=mp3, ab=32,channels=1, audio-sync}:std{access=file, mux=mp4, url=&quot;output_video.mp4&quot;}' vlc:quit -I dummy
</pre><p>This command is far from perfect and I plan to dig into VLC help to tune h264 codec.</p> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2006/04/av-sync-problems-vlc-better-than-mencoder/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>HowTo Compile and Use xvidcap</title><link>http://kevin.deldycke.com/2005/06/howto-compile-and-use-xvidcap/</link> <comments>http://kevin.deldycke.com/2005/06/howto-compile-and-use-xvidcap/#comments</comments> <pubDate>Mon, 27 Jun 2005 11:41:39 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[CLI]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Mandriva]]></category> <category><![CDATA[mencoder]]></category> <category><![CDATA[mplayer]]></category> <category><![CDATA[Video]]></category> <category><![CDATA[xvidcap]]></category><guid isPermaLink="false">http://kevin.deldycke.com/2005/06/howto-compile-and-use-xvidcap/</guid> <description><![CDATA[Compile gvidcap ! Get the last stable source code archive on xvidcap Sourceforge project page or download it from the CVS: Install required dependencies: Dirty compile: Quick test: Use gvidcap ! Raw capture: The following can be used but it &#8230; <a href="http://kevin.deldycke.com/2005/06/howto-compile-and-use-xvidcap/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<h2>Compile gvidcap !</h2><p>Get the last stable source code archive on <a href="http://sourceforge.net/projects/xvidcap">xvidcap Sourceforge project page</a> or download it from the <a href="http://cvs.sourceforge.net/viewcvs.py/xvidcap">CVS</a>:</p><pre class="brush: bash; title: ; notranslate">
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/xvidcap co -P xvidcap
</pre><p>Install required dependencies:</p><pre class="brush: bash; title: ; notranslate">
urpmi gcc automake libgtk+2-devel ffmpeg-devel liblame0-devel
</pre><p>Dirty compile:</p><pre class="brush: bash; title: ; notranslate">
make distclean [optional]
CPPFLAGS=-I/usr/include/ffmpeg LDFLAGS=-L/usr/bin/ffmpeg
./configure --with-gtk2 --with-forced-embedded-ffmpeg &amp;&amp; make gvidcap
make gvidcap
make install [optional]
</pre><p>Quick test:</p><pre class="brush: bash; title: ; notranslate">
./src/gvidcap &amp;
</pre><h2>Use gvidcap !</h2><p>Raw capture:</p><pre class="brush: bash; title: ; notranslate">
gvidcap --gui no -v --file ~/img_%04d.xwd --frames 0 --fps 10 --cap_geometry 1024x768+0+0
</pre><p>The following can be used but it slow down the machine (png compression require too cpu):</p><pre class="brush: bash; title: ; notranslate">
gvidcap --gui no -v --compress 9 --file ~/img_%04d.png --frames 0 --fps 10 --cap_geometry 1024x728+0+0
</pre><p>Convert .xwd images to .png images because mplayer only support .png, .jpg, .tga and .sgi image file format:</p><pre class="brush: bash; title: ; notranslate">
convert img_*.xwd img_%04d.png &amp;&amp; rm -rf ./*.xwd
</pre><p>Preview the video:</p><pre class="brush: bash; title: ; notranslate">
mplayer &quot;mf://*.png&quot; -mf fps=10
</pre><p>Make a video from successive screenshots:</p><pre class="brush: bash; title: ; notranslate">
mencoder &quot;mf://*.png&quot; -mf fps=10 -ovc lavc -o ./video.avi
</pre><p>Documentation:</p><ul><li><a href="http://www.linux-magazine.com/issue/45/DeskTOPia_xvidcap.pdf">http://www.linux-magazine.com/issue/45/DeskTOPia_xvidcap.pdf</a></li><li><a href="http://www.jarre-de-the.net/faq/pdf/faq.pdf">http://www.jarre-de-the.net/faq/pdf/faq.pdf</a></li><li><a href="http://www.tuxbihan.org/IMG/pdf/gvidcap.pdf">http://www.tuxbihan.org/IMG/pdf/gvidcap.pdf</a></li><li><a href="http://www.csit.fsu.edu/~beason/recordMovie">http://www.csit.fsu.edu/~beason/recordMovie</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2005/06/howto-compile-and-use-xvidcap/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 2/15 queries in 0.017 seconds using apc
Object Caching 675/693 objects using apc

Served from: kevin.deldycke.com @ 2012-02-08 10:48:46 -->
