Forum Replies Created

  • Marcos Bori

    May 25, 2011 at 9:14 am in reply to: Generate FLV “on the fly”: duration not set

    Thank you for your answer, Michael.

    What I’m trying to do with ffmpeg is, whenever a user requests for a video in my web site, to take that video and dynamically add a watermark on it and deliver it to the user.
    Therefore, I know the final duration of the resulting video. Is there any way in ffmpeg to tell it the final duration of the video beforehand, so it sets the duration metadata in the final video, even using ‘passthrough’?

    I need the timing information in the resulting video so that the video player in the client’s browser can seek using the control bar.

    Thanks!

  • Marcos Bori

    May 18, 2011 at 12:14 pm in reply to: Generate FLV “on the fly”: duration not set

    What I’m trying to do is to watermark the videos “on the fly” in my site, so I don’t need to store the watermarked ones.
    I use PHP in the server side.

    I’m trying to do it calling ffmpeg:

    1.-The user requests the video

    2.-The server executes a PHP script to deliver it:

    The PHP script calls ffmpeg using “passthru”. The command is something like:

    ffmpeg -i original.flv -sameq -vf "movie='thewatermark.png' [logo],[in][logo] overlay=10:main_h/2-60 [out]" -f flv - 2>/tmp/ffmpeg.log

    Two problems arise:
    1.-The “Duration” metadata is not properly set by ffmpeg when outputting to stdout. This implies flash video player (flowplayer in my case) can’t handle seek features.

    2.-When executing the ffmpeg command from PHP I get an error: When I execute the ffmpeg command manually in the server, it generates the final video correctly, but when executed from within the PHP script, after some seconds generating the video, the following error arises:

    av_interleaved_write_frame(): Operation not permitted

    If I decrease the quality (removing the -sameq parameter) of the resulting video, it is executed without this error. It seems there’s some kind of limitation executing it from PHP, but I can’t figure it out (I’ve increased the memory and time limits with no results).

    Any idea?
    thanks!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy