Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

playing video while encoding with ffmpeg

Tags:

php

ffmpeg

in my Webapplication the user should be able to upload his own videos (either format). I am using ffmpeg to encode the video to .mp4 and .flv using the command:

ffmpeg -i uservid.whatever output.mp4 output.flv

while ffmpeg encodes the video, it's loaded in the flowplayer on the users-page. But flowplayer always says "file not found" cause ffmpeg is not yet finish with encoding.

Is there a possibility to load the video in a certain player even if it is not yet completly encoded? maybe there is a ffmpeg option?

Thanks

like image 269
user1857519 Avatar asked Mar 21 '23 11:03

user1857519


1 Answers

FLV yes, mp4 no. with flv you can have ffmpeg write to stdout and do whatever you need to with the output. mp4 requires a frame index (moov) that is not known until the entire file is encoded. flv encodes the information in every frame.

like image 115
szatmary Avatar answered Mar 28 '23 22:03

szatmary