pyglet/avbin misses beginning and end of video

久未见 提交于 2019-12-06 16:01:13

I've also run into the problem with the beginnings of files being glitchy when played through pyglet. I "fixed" it by re-encoding and force-adding a few extra keyframes at the start of the file:

avconv -i glitchy-file.mp4 -force_key_frames 0.01,0.02,0.03 \
-c:v h264 -c:a copy not-glitchy-file.mp4

This approach should work with suitably recent versions of ffmpeg too (just replace avconv with ffmpeg). I've only tested it with h264-encoded video streams, on linux, with avbin10, and libav built locally from their git master branch.

It is a hack, not a solution, since it doesn't tell you why pyglet is ignoring keyframes early in the stream, nor does it cause pyglet to read them correctly. But it makes the problem go away.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!