简体   繁体   English

希望播放非编码视频上传,然后通过 FFMPEG 从选择点导出 gif

[英]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.我们希望用户上传视频,在下一步中,他将 select 视频的一小段 5 秒循环,将制作为 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.老开发者能够通过以 10 秒而不是 5 秒拼接视频来做到这一点,但不重新编码这意味着它有时会超过 12 秒,在某些情况下会小于 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.我们更改了代码以强制重新编码关键帧,以便它在 5 秒处拼接视频以显示循环。
  4. These slices are shown to the user using html5 video player.这些切片使用 html5 视频播放器向用户显示。
  5. Upon selection of the loop that sliced video is converted to gif.在选择将切片视频转换为 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.循环播放视频的 5 秒部分。
  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如果用户想要 select 另一个循环,他/她单击下一个按钮并进入下一个 5 秒循环,该循环将是视频的 25% 或其他一些
  3. On selection of that portion it converts it into gif.在选择该部分时,它会将其转换为 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. Ffmpeg 可以通过在输入前后指定搜索参数来做到这一点。

We hired a developer that created a solution to the problem.我们聘请了一位开发人员来解决问题。 Thank you for your help!谢谢您的帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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