Recherche avancée

Médias (91)

Autres articles (19)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

Sur d’autres sites (3347)

  • getting video duration with ffmpeg, php function

    4 avril 2020, par keithp

    I have FFMpeg installed and I know it's functional, but i'm trying to get the duration time from a flv video through PHP but when I use this code :

    



    function mbmGetFLVDuration($file)

    



    /*  
* Determine video duration with ffmpeg   
* ffmpeg should be installed on your server.  
*/  

//$time = 00:00:00.000 format   
$ffmpeg = "../ffmpeg/ffmpeg";

$time =  exec("$ffmpeg -i $file 2>&1 | grep 'Duration' | cut -d ' ' -f 4 | sed s/,//");   

$duration = explode(":",$time);   
$duration_in_seconds = $duration[0]*3600 + $duration[1]*60+ round($duration[2]);   

return $duration_in_seconds;   


    



    



    and :

    



    $duration = mbmGetFLVDuration('http://www.videoaddsite.com/videos/intro.flv') ;
echo $duration ;

    



    I get an output of 220. THe video is 3:40. Can any help me on what i'm doing wrong, or if there's something else I can use ?

    


  • Cut a video in between key frames without re-encoding the full video using ffpmeg ? [closed]

    13 juillet 2024, par bguiz

    I would like to cut a video at the beginning at any particular timestamp, and it need to be precise, so the nearest key frame is not good enough.

    


    Also, these videos are rather long - an hour or longer - so I would like to avoid re-encoding this altogether if possible, or otherwise only re-encode a minimal fraction of the total duration. Thus, would like to maximise the use of -vcodec copy.

    


    How can I accomplish this using ffmpeg ?

    


    NOTE : See scenario, and my own rough idea for a possible solution below.

    



    


    Scenario :

    


      

    • Original video

        

      • Length of 1:00:00
      • 


      • Has a key frame every 10s
      • 


      


    • 


    • Desired cut :

        

      • From 0:01:35 through till the end
      • 


      


    • 


    • Attempt #1 :

        

      • Using -ss 0:01:35 -i blah.mp4 -vcodec copy, what results is a file where :
      • 


      • audio starts at 0:01:30
      • 


      • video also starts at 0:01:30
      • 


      • this starts both the audio and the video too early
      • 


      


    • 


    • using -i blah.mp4 -ss 0:01:35 -vcodec copy, what results is a file where :

        

      • audio starts at 0:01:35,
      • 


      • but the video is blank/ black for the first 5 seconds,

          

        • until 0:01:40, when the video starts
        • 


        


      • 


      • this starts the audio on time,
but the video starts too late
      • 


      


    • 


    



    


    Rough idea

    


      

    • (1) cut 0:01:30 to 0:01:40

        

      • re-encode this to have new key frames,
including one at the target time of 0:01:35
      • 


      • then cut this to get the 5 seconds from 0:01:35 through 0:01:40
      • 


      


    • 


    • (2) cut 0:01:40 through till the end

        

      • without re-encoding, using -vcodec copy
      • 


      


    • 


    • (3) ffmpeg concat the first short clip (the 5 second one)
with the second long clip
    • 


    


    I know/ can work out the commands for (2) and (3), but am unsure about what commands are needed for (1).

    


  • ffmpeg thumbnails in equal intervals

    29 juin 2013, par user2392940

    my current code

    $file= "C:/wamp/www/as.mp4";
    $ffmpeg = "C:/wamp/bin/ffmpeg/bin/ffmpeg";

    ob_start();
    passthru("$ffmpeg -i ".$file." 2>&1");
    $duration = ob_get_contents();
    ob_end_clean();

    $search='/Duration: (.*?)[.]/';
    $duration=preg_match($search, $duration, $matches, PREG_OFFSET_CAPTURE);
    $duration = $matches[1][0];
    list($hours, $mins, $secs) = preg_split('[:]', $duration);
    $totaltime = $secs+($mins*60)+($hours*3600);

    $percent = round($totaltime/12);

    exec ("$ffmpeg -i $file -threads 1 -b 64k -f image2 -s 220x180 -vf fps=fps=1/$percent img%03d.jpg");

    This code works perfectly if the total time/12 remainder is equal to or less than 60 seconds. The goal here is to make 12 thumbnails in equal intervals but ffmpeg will not allow more than 1 frame per 60 seconds any suggestions ?

    Thanks