Forum Index > FlashYourWeb OS Support > Gallery New Topic Post Reply
 Transcode flv odd size problem
 |  Printable Version
Anonymous: Jimbo Jonez
 January 31 2010 16:31 PM (Read 2193 times)  


Transcode is having errors when trying to convert movies with an odd numbered size, example width:400px height 293px.

I've set maximum width as an even number and the maximum width is some number that should never be reached, like 400px. My movies are all variable in height and width by the way.

So the thing is some videos resize to my width of 400px but the height could end up being an odd number and thats where transcode fails. This happens for all movies when automatic upload is enabled unless the movie happens to end up using both an even height and even width number when automatically resized.

Anyway can you please add something to the code to either subtract or add 1 pixel in case of an odd number please? It shouldn't be too hard using an 'if' statement Wink

Cheers for the mod btw, works well other than this minor bug.


 
Quote
suprsidr
 January 31 2010 16:43 PM  
Forum Admin
Admin

Status: offline

Registered: 12/20/06
Posts: 1221

Yes we ran into this issue when coding the module. I'm not sure why ffmpeg cares but we usually have to play with the numbers a bit before saving our transcode settings for those few movies we've had issue with.

If I crack open the code ever again, I'll take it into consideration.

-s


There will always be...
 
Profile Email Website
Quote
Anonymous: Jimbo Jonez
 February 06 2010 23:40 PM  



Could you please tell me what file to insert this ugly piece of code in to fix the issue -

PHP Formatted Code

if (($height % 2) != 0){
$height = $height - 1;
}
if (($width % 2) != 0){
$width = $width - 1;
}
 


Obviously the code divides both the the dimensions (width and height) by 2 and looks for a remainder not equal to 0, meaning an odd number was found. If this is the case, 1 is deleted from the offending dimension to give an even number... problem solved

So what file sets these video dimension variables for ffmpeg to use? Is it in ffmpeg module or transcode?


 
Quote
suprsidr
 February 07 2010 04:46 AM  
Forum Admin
Admin

Status: offline

Registered: 12/20/06
Posts: 1221

look to transcode/ItemEditTranscode.inc

-s


There will always be...
 
Profile Email Website
Quote
Anonymous: JohnnyMoronic
 March 17 2010 06:11 AM  


Around line 144 in TranscodeOnUploadOption.inc

After :

PHP Formatted Code
if($nativeWidth > $params['maxWidth']){
$aspect = $nativeHeight / $nativeWidth;


Add this :

PHP Formatted Code
$maxw = $params['maxWidth'];
$maxh = round($maxw * $aspect);

if (($maxw % 2) != 0){
$maxw = $maxw - 1;
}
if (($maxh % 2) != 0){
$maxh = $maxh - 1;
}


This fix works and was supplied by the dude at http://www.ServA1.net so credit goes to him.


 
Quote
Content generated in: 0.13 seconds
New Topic Post Reply



 All times are PDT. The time is now 12:40 PM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
HTML Allowed 
Censored Content