FFMPEG already installed on my server LINUX but how to....

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    FFMPEG already installed on my server LINUX but how to....

    how to use it on my script?..

    this script work with my XAMMP. this require FFMPEG.EXE
    but .exe is not working on linux, .exe is only for WINDOWS
    may panel is LINUX
    HERE's the CODE
    this script is to give SCREENSHOT on the video
    PHP Code:
    <?php

        $ffmpeg 
    'ffmpeg.exe';

        
    // change "demo.mpg" to your mpg file name!
        
    $video  dirname(__FILE__) . "\demo.3gp";

        
    // change "demo.jpg" to whichever name you like or don't
        // for this example, the name of the output jpg file does not matter
        
    $image  dirname(__FILE__) . "\demo.jpg";

        
    $second 1;

        
    $cmd "$ffmpeg -i $video 2>&1";
        if (
    preg_match('/Duration: ((\d+):(\d+):(\d+))/s', `$cmd`, $time)) {
            
    $total = ($time[2] * 3600) + ($time[3] * 60) + $time[4];
            
    $second rand(1, ($total 1));
        }

        
    $cmd "$ffmpeg -i $video -deinterlace -an -ss $second -t 00:00:01 -r 1 -y -vcodec mjpeg -f mjpeg $image 2>&1";
        
    $return = `$cmd`;

        echo 
    'done!';

    ?>
    If ffMPEG is already installed on my server..
    so how to use it on my given script?

    PLEASE HELP ME!!!
    Last edited by subzero; 02.02.11, 11:05.

    #2
    Code it next time !!!


    $ffmpeg = '/usr/local/bin/ffmpeg';
    Last edited by subzero; 02.02.11, 11:07.
    Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
    Visit: WapMasterz Coming Back Soon!
    _______
    SCRIPTS FOR SALE BY SUBZERO
    Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
    FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
    _______
    Info & Tips
    php.net
    w3schools.com

    Comment


      #3
      replace ffmpeg.exe with path to ffmpeg on your server e.g. usr/bin/ffmpeg
      Unamos los corazones,hoy todos somos multicolores!

      Comment


        #4
        ok thx you so much

        Added after 33 minutes:

        your given location not work..

        maybe i contact my host about this ffmpeg location of the server
        Last edited by leadiztah; 03.02.11, 00:28.

        Comment


          #5
          my host that the exact path is usr/bin/ffmpeg

          so i try this code

          PHP Code:
          <?php

              $ffmpeg 
          '/usr/bin/ffmpeg';

              
          // change "demo.mpg" to your mpg file name!
              
          $video  dirname(__FILE__) . "\demo.3gp";

              
          // change "demo.jpg" to whichever name you like or don't
              // for this example, the name of the output jpg file does not matter
              
          $image  dirname(__FILE__) . "\demo.jpg";

              
          $second 1;

              
          $cmd "$ffmpeg -i $video 2>&1";
              if (
          preg_match('/Duration: ((\d+):(\d+):(\d+))/s', `$cmd`, $time)) {
                  
          $total = ($time[2] * 3600) + ($time[3] * 60) + $time[4];
                  
          $second rand(1, ($total 1));
              }

              
          $cmd "$ffmpeg -i $video -deinterlace -an -ss $second -t 00:00:01 -r 1 -y -vcodec mjpeg -f mjpeg $image 2>&1";
              
          $return = `$cmd`;

              echo 
          'done!';    

          ?>

          IT DOESN'T WORK
          Last edited by subzero; 03.02.11, 01:53.

          Comment


            #6
            Have you tryed

            reading php ??

            like for one

            ffmpeg

            <?php
            phpinfo();
            ?>

            go and see ffmpeg

            if you see

            ffmpegffmpeg-php version 0.6.3
            ffmpeg-php built on Jan 23 2011 23:40:37
            ffmpeg-php gd support disabled
            ffmpeg libavcodec version Lavc52.100.0
            ffmpeg libavformat version Lavf52.88.0
            ffmpeg swscaler version SwS0.12.0

            Means you need to

            exec("cmd");

            Added after 2 minutes:

            Last warning

            Code or PHP CODE your inputs of a script !!

            Or i will not help you any more !

            i getting mad and madder each time i have to unnoob you from looking like a total idiot......

            understand??

            coding or php your script will make it easyer to read !!

            UNDERSTAND !!
            Last edited by subzero; 03.02.11, 01:55.
            Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
            Visit: WapMasterz Coming Back Soon!
            _______
            SCRIPTS FOR SALE BY SUBZERO
            Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
            FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
            _______
            Info & Tips
            php.net
            w3schools.com

            Comment


              #7
              thx for that information subzero

              sorry i dont know where is the code to input.. but i explore it next time

              Added after 4 minutes:

              ffmpeg

              this is the FFMPEG information from phpinfo();


              ffmpeg-php version 0.6.0-svn
              ffmpeg-php built on Aug 20 2010 22:46:56
              ffmpeg-php gd support enabled
              ffmpeg libavcodec version Lavc52.20.1
              ffmpeg libavformat version Lavf52.31.0
              ffmpeg swscaler version SwS0.7.1


              it says that it is enabled so what should i do.
              Last edited by leadiztah; 03.02.11, 02:10.

              Comment


                #8
                PHP Code:
                <?php 

                    $ffmpeg 
                '/usr/bin/ffmpeg'

                    
                // change "demo.mpg" to your mpg file name! 
                    
                $video  dirname(__FILE__) . "/demo.3gp"

                    
                // change "demo.jpg" to whichever name you like or don't 
                    // for this example, the name of the output jpg file does not matter 
                    
                $image  dirname(__FILE__) . "/demo.jpg"

                    
                $second 1

                    
                $cmd "$ffmpeg -i $video 2> 'testlog_1.txt'"
                    if (
                preg_match('/Duration: ((\d+):(\d+):(\d+))/s', `$cmd`, $time)) { 
                        
                $total = ($time[2] * 3600) + ($time[3] * 60) + $time[4]; 
                        
                $second rand(1, ($total 1)); 
                    } 

                    
                $cmd "$ffmpeg -i $video -deinterlace -an -ss $second -t 00:00:01 -r 1 -y -vcodec mjpeg -f mjpeg $image 2> 'testlog_2.txt'"
                    
                $return = `$cmd`; 

                    echo 
                'done!';     

                ?>
                this script will write a ffmpeg log file in current directory. run this code, then check for 'testlog_1.txt' and 'testlog_2.txt' files & post them here.
                Last edited by firemax; 03.02.11, 02:43.

                Free Mobile Web Scripts by me: Free Youtube Downloader, Tweets Reader, Facebook Wall Posts Reader
                PHP Tutorials: How to Secure Your PHP Script (PHP SECURITY)
                Want to Develop/Edit your WAP/Web Site? Add me to Gtalk (gmail) 'lakshan1989' or PM me.

                Comment


                  #9
                  PHP Code:
                  <?php 

                      $ffmpeg 
                  '/usr/bin/ffmpeg'

                      
                  // change "demo.mpg" to your mpg file name! 
                      
                  $video  dirname(__FILE__) . "\demo.3gp"

                      
                  // change "demo.jpg" to whichever name you like or don't 
                      // for this example, the name of the output jpg file does not matter 
                      
                  $image  dirname(__FILE__) . "\demo.jpg"

                      
                  $second 1

                      
                  $cmd "$ffmpeg -i $video 2>&1"
                      if (
                  preg_match('/Duration: ((\d+):(\d+):(\d+))/s', `$cmd`, $time)) { 
                          
                  $total = ($time[2] * 3600) + ($time[3] * 60) + $time[4]; 
                          
                  $second rand(1, ($total 1)); 
                      } 

                      
                  $cmd "$ffmpeg -i $video -deinterlace -an -ss $second -t 00:00:01 -r 1 -y -vcodec mjpeg -f mjpeg $image 2> 'testlog.txt'"
                      
                  $return = `$cmd`; 

                      echo 
                  'done!';     

                  ?>
                  no LOG FILE created on that directory (

                  please help me..

                  i installed that script in /public_html/ffmpeg of my HOST as index.php

                  when you go to that directory you will see a text "DONE!!";

                  and the script will run according to its FUNCTION..

                  they have a demo.3gp on that directory.


                  the result:
                  it will produce demo.jpg on that directory..


                  HELP!!!!!!!!!!!!!!!!!!

                  Comment


                    #10
                    I noticed that they produced textlog if they produce DEMO.JPG

                    here is the example DEMO from my LOCALHOST server on my computer

                    FFmpeg version SVN-r12665, Copyright (c) 2000-2008 Fabrice Bellard, et al.
                    configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter-lavf --enable-pthreads --enable-liba52 --enable-avisynth --enable-libfaac --enable-libfaad --enable-libgsm --enable-memalign-hack --enable-libmp3lame --enable-libnut --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --cpu=i686 --extra-ldflags=-static
                    libavutil version: 49.6.0
                    libavcodec version: 51.54.0
                    libavformat version: 52.13.0
                    libavdevice version: 52.0.0
                    built on Apr 2 2008 22:35:11, gcc: 4.2.3
                    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\xampp\htdocs\ffmpeg/demo.3gp':
                    Duration: 00:00:07.6, start: 0.000000, bitrate: 144 kb/s
                    Stream #0.0(eng): Video: h263, yuv420p, 176x144 [PAR 12:11 DAR 4:3], 29.97 tb(r)
                    Stream #0.1(eng): Audio: samr / 0x726D6173, 8000 Hz, mono
                    Must supply at least one output file






                    and here is textlog_2.txt

                    FFmpeg version SVN-r12665, Copyright (c) 2000-2008 Fabrice Bellard, et al.
                    configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter-lavf --enable-pthreads --enable-liba52 --enable-avisynth --enable-libfaac --enable-libfaad --enable-libgsm --enable-memalign-hack --enable-libmp3lame --enable-libnut --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --cpu=i686 --extra-ldflags=-static
                    libavutil version: 49.6.0
                    libavcodec version: 51.54.0
                    libavformat version: 52.13.0
                    libavdevice version: 52.0.0
                    built on Apr 2 2008 22:35:11, gcc: 4.2.3
                    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\xampp\htdocs\ffmpeg/demo.3gp':
                    Duration: 00:00:07.6, start: 0.000000, bitrate: 144 kb/s
                    Stream #0.0(eng): Video: h263, yuv420p, 176x144 [PAR 12:11 DAR 4:3], 29.97 tb(r)
                    Stream #0.1(eng): Audio: samr / 0x726D6173, 8000 Hz, mono
                    Output #0, mjpeg, to 'C:\xampp\htdocs\ffmpeg/demo.jpg':
                    Stream #0.0(eng): Video: mjpeg, yuvj420p, 176x144 [PAR 12:11 DAR 4:3], q=2-31, 200 kb/s, 1.00 tb(c)
                    Stream mapping:
                    Stream #0.0 -> #0.0
                    Press [q] to stop encoding
                    frame= 1 fps= 0 q=3.1 Lsize= 4kB time=1.0 bitrate= 29.4kbits/s

                    video:4kB audio:0kB global headers:0kB muxing overhead 0.000000%






                    That is from my XAMMP server.








                    but how on my server LINUX?

                    Comment


                      #11
                      just up the topic..

                      Comment

                      Working...
                      X