<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.11" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Pipe RGB data to ffmpeg</title>
	<link>http://kylecordes.com/2007/07/05/pipe-ffmpeg/</link>
	<description>Kyle Cordes's Software Site</description>
	<pubDate>Sat, 30 Aug 2008 07:30:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.11</generator>

	<item>
		<title>by: Kyle Cordes</title>
		<link>http://kylecordes.com/2007/07/05/pipe-ffmpeg/#comment-20985</link>
		<pubDate>Thu, 22 May 2008 20:24:09 +0000</pubDate>
		<guid>http://kylecordes.com/2007/07/05/pipe-ffmpeg/#comment-20985</guid>
					<description>As I described in the post I solved the challenges here, with some IPP stuff and some code from before I found IPP. Sorry, but I'm not at liberty to publish any more details.</description>
		<content:encoded><![CDATA[<p>As I described in the post I solved the challenges here, with some IPP stuff and some code from before I found IPP. Sorry, but I&#8217;m not at liberty to publish any more details.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Connie</title>
		<link>http://kylecordes.com/2007/07/05/pipe-ffmpeg/#comment-20954</link>
		<pubDate>Thu, 22 May 2008 01:29:54 +0000</pubDate>
		<guid>http://kylecordes.com/2007/07/05/pipe-ffmpeg/#comment-20954</guid>
					<description>Kyle, 

thanks for the post. I've also been looking for a way to pipe rgb data into ffmpeg. Do you know if there's been any new developments since the time of your post? Or if there's another format (other than y'cbcr) that can be piped into ffmpeg? 

You mentioned that:

"By using a multicore CPU and threads, this whole process can be made to happen in real time or better (i.e., one second of “wall clock” processing time, for one second of finished MPEG2 video). "

Are you speaking from personal experience? If so, was it using IPP's function or your own solution?

thanks in advance</description>
		<content:encoded><![CDATA[<p>Kyle, </p>
<p>thanks for the post. I&#8217;ve also been looking for a way to pipe rgb data into ffmpeg. Do you know if there&#8217;s been any new developments since the time of your post? Or if there&#8217;s another format (other than y&#8217;cbcr) that can be piped into ffmpeg? </p>
<p>You mentioned that:</p>
<p>&#8220;By using a multicore CPU and threads, this whole process can be made to happen in real time or better (i.e., one second of “wall clock” processing time, for one second of finished MPEG2 video). &#8221;</p>
<p>Are you speaking from personal experience? If so, was it using IPP&#8217;s function or your own solution?</p>
<p>thanks in advance
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Horse</title>
		<link>http://kylecordes.com/2007/07/05/pipe-ffmpeg/#comment-12130</link>
		<pubDate>Thu, 18 Oct 2007 01:34:56 +0000</pubDate>
		<guid>http://kylecordes.com/2007/07/05/pipe-ffmpeg/#comment-12130</guid>
					<description>Boris,  in a single thread converting a 720x576 frame may be reasonably fast.  Multicore machines are not going to nett you much gain unless you understand the limitations of threaded programming and how to avoid them.  Remember that synchronization will lose you as much as you gain from parallelising your code if you do it badly.</description>
		<content:encoded><![CDATA[<p>Boris,  in a single thread converting a 720&#215;576 frame may be reasonably fast.  Multicore machines are not going to nett you much gain unless you understand the limitations of threaded programming and how to avoid them.  Remember that synchronization will lose you as much as you gain from parallelising your code if you do it badly.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Boris</title>
		<link>http://kylecordes.com/2007/07/05/pipe-ffmpeg/#comment-11681</link>
		<pubDate>Fri, 21 Sep 2007 22:03:40 +0000</pubDate>
		<guid>http://kylecordes.com/2007/07/05/pipe-ffmpeg/#comment-11681</guid>
					<description>What do you mean 'quite slow'.  For instance, on a single thread i can convert 720x576 in 3.8ms on a Pentium4,  on todays cheap dual core machines it would be 1/2 that.  I dont do 'theory' i always speak from practice.</description>
		<content:encoded><![CDATA[<p>What do you mean &#8216;quite slow&#8217;.  For instance, on a single thread i can convert 720&#215;576 in 3.8ms on a Pentium4,  on todays cheap dual core machines it would be 1/2 that.  I dont do &#8216;theory&#8217; i always speak from practice.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Kyle Cordes</title>
		<link>http://kylecordes.com/2007/07/05/pipe-ffmpeg/#comment-11428</link>
		<pubDate>Tue, 04 Sep 2007 13:27:49 +0000</pubDate>
		<guid>http://kylecordes.com/2007/07/05/pipe-ffmpeg/#comment-11428</guid>
					<description>Boris's comment is a great example of the difference between theory and practice. It turns out that in practice, a trivial implementation of the trivial RGB/YUV conversion is quite slow. That code, and many other parts, need to be well tested and optimized to process video in real time.</description>
		<content:encoded><![CDATA[<p>Boris&#8217;s comment is a great example of the difference between theory and practice. It turns out that in practice, a trivial implementation of the trivial RGB/YUV conversion is quite slow. That code, and many other parts, need to be well tested and optimized to process video in real time.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Boris</title>
		<link>http://kylecordes.com/2007/07/05/pipe-ffmpeg/#comment-11427</link>
		<pubDate>Tue, 04 Sep 2007 12:50:33 +0000</pubDate>
		<guid>http://kylecordes.com/2007/07/05/pipe-ffmpeg/#comment-11427</guid>
					<description>RGB to YUV conversion, including sample C code is on wikipedia.  Its a fairly trivial conversion.
the conversion code is not your biggest concern when implementing on x86, streaming/cache issues will be.</description>
		<content:encoded><![CDATA[<p>RGB to YUV conversion, including sample C code is on wikipedia.  Its a fairly trivial conversion.<br />
the conversion code is not your biggest concern when implementing on x86, streaming/cache issues will be.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Alex</title>
		<link>http://kylecordes.com/2007/07/05/pipe-ffmpeg/#comment-10908</link>
		<pubDate>Mon, 06 Aug 2007 18:03:04 +0000</pubDate>
		<guid>http://kylecordes.com/2007/07/05/pipe-ffmpeg/#comment-10908</guid>
					<description>I'm interested in doing something similar.  After some research, I wonder why you 
weren't able, or chose not to, use libavcodecs own img_convert() method to go from RGB to YUV420.</description>
		<content:encoded><![CDATA[<p>I&#8217;m interested in doing something similar.  After some research, I wonder why you<br />
weren&#8217;t able, or chose not to, use libavcodecs own img_convert() method to go from RGB to YUV420.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Maurice</title>
		<link>http://kylecordes.com/2007/07/05/pipe-ffmpeg/#comment-10422</link>
		<pubDate>Thu, 12 Jul 2007 09:58:40 +0000</pubDate>
		<guid>http://kylecordes.com/2007/07/05/pipe-ffmpeg/#comment-10422</guid>
					<description>I also encountered the problem of piping Y Cb Cr Data into ffmpeg. I found a solution and maybe it is useful to anybody out there in the WWW :)
An application, let's call it "a.out", extracts YCbCr Data (4:2:2) with 10 bit resolution from a video stream. The order ist [Cb] [Y] [Cr] [Y] ....
I created a named_pipe called "output_pipe" which is constantly filled with the RGB Data. A.out constantly is filling up the "output_pipe" with YCbCr data.
Now, I can use ffmpeg like the following:
ffmpeg -pix_fmt uyvy422 -s 720x576 -f rawvideo -i output_pipe -target pal-dvd -aspect 4:3 -y myDVD.mpg

Notice, that the codec is "rawvideo" and the "pix_fmt" is chosen corresponsing to the input stream. You can get a list of all pix_formats of ffmpeg by typing "ffmpeg -pix_fmt list".

I hope this is helpful!

Currently, I'm trying to pipe video and audio to ffmpeg within 1 step. I use the command:
ffmpeg -pix_fmt uyvy422 -s 720x576 -f rawvideo -i output_pipe -target pal-dvd -aspect 4:3 -y myDVD.mpg -f s16le -ar 48000 -ac 2 -i pcm0_pipe -acodec mp2 -ab 224k -newaudio

I'm having 48kHz / 16bit stereo audio raw PCM data which I want to directly add to the video file (muxing). The audio data is piped into the pcm0_pipe.
I ran into the problem that, of course, there is more audio than video data and so, if the video pipe is full, ffmpeg waits for the audio data and the whole process is blocked....

If anybody knows a solution, it would be nice to share it :)

Maurice</description>
		<content:encoded><![CDATA[<p>I also encountered the problem of piping Y Cb Cr Data into ffmpeg. I found a solution and maybe it is useful to anybody out there in the WWW <img src='http://kylecordes.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
An application, let&#8217;s call it &#8220;a.out&#8221;, extracts YCbCr Data (4:2:2) with 10 bit resolution from a video stream. The order ist [Cb] [Y] [Cr] [Y] &#8230;.<br />
I created a named_pipe called &#8220;output_pipe&#8221; which is constantly filled with the RGB Data. A.out constantly is filling up the &#8220;output_pipe&#8221; with YCbCr data.<br />
Now, I can use ffmpeg like the following:<br />
ffmpeg -pix_fmt uyvy422 -s 720&#215;576 -f rawvideo -i output_pipe -target pal-dvd -aspect 4:3 -y myDVD.mpg</p>
<p>Notice, that the codec is &#8220;rawvideo&#8221; and the &#8220;pix_fmt&#8221; is chosen corresponsing to the input stream. You can get a list of all pix_formats of ffmpeg by typing &#8220;ffmpeg -pix_fmt list&#8221;.</p>
<p>I hope this is helpful!</p>
<p>Currently, I&#8217;m trying to pipe video and audio to ffmpeg within 1 step. I use the command:<br />
ffmpeg -pix_fmt uyvy422 -s 720&#215;576 -f rawvideo -i output_pipe -target pal-dvd -aspect 4:3 -y myDVD.mpg -f s16le -ar 48000 -ac 2 -i pcm0_pipe -acodec mp2 -ab 224k -newaudio</p>
<p>I&#8217;m having 48kHz / 16bit stereo audio raw PCM data which I want to directly add to the video file (muxing). The audio data is piped into the pcm0_pipe.<br />
I ran into the problem that, of course, there is more audio than video data and so, if the video pipe is full, ffmpeg waits for the audio data and the whole process is blocked&#8230;.</p>
<p>If anybody knows a solution, it would be nice to share it <img src='http://kylecordes.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Maurice
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
