简体   繁体   中英

Looking to play back non-encoded video upload then export gif from selection point via FFMPEG

We've been trying to crack this code all week, reaching out to everyone to see if you have any solutions?

  1. We want the user to upload a video and in the next step he will select a small 5 second loop of the video which will be made as a gif.
  2. Old developer was able to do this by splicing the video at 10 seconds instead of 5 but not re-encoding it meant that it would sometimes be beyond 12 seconds and in some cases less than 7.
  3. We changed the code to force keyframes with re encoding so that it splices the video at exactly 5 seconds to show the loop.
  4. These slices are shown to the user using html5 video player.
  5. Upon selection of the loop that sliced video is converted to gif.

Everything is working in the vice order. The issue is when the user uploads a large sized and length video this slicing and re-encoding takes forever and that cause the user to feel the site is not working properly.

What we want is very simple:

  1. Show 5 second portion of the video on loop.
  2. If user wants to select another loop he/she clicks the next button and is taken to the next 5 second loop which would be either at 25% of the video or some other
  3. On selection of that portion it converts it into gif.

Don't encode the whole video, just seek the the closest key frame, start decoding, throw away the frames until the frame you want, then start encoding at that frame. Ffmpeg can do this by specifying seek parameters before and after the input.

We hired a developer that created a solution to the problem. Thank you for your help!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM