<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: FFMPEG Settings for Optimal Flash H264 Encoding</title>
	<atom:link href="http://www.ostalks.com/2009/12/09/ffmpeg-settings-for-optimal-flash-h264-encoding/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ostalks.com/2009/12/09/ffmpeg-settings-for-optimal-flash-h264-encoding/</link>
	<description>Open Source, Operating Systems, Offtopic Stuff!</description>
	<lastBuildDate>Wed, 01 Feb 2012 06:36:59 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: flashtastic</title>
		<link>http://www.ostalks.com/2009/12/09/ffmpeg-settings-for-optimal-flash-h264-encoding/comment-page-1/#comment-43</link>
		<dc:creator>flashtastic</dc:creator>
		<pubDate>Thu, 04 Mar 2010 19:13:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.ostalks.com/?p=176#comment-43</guid>
		<description>After much experimentation, this worked really great! Thanks!</description>
		<content:encoded><![CDATA[<p>After much experimentation, this worked really great! Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abid Hussain</title>
		<link>http://www.ostalks.com/2009/12/09/ffmpeg-settings-for-optimal-flash-h264-encoding/comment-page-1/#comment-42</link>
		<dc:creator>Abid Hussain</dc:creator>
		<pubDate>Tue, 23 Feb 2010 06:50:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.ostalks.com/?p=176#comment-42</guid>
		<description>Thanks mate, your command work really great with me too.</description>
		<content:encoded><![CDATA[<p>Thanks mate, your command work really great with me too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: clintcan</title>
		<link>http://www.ostalks.com/2009/12/09/ffmpeg-settings-for-optimal-flash-h264-encoding/comment-page-1/#comment-39</link>
		<dc:creator>clintcan</dc:creator>
		<pubDate>Wed, 17 Feb 2010 08:46:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.ostalks.com/?p=176#comment-39</guid>
		<description>Hey, nice one Kaizoku. :D.</description>
		<content:encoded><![CDATA[<p>Hey, nice one Kaizoku. <img src='http://www.ostalks.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaizoku</title>
		<link>http://www.ostalks.com/2009/12/09/ffmpeg-settings-for-optimal-flash-h264-encoding/comment-page-1/#comment-38</link>
		<dc:creator>Kaizoku</dc:creator>
		<pubDate>Wed, 17 Feb 2010 08:39:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.ostalks.com/?p=176#comment-38</guid>
		<description>Forgot to add the t variable is what you want your target height is, mine is set to 432.

t=432</description>
		<content:encoded><![CDATA[<p>Forgot to add the t variable is what you want your target height is, mine is set to 432.</p>
<p>t=432</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaizoku</title>
		<link>http://www.ostalks.com/2009/12/09/ffmpeg-settings-for-optimal-flash-h264-encoding/comment-page-1/#comment-37</link>
		<dc:creator>Kaizoku</dc:creator>
		<pubDate>Wed, 17 Feb 2010 08:37:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.ostalks.com/?p=176#comment-37</guid>
		<description>Very neat, just what I was looking for :)

To have filesize down even further, why not resize the video. ffmpeg doesn&#039;t have built in scale caluculation, so we have to do it manually.

#!/bin/bash
# get original dimensions
dm=$(ffmpeg -i &quot;${1}&quot; 2&gt;&amp;1 &#124; grep Video &#124; cut -d &#039; &#039; -f 10)
# put the width in a variable
ow=$(echo ${dm} &#124; cut -d &#039;x&#039; -f 1)
# put the height in a variable
oh=$(echo ${dm} &#124; cut -d &#039;x&#039; -f 2)
# calculate the width to proportion of height and make sure its divisible by 16
width=$(echo ${t}*${ow}/${oh}/16*16 &#124; bc)
# run the encode
ffmpeg -i &quot;${1}&quot; -vcodec libx264 -r 25 -s ${width}x${t} -crf 28 -threads 0 -flags +loop -cmp +chroma -deblockalpha -1 -deblockbeta -1 -refs 3 -bf 3 -coder 1 -me_method hex -me_range 18 -subq 7 -partitions +parti4x4+parti8x8+partp8x8+partb8x8 -g 320 -keyint_min 25 -level 41 -qmin 10 -qmax 51 -qcomp 0.7 -trellis 1 -sc_threshold 40 -i_qfactor 0.71 -flags2 +mixed_refs+dct8x8+wpred+bpyramid -acodec libfaac -ar 44100 -ab 64k -ac 2 &quot;${output}&quot;</description>
		<content:encoded><![CDATA[<p>Very neat, just what I was looking for <img src='http://www.ostalks.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>To have filesize down even further, why not resize the video. ffmpeg doesn&#8217;t have built in scale caluculation, so we have to do it manually.</p>
<p>#!/bin/bash<br />
# get original dimensions<br />
dm=$(ffmpeg -i &#8220;${1}&#8221; 2&gt;&amp;1 | grep Video | cut -d &#8216; &#8216; -f 10)<br />
# put the width in a variable<br />
ow=$(echo ${dm} | cut -d &#8216;x&#8217; -f 1)<br />
# put the height in a variable<br />
oh=$(echo ${dm} | cut -d &#8216;x&#8217; -f 2)<br />
# calculate the width to proportion of height and make sure its divisible by 16<br />
width=$(echo ${t}*${ow}/${oh}/16*16 | bc)<br />
# run the encode<br />
ffmpeg -i &#8220;${1}&#8221; -vcodec libx264 -r 25 -s ${width}x${t} -crf 28 -threads 0 -flags +loop -cmp +chroma -deblockalpha -1 -deblockbeta -1 -refs 3 -bf 3 -coder 1 -me_method hex -me_range 18 -subq 7 -partitions +parti4x4+parti8x8+partp8x8+partb8x8 -g 320 -keyint_min 25 -level 41 -qmin 10 -qmax 51 -qcomp 0.7 -trellis 1 -sc_threshold 40 -i_qfactor 0.71 -flags2 +mixed_refs+dct8x8+wpred+bpyramid -acodec libfaac -ar 44100 -ab 64k -ac 2 &#8220;${output}&#8221;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

