Recherche avancée

Médias (2)

Mot : - Tags -/plugins

Autres articles (101)

Sur d’autres sites (16489)

  • FFmpeg_frame toGDImage produces messed up thumbs

    27 juin 2013, par user2526873

    I have written a script in PHP that uploads a movie, converts it to FFmpeg movie and gets the thumb. Everything is working ok, but my thumbs have some sort of blue overlay. My code is :

    $movie = new ffmpeg_movie($uploadFile);
    $frame = $movie->getFrame(15)->toGDimage();

    $width = imagesx($frame);
    $height = imagesy($frame);

    $framecrop = imagecreatetruecolor(100, 80);
    imagecopyresampled($framecrop, $frame, 0, 0, 0, 0, 100, 80, $width, $height);
    imagejpeg($framecrop,"file.jpg");

    What am I doing wrong ? I have this problem with all the movies I upload.

    Thanks in advance for your answers !

  • ffmpeg output for flac and wav differs, why ?

    9 juin 2012, par burzum

    I need to parse ffmpegs meta data output but it is different for some reason between a wav and a flac file.

    Flac :

    (int) 14 => '  Duration: 00:03:18.93, bitrate: 1045 kb/s',
    (int) 15 => '    Stream #0:0: Audio: flac, 44100 Hz, stereo, s16',

    Wav :

    (int) 13 => '  Duration: 00:00:15.00, bitrate: 1411 kb/s',
    (int) 14 => '    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s',

    I could get the bitrate from the duration line too I think but why is it different ? And will there be more differences in future releases ? It really sucks that there is no better way to get the information from ffmpeg than to parse it's output. Any better ideas ?

    Here is my whole ffmpeg output and my parsed result :

    http://pastebin.com/4qJfzZNL

  • FFmpeg - How to scale a video then apply a watermark ?

    28 août 2016, par Olibanum

    Im trying to scale a video so that it is always 512 wide where the height changes in proportion to the original video.
    Once scaled, I then want to apply a watermark/overlay to the video, therefore the video will scale but the watermark wont.

    I am able to achieve each of these separately using the following filters :

    Scale

    -vf "scale=512:-1"

    Watermark

    -vf "movie=watermark.png [watermark]; [in][watermark] overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2 [out]"

    They work successfully on their own.

    However when trying to combine the two, Im having a bit of trouble.

    Having both as parameters of course does not work as one will override the other.

    Ive tried :

    -vf "scale=512:-1,movie=watermark.png [watermark]; [in][watermark] overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2 [out]"

    my thinking was that the scale would be applied first then the watermark but all I get is an error

    Too many inputs specified for the "movie" filter.

    Error opening filters !

    Then changing the , to a ; resulted in :

    Simple filtergraph ’scale=512 :-1 ;
    movie=watermark.png
    [watermark] ; [in][watermark]
    overlay=(main_w-overlay_w)/2 :(main_h-overlay_h)/2 [out]’ does not have
    exactly one input and output.

    Error opening filters !

    I presume I need to do something more with filterchains but Im struggling to figure it out.

    Any ideas anyone ?

    Many thanks in advance.