I tried extract frame and save it as output.jpg On server side:
f = "ffmpeg -vframes 1 -y -ss "+time+" -i ./media/somemov.mp4 ./media/output.jpg"
subprocess.call(f, shell=True)
And on client side used:
getImage(noOfFrame); //send the request for call the ffmpeg function from views.py
document.getElementById("main").style.backgroundImage="url(http://localhost:8000/media/output.jpg#"+ new Date().getTime();+")";
But its too slow. DIV displays always the old image becose creates image takes a long time.
for example i want image no 3 and DIV has no 2, i want image no 4, and div has no 3.
Is there any way how to extract frame from video (by ffmpeg) and send it into Python without creation the output.jpg file?
I want get the image data and send it from server (django) to webpage and set it as background-image of any DIV.
Is the “pure data sending” solution better then mine?
Thanks for help.
short answer: no.
There is a better way to do this though.