Jump to content


Photo
- - - - -

Conversion issue


  • Please log in to reply
12 replies to this topic

#1 dargre

dargre

    Senior Member

  • Members
  • PipPipPipPipPip
  • 988 posts

Posted 10 November 2011 - 05:08 AM

I don't run AVS script (use own, heavily modified during period of almost 4 years), so do not have big opportunity to test it.
But working for clients suprisly I found a bug in AVS conversion script that in certain situations may limit conversions.

As you know there are 2 options for metainject tool: flvtool2 and yamdi.
Yamdi is suggested as it is much faster and works with big files (over 500MB).
It's also much easier to install and it doesn't use ruby, doesn't use so much resorces and doesn't eat so much bandwidth as flvtool2.

However if you switch to yamdi tool - it won't affect your conversion!
Still flvtool2 will be used....

To repair it edit file "include/function.conversions.php"
Find line:
$cmd = $config['metainject'].' -Uv '.$sdTmp.' '.$sdFile;
and replace it with:
if ( $config['meta_tool'] == 'flvtool2' ) {
   $cmd = $config['metainject']. ' -Uv ' .$sdTmp. ' ' .$sdFile;
} elseif ( $config['meta_tool'] == 'yamdi' ) {
   $cmd = $config['yamdi']. ' -i ' .$sdTmp. ' -o ' .$sdFile;
}
Next find code:
if (function_exists("verify_exec_path"))
verify_exec_path($config['metainject'], "flvtool2", 7);
exec($config['metainject']." -Uv ".$sdTmp." ".$sdFile);
and replace it with:
if ( $config['meta_tool'] == 'flvtool2' ) {
   $cmd = $config['metainject']. ' -Uv ' .$sdTmp. ' ' .$sdFile;
} elseif ( $config['meta_tool'] == 'yamdi' ) {
   $cmd = $config['yamdi']. ' -i ' .$sdTmp. ' -o ' .$sdFile;
}
modproc($cmd);

Additionally some servers may produce "temp.log.mbtree" files that are because of some CPU issue while h264 encoding. Such files are huge and occupy lot of space on your disk then. To avoid it - you need to check for such file once conversion finished and delete it if exists.
So if you see "xxx_temp.log.mbtree" files in your "/media/videos/hd" directory - delete them all, then set necessary change:

Find line:
$hdFile = $config['HD_DIR']."/".$vid.".".$e['fileext'];
Below enter this line:
$mbtree = $config['HD_DIR']."/". $vid."_temp.log.mbtree";
And next find line:
if(file_exists($tmpMp4)) @unlink($tmpMp4);
And below enter this line:
if(file_exists($mbtree)) @unlink($mbtree);

