Advertisement
verrary

H264.php

Nov 19th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.22 KB | None | 0 0
  1. #!/usr/bin/php
  2. <?php include_once('function.php');// Show folder files
  3. $cmd='echo "hello world  2>&1 1> /dev/null" ';passthru($cmd);  ?>
  4.  
  5. <div style=" width:650px;">
  6. <form method="post"><input name="url" size="70" /><br/><input name="submit" type="submit" /></form>
  7. </div>
  8. <?php
  9. $files = array(); $dir = opendir('.');
  10. while(false != ($file = readdir($dir))) {
  11. if(($file != ".") and ($file != "..") and ($file != "index.php"))
  12. { $files[] = $file; }   } natsort($files); foreach($files as $file) {
  13. if ( strpos($file,'.mp4') || strpos($file,'.flv') || strpos($file,'.avi') || strpos($file,'mpg') === true ) //تحقق اد الاتمداد لملفات فيديو فقط
  14. echo("$file <a href='$file'>.</a><br />\n");}
  15.  
  16. function flv_convert($in,$out_vid)
  17. {$cmd ='/usr/bin/avconv -i '.$in.' -c:v libx264 -preset ultrafast -b:v 230k -bufsize 64k -s 640x360 -an '.$out_vid.'  2>&1 1> /dev/null';
  18. $res = passthru($cmd);}
  19. $in = $_POST['url'];
  20. $out_vid = reset(explode('.',$in)).'O.mp4' ;
  21. echo $res;
  22. if (  flv_convert($in, $out_vid)  )
  23. echo 'done ';else echo '  <p>Fail</p>   ';
  24. echo $cmd ;// code provided and updated by steve of phpsnaps ! thanks  ?><br/>
  25. <a href="/H264.php">H264.php</a>  |.| <a href="http://0.tld">0.tld</a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement