<?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>Prashanth Ellina &#187; video</title>
	<atom:link href="http://blog.prashanthellina.com/category/video/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.prashanthellina.com</link>
	<description>In Pursuit of Truth</description>
	<lastBuildDate>Sun, 28 Nov 2010 09:35:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Visualizing mpeg4 motion compensation vectors using mplayer</title>
		<link>http://blog.prashanthellina.com/2008/03/30/visualizing-mpeg4-motion-compensation-vectors-using-mplayer/</link>
		<comments>http://blog.prashanthellina.com/2008/03/30/visualizing-mpeg4-motion-compensation-vectors-using-mplayer/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 18:59:30 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[motion compensation]]></category>
		<category><![CDATA[mpeg4]]></category>
		<category><![CDATA[mplayer]]></category>
		<category><![CDATA[video compression]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/2008/03/30/visualizing-mpeg4-motion-compensation-vectors-using-mplayer/</guid>
		<description><![CDATA[The MPEG4 video encoding process makes use of block motion compensation to achieve compression. The motion compensation process serves to produce the intra frames which are the frames between keyframes. I&#8217;ve always been fascinated by this process and was delighted to find out that my favorite video player, mplayer, allows one to visualize this process. [...]]]></description>
			<content:encoded><![CDATA[<p>The MPEG4 video encoding process makes use of <strong>block motion compensation</strong> to achieve compression. The motion compensation process serves to produce the intra frames which are the frames between keyframes. I&#8217;ve always been fascinated by this process and was delighted to find out that my favorite video player, <strong>mplayer</strong>, allows one to visualize this process. I tried it and it is wonderful!</p>
<p>This is the video I tried the process on: <a href="http://www.prashanthellina.com/images/motion_vector_video.avi"><strong>download</strong></a></p>
<hr/>
<p><img src="http://www.prashanthellina.com/images/motion_vector_a_0.jpg" alt="motion compensation vector visualization"/><br />
<img src="http://www.prashanthellina.com/images/motion_vector_a_1.jpg" alt="motion compensation vector visualization"/></p>
<hr/>
<p><img src="http://www.prashanthellina.com/images/motion_vector_b_0.jpg" alt="motion compensation vector visualization"/><br />
<img src="http://www.prashanthellina.com/images/motion_vector_b_1.jpg" alt="motion compensation vector visualization"/></p>
<hr/>
<p><img src="http://www.prashanthellina.com/images/motion_vector_c_0.jpg" alt="motion compensation vector visualization"/><br />
<img src="http://www.prashanthellina.com/images/motion_vector_c_1.jpg" alt="motion compensation vector visualization"/></p>
<hr/>
<p><img src="http://www.prashanthellina.com/images/motion_vector_d_0.jpg" alt="motion compensation vector visualization"/></p>
<hr/>
<p>To try this out yourself, you will first need to have <a href="http://www.mplayerhq.hu/design7/news.html">mplayer</a> installed. If you are running Debian/Ubuntu, do this,</p>
<pre lang="bash">
sudo apt-get install mplayer
</pre>
<p><br/><br/></p>
<p>After this, download the video using the link provided above. Run this command,</p>
<pre lang="bash">
mplayer -lavdopts vismv=1 -vo x11 motion_vector_video.avi
</pre>
<p><br/><br/></p>
<p>To learn more about <strong>motion compensation</strong>, go <a href="http://en.wikipedia.org/wiki/Motion_compensation"><strong>here</strong>.</a><br />
<strong><big>Enjoy!</big></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2008/03/30/visualizing-mpeg4-motion-compensation-vectors-using-mplayer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://www.prashanthellina.com/images/motion_vector_video.avi" length="1780148" type="video/x-msvideo" />
		</item>
		<item>
		<title>Creating video thumbnails using ffmpeg</title>
		<link>http://blog.prashanthellina.com/2008/03/29/creating-video-thumbnails-using-ffmpeg/</link>
		<comments>http://blog.prashanthellina.com/2008/03/29/creating-video-thumbnails-using-ffmpeg/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 19:10:13 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[thumbnail]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/2008/03/29/creating-video-thumbnails-using-ffmpeg/</guid>
		<description><![CDATA[Generating thumbnails/screenshots of a video is useful in many ways. Youtube and many other video sites use this to show a preview of the video as a small thumbnail. Google video captures a series of thumbnails from a video at various time intervals to show a better video preview. There is a simple way to [...]]]></description>
			<content:encoded><![CDATA[<p>Generating thumbnails/screenshots of a video is useful in many ways. Youtube and many other video sites use this to show a preview of the video as a small thumbnail. Google video captures a series of thumbnails from a video at various time intervals to show a better video preview.</p>
<p>There is a simple way to generate thumbnails in Linux using ffmpeg, a very very useful tool for processing videos. Let us generate a thumbnail for this <a href="http://www.prashanthellina.com/images/motion_vector_video.avi">video</a>. Download the video and rename it to test.avi.</p>
<p>Then, run this command,</p>
<pre lang="bash">
ffmpeg  -itsoffset -4  -i test.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 test.jpg
</pre>
<p><br/><br/></p>
<p>This command generates a 320&#215;240 sized PNG thumbnail at the 4th second in the video. The output looks like this.<br />
<img src="http://www.prashanthellina.com/images/vid_thumb.jpg" alt="video thumbnail"/></p>
<p>If you do not have ffmpeg installed and are using Debian/Ubuntu, do,</p>
<pre lang="bash">
sudo apt-get install ffmpeg
</pre>
<p><br/><br/></p>
<p>A series of thumbnails, at 4, 8, 12 and 16 seconds.<br />
<img src="http://www.prashanthellina.com/images/vid_thumb.jpg" alt="video thumbnail"/><br />
<img src="http://www.prashanthellina.com/images/vid_thumb_8.jpg" alt="video thumbnail"/><br />
<img src="http://www.prashanthellina.com/images/vid_thumb_12.jpg" alt="video thumbnail"/><br />
<img src="http://www.prashanthellina.com/images/vid_thumb_16.jpg" alt="video thumbnail"/></p>
<pre lang="bash">
ffmpeg  -itsoffset -4  -i test.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 test.jpg
ffmpeg  -itsoffset -8  -i test.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 test.jpg
ffmpeg  -itsoffset -12  -i test.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 test.jpg
ffmpeg  -itsoffset -16  -i test.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 test.jpg
</pre>
<p><br/><br/></p>
<h3>useful links</h3>
<ul>
<li> <a href="http://blog.amnuts.com/2007/06/22/create-a-random-thumbnail-of-a-video-file/">Create a random thumbnail of a video file</a>
<li> <a href="http://www.danielfischer.com/2007/06/27/how-to-use-ffmpeg-to-convert-video-via-ruby-on-rails/">http://www.danielfischer.com/2007/06/27/how-to-use-ffmpeg-to-convert-video-via-ruby-on-rails/</a>
</ul>
<p>Happy thumbnailing!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2008/03/29/creating-video-thumbnails-using-ffmpeg/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
<enclosure url="http://www.prashanthellina.com/images/motion_vector_video.avi" length="1780148" type="video/x-msvideo" />
		</item>
		<item>
		<title>Watching Television on Linux: setting up a TV Tuner card</title>
		<link>http://blog.prashanthellina.com/2008/03/23/watching-television-on-linux-setting-up-a-tv-tuner-card/</link>
		<comments>http://blog.prashanthellina.com/2008/03/23/watching-television-on-linux-setting-up-a-tv-tuner-card/#comments</comments>
		<pubDate>Sun, 23 Mar 2008 13:19:57 +0000</pubDate>
		<dc:creator>prashanthellina</dc:creator>
				<category><![CDATA[gutsy gibbon]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[home theatre pc]]></category>
		<category><![CDATA[HTPC]]></category>
		<category><![CDATA[mencoder]]></category>
		<category><![CDATA[pinnacle pctv 50i]]></category>
		<category><![CDATA[television]]></category>
		<category><![CDATA[tv tuner card]]></category>
		<category><![CDATA[tvtime]]></category>

		<guid isPermaLink="false">http://blog.prashanthellina.com/2008/03/23/watching-television-on-linux-setting-up-a-tv-tuner-card/</guid>
		<description><![CDATA[A couple of weeks back, I went shopping looking for a TV tuner card that is compatible with Linux. Googling had told me that &#8220;Hauppauge&#8221; card was known to be compatible. However, I could not find it anywhere in the market (SP Road, Bangalore, India). On going to one of the shops, I found a [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of weeks back, I went shopping looking for a TV tuner card that is compatible with Linux. Googling had told me that &#8220;Hauppauge&#8221; card was known to be compatible. However, I could not find it anywhere in the market (SP Road, Bangalore, India). On going to one of the shops, I found a &#8220;<strong><a href="http://www.pinnaclesys.com/PublicSite/uk/Products/Consumer+Products/PCTV+Tuners/PCTV+Analog+PVR+(cable_antenna)/PCTV+50i.htm">Pinnacle PCTV 50i</a></strong>&#8221; card. I had heard from many people before that Pinnacle was a good card for Windows both in terms of quality of decoding and software provided. I checked in google to ensure that Pinnacle card would work on Linux. I found that the card uses Philips&#8217; SAA7134 chipset for which drivers are available in Linux. I went on and bought the card for Rs 2000 ($50).</p>
<p><center><img src="http://www.pinnaclesys.com/images/screenshots/40_50i_large.jpg" alt="Pinnacle PCTV 50i" height="25%" width="25%"/></center></p>
<p>The card is available through Amazon.com.<br />
<a href="http://www.amazon.com/gp/product/B000FKP2TY?ie=UTF8&#038;tag=prashellin-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=B000FKP2TY">Pinnacle PCTV Analog PCI 50i &#8211; TV / radio tuner / video input adapter &#8211; PCI &#8211; SECAM, PAL</a><img src="http://www.assoc-amazon.com/e/ir?t=prashellin-20&#038;l=as2&#038;o=1&#038;a=B000FKP2TY" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p>
<h3>Setting up the card in Linux</h3>
<p>I have Ubuntu Gutsy installed (7.10) and followed this <a href="http://www.cyberciti.biz/tips/debian-ubuntu-linux-configure-pinnacle-pctv-tuner.html">guide</a> to setup the card and the instructions worked like a charm. A gist of the procedure.</p>
<p>Ubuntu Gutsy recognizes the card automatically, the following commands help to check if the recognition happened or not. Both commands should give atleast one line of output each.</p>
<pre lang="bash">
sudo update-pciids
lspci | grep -i saa713
dmesg | grep saa713
</pre>
<p><br/><br/></p>
<h3>Watching TV &#8211; tvtime</h3>
<p><a href="http://www.google.co.in/url?sa=t&#038;ct=res&#038;cd=1&#038;url=http%3A%2F%2Ftvtime.sourceforge.net%2F&#038;ei=klfmR6P-B4KS6gOAlPG7CA&#038;usg=AFQjCNGRL5Fj7JAjfXMzgie-hp7wt7zDrA&#038;sig2=RCYG_ORJgTwlDYRmxgXc2A"><strong>tvtime</strong></a> is a simple to use application for watching TV on Linux. Here is how you configure it.</p>
<blockquote>
<pre lang="bash">
sudo apt-get install tvtime
tvtime &#038;
</pre>
<p><br/></p>
<p>Right click to open a setup menu. You can also hit [F1] or [tab] key to show configuration menu:<br />
Linux Tvtime configuration hit [F1] or [tab] key to show configuration menu<br />
(Fig. 01: Linux tvtime application configuration menu)<br />
First, you need to setup video source, frequencies and channels etc.</p>
<h5>Setup video source</h5>
<p>Visit Input Configuration > Change Video Source > Setup source as per your setup.</p>
<h5>Setup frequencies table</h5>
<p>You need to setup the channels you are receiving with the tuner. Here we use europe frequencies table. Visit Channel management > Change Frequency table > Select new table<br />
Scan Channel</p>
<p>Finally, you need to scan for channels by visiting Channel management > Change Frequency table > Scan channels for signal > Back > Exit</p>
<h5>Sound configuration</h5>
<p>You need to attach internal cables to get sound out of TV tuner card. Use driver saa7134-oss or saa7134-alsa to get sound out of card. This driver get loaded automatically. Open terminal and type the following command to hear the audio through ALSA using tvtime (or other programs that don’t support it directly):</p>
<pre lang="bash">
$ sox -c 2 -s -w -r 32000 -t ossdsp /dev/dsp1 -t ossdsp -w -r 32000 /dev/dsp
</pre>
</blockquote>
<h3>Recording TV using mencoder</h3>
<p>if you do not already have mencoder, you can install it (on Debian/Ubuntu) by doing</p>
<pre lang="bash"
sudo apt-get install mencoder mplayer
</pre>
<p>Note that the above command will also install mplayer which is useful for viewing video files and tv channels. If you are the command line kind of person, you can do away with tvtime and use mplayer!</p>
<p>To record a TV channel, you will first need to figure out the frequency of the channel. For this I found scantv useful. This command will scan channels in the specified range and print out the found channels. After figuring out the frequency of the channel to record, use this mencoder command to record the video in a compressed format.</p>
<pre lang="bash">
mencoder tv:// -tv driver=v4l2:input=0:norm=pal:width=640:height=480:device=/dev/video0:\
freq=775.25:adevice=/dev/dsp1:forceaudio:audiorate=32000 buffersize=64\
 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=400:keyint=30 -oac mp3lame\
-lameopts br=32:cbr:mode=3 -ffourcc divx -o "test.avi"
</pre>
<p><br/></p>
<p>To use <strong>mplayer to view TV</strong> directly (without using tvtime),do this.</p>
<pre lang="bash">
mplayer tv:// -tv driver=v4l2:input=0:norm=pal:width=640:height=480:device=/dev/video0:\
freq=775.25:adevice=/dev/dsp1:forceaudio:audiorate=32000
</pre>
<p><br/></p>
<p>I've been using this card without a glitch and recommend for HTPC attempts on Linux.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.prashanthellina.com/2008/03/23/watching-television-on-linux-setting-up-a-tv-tuner-card/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
	</channel>
</rss>