If you really care about conversions you should follow with these small changes. Would be also good if admin read this post and also made necessary changes to the script.
Other thing worth mentioned more: those who use the script for non adult site may have a problem with uploading mp4 youtube videos. Such videos are encoded in some strange way and if not reencoded (that's what avs script does - copy only) there can be a problem with sound out of sync. This concerns especially those newer youtube vids.
I didn't have time to look at it closer, and at the moment for my own use I decided to reencode such videos. Certainly I loose some small percent of quality, but at least sound is OK.



Good luck.

Edited by dargre, 11 November 2011 - 03:38 PM.

VIDEO.JS - best HTML5 player in the world for AVS script

NUEVOPLAYER 8 - best flash+html5 player for video scripts
Mods, custom code by NuevoLab (Search Suggest, Multiple image upload, Seo mods,and much more)


#2 Drago13

Drago13

    Junior Member

  • Members
  • Pip
  • 3 posts

Posted 10 November 2011 - 06:59 PM

Great work Dargre.. Just happened to look on here, glad I did. Thank you for your valuable assistance.

#3 s14avs

s14avs

    Junior Member

  • Members
  • Pip
  • 3 posts

Posted 14 November 2011 - 02:36 AM

so I guess I have to reencode the youtube video file manually. Does MMPEG support that also? I am not familiar with it but just asking.

#4 s14avs

s14avs

    Junior Member

  • Members
  • Pip
  • 3 posts

Posted 14 November 2011 - 02:38 AM

I really want to find out if I can grab some videoclips from youku.com(China youtube.com)and host it on my avs solution or whatever avs offers .

#5 dargre

dargre

    Senior Member

  • Members
  • PipPipPipPipPip
  • 988 posts

Posted 14 November 2011 - 12:53 PM

so I guess I have to reencode the youtube video file manually. Does MMPEG support that also? I am not familiar with it but just asking.


Please don't mess up this thread with your grabbing wishes as it's not about it.

Edited by dargre, 02 August 2012 - 02:25 AM.

VIDEO.JS - best HTML5 player in the world for AVS script

NUEVOPLAYER 8 - best flash+html5 player for video scripts
Mods, custom code by NuevoLab (Search Suggest, Multiple image upload, Seo mods,and much more)


#6 boyfap

boyfap

    Junior Member

  • Members
  • Pip
  • 13 posts

Posted 08 April 2013 - 01:36 PM

What version of AVS are you running? Before I make the changes you provided I wish to double check you are referring to the current latest version 2.2? Thanks

Attached Files



#7 Double D

Double D

    Member

  • Members
  • PipPip
  • 30 posts
  • LocationThe Netherlands

Posted 13 October 2013 - 01:20 PM

Thxx, Dargre

for this :D



#8 apple82

apple82

    Member

  • Members
  • PipPipPipPip
  • 293 posts
  • LocationSpain

Posted 14 October 2013 - 06:38 PM

I don't run AVS script (use own, heavily modified during period of almost 4 years), so do not have big opportunity to test it.
But working for clients suprisly I found a bug in AVS conversion script that in certain situations may limit conversions.

As you know there are 2 options for metainject tool: flvtool2 and yamdi.
Yamdi is suggested as it is much faster and works with big files (over 500MB).
It's also much easier to install and it doesn't use ruby, doesn't use so much resorces and doesn't eat so much bandwidth as flvtool2.

However if you switch to yamdi tool - it won't affect your conversion!
Still flvtool2 will be used....

To repair it edit file "include/function.conversions.php"
Find line:

$cmd = $config['metainject'].' -Uv '.$sdTmp.' '.$sdFile;
and replace it with:
if ( $config['meta_tool'] == 'flvtool2' ) {
   $cmd = $config['metainject']. ' -Uv ' .$sdTmp. ' ' .$sdFile;
} elseif ( $config['meta_tool'] == 'yamdi' ) {
   $cmd = $config['yamdi']. ' -i ' .$sdTmp. ' -o ' .$sdFile;
}
Next find code:
if (function_exists("verify_exec_path"))
verify_exec_path($config['metainject'], "flvtool2", 7);
exec($config['metainject']." -Uv ".$sdTmp." ".$sdFile);
and replace it with:
if ( $config['meta_tool'] == 'flvtool2' ) {
   $cmd = $config['metainject']. ' -Uv ' .$sdTmp. ' ' .$sdFile;
} elseif ( $config['meta_tool'] == 'yamdi' ) {
   $cmd = $config['yamdi']. ' -i ' .$sdTmp. ' -o ' .$sdFile;
}
modproc($cmd);
Additionally some servers may produce "temp.log.mbtree" files that are because of some CPU issue while h264 encoding. Such files are huge and occupy lot of space on your disk then. To avoid it - you need to check for such file once conversion finished and delete it if exists.
So if you see "xxx_temp.log.mbtree" files in your "/media/videos/hd" directory - delete them all, then set necessary change:

Find line:
$hdFile = $config['HD_DIR']."/".$vid.".".$e['fileext'];
Below enter this line:
$mbtree = $config['HD_DIR']."/". $vid."_temp.log.mbtree";
And next find line:
if(file_exists($tmpMp4)) @unlink($tmpMp4);
And below enter this line:
if(file_exists($mbtree)) @unlink($mbtree);
If you really care about conversions you should follow with these small changes. Would be also good if admin read this post and also made necessary changes to the script.
Other thing worth mentioned more: those who use the script for non adult site may have a problem with uploading mp4 youtube videos. Such videos are encoded in some strange way and if not reencoded (that's what avs script does - copy only) there can be a problem with sound out of sync. This concerns especially those newer youtube vids.
I didn't have time to look at it closer, and at the moment for my own use I decided to reencode such videos. Certainly I loose some small percent of quality, but at least sound is OK.



Good luck.

 

 

 

hi i with version 2.2 there are no such files.
 
and if I put in siteadmin Yamdi serves.
 
but the lines are not mentioned.


#9 Double D

Double D

    Member

  • Members
  • PipPip
  • 30 posts
  • LocationThe Netherlands

Posted 14 October 2013 - 07:20 PM

Hello Apple82,

 

so I have 2.2

The server was full with these files and luckily there was a post with the right solution.

I have tested the script with dargre solution and it works perfectly.

Thumbs up!!

grtz

Jaco



#10 apple82

apple82

    Member

  • Members
  • PipPipPipPip
  • 293 posts
  • LocationSpain

Posted 15 October 2013 - 04:47 PM

Hello Apple82,

 

so I have 2.2

The server was full with these files and luckily there was a post with the right solution.

I have tested the script with dargre solution and it works perfectly.

Thumbs up!!

grtz

Jaco

 

 

 

hello thanks.
 
I look at: include / function.conversions.php
 
:
 
if (function_exists ("verify_exec_path"))
verify_exec_path ($ config ['metainject'], "flvtool2", 7);
exec ($ config ['metainject']. "-uv". $ sdTmp. "". $ sdFile);
 
does not exist in my file this.
 
 
 
I I have:
if (function_exists("verify_exec_path"))
verify_exec_path($config['mencoder'], "mencoder", 5); 
$lavfopts = ($lavfopts == '') ? ' -lavfopts format=ipod' : $lavfopts.'';

Edited by apple82, 15 October 2013 - 04:50 PM.


#11 Double D

Double D

    Member

  • Members
  • PipPip
  • 30 posts
  • LocationThe Netherlands

Posted 15 October 2013 - 08:55 PM

hello apple82,

 

im not a php boy ;)

can you look at line 423 or 432 around that you can find:

 

if (function_exists ("verify_exec_path"))
verify_exec_path ($ config ['metainject'], "flvtool2", 7);
exec ($ config ['metainject']. "-uv". $ sdTmp. "". $ sdFile);

 

good luck

grtz

Jaco


Edited by Double D, 15 October 2013 - 09:07 PM.


#12 solitario

solitario

    Member

  • Members
  • PipPip
  • 21 posts

Posted 16 October 2013 - 04:19 PM

code standard

 

if ( $config['meta_tool'] == 'flvtool2' ) {
                                $cmd = $config['metainject']. ' -Uv ' .$sdTmp. ' '.$sdFile;
                            } elseif ( $config['meta_tool'] == 'yamdi' ) {
                                $cmd = $config['yamdi']. ' -i ' .$sdTmp. ' -o ' .$sdFile;
                            } else {

 

 

modified

 

if ( $config['meta_tool'] == 'flvtool2' ) {
                                $cmd = $config['metainject']. ' -Uv ' .$sdTmp. ' '.$sdFile;
                            } elseif ( $config['meta_tool'] == 'yamdi' ) {
                                $cmd = $config['yamdi']. ' -i ' .$sdTmp. ' -o ' .$sdFile;

                            }

 

I have to delete

 } else {    ?



#13 apple82

apple82

    Member

  • Members
  • PipPipPipPip
  • 293 posts
  • LocationSpain

Posted 17 October 2013 - 05:17 PM

Nothing I in my file does not exist this!
 
no way, the code does not exist!  :
 
 
if (function_exists("verify_exec_path"))
verify_exec_path($config['metainject'], "flvtool2", 7);
exec($config['metainject']." -Uv ".$sdTmp." ".$sdFile);

Edited by apple82, 17 October 2013 - 05:17 PM.