7921 Posts in 1359 Topics by 933 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Increase quailty of Video encode
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1003 Views |
-
Increase quailty of Video encode

27 July 2009 at 9:35am Last edited: 27 July 2009 9:39am
Hi UncleCheese,
I've got video working perfectly along with ffmpeg but the quality of the video on the flv encode is a bit low for our use. Is there a way to up the bitrate of the transcode into flv, I saw variables for audio but not the video.
Thanks,
Howard -
Re: Increase quailty of Video encode

27 July 2009 at 1:36pm
I've had a go at implementing it, to FLV.php I added
public static $video_bit_rate = 4000; // high for testing purposes
then changed the createFLV function to
private function createFLV()
{
$args = sprintf("-i %s -ar %d -ab %d -b %d -f flv %s",
$this->absoluteRawVideoLink(),
self::$audio_sampling_rate,
self::$audio_bit_rate,
self::$video_bit_rate,
$this->absoluteFLVPath()
);
$output = self::ffmpeg($args);
}But this doesn't increase the quality or the generated filesize...
Any ideas?
-
Re: Increase quailty of Video encode

27 July 2009 at 2:05pm
Thanks for looking into this. The FLV features of DOM are in a very nascent state and I right now my focus is just to get it working reliably on several different installs and hopefully make its way into some production sites. It seems to be doing well so far.
I will definitely be adding a lot more features to it as I learn more about FFMPEG. There are hundreds of flags you can throw at the video conversion, including one for quality, that takes a value of 0 to 30. You might want to read the docs on that on the ffmpeg website. Hack the core code and see if it makes a difference for you and get back to me on what you find. If it looks good, I'll have you revert your changes and check it in to the svn channel.
-
Re: Increase quailty of Video encode

27 July 2009 at 5:46pm
Hi again,
Yea I couldn't see the single 0-30 quality setting in the ffmpeg documentation but I have achieved what I wanted by using -sameq which sets it to the same quality as the upload, I will tinker with it a bit more down the line. The changes I have made are the addition of the following to FLV.php I figured I would set it up so that I could pass any arguments I liked into the encode so that it would be easy to use the heaps of different encoding options.
public static $extra_flv_commands;
private function createFLV()
{
$args = sprintf("-i %s -ar %d -ab %d %s -f flv %s",
$this->absoluteRawVideoLink(),
self::$audio_sampling_rate,
self::$audio_bit_rate,
self::$extra_flv_commands,
$this->absoluteFLVPath()
);
$output = self::ffmpeg($args);
}static function set_var($var, $value)
{
if(property_exists('FLV', $var))
self::$$var = $value;
}
And then obviously in _config.php I included:FLV::set_var('extra_flv_commands','-sameq');
What do you think about setting it up like this?
(Also I've got a little bug but ill post it in the other thread)
-
Re: Increase quailty of Video encode

10 January 2010 at 5:34am
Hey Howard.
Thanks for this tip. Works great!
-
Re: Increase quailty of Video encode

26 January 2010 at 8:26am
hello howardgrigg
i am trying to make a video gallery,my ffmpeg is working fine and even its creating thumbnail and convertiing video into flv but nothing is showing up on the page..
can you help me with your code where you have made video working fine,it willb e a great help.
thank you in advance
| 1003 Views | ||
|
Page:
1
|
Go to Top |


