Closed BurguerJohn closed 4 years ago
Thank you for bringing this to my attention! I am using MoviePy to convert a sequence of images to a video, which underneath the hood uses FFmpeg. So this is probably something that should be addressed within MoviePy. I just checked the Github issues for MoviePy but nothing came up with respect to this issue, which is a little surprising.
I can't say for sure if this is the problem that are making some output not play correctly, but i can say that i managed to fix the video using this command: !ffmpeg -y -i {input} -vf "pad=ceil(iw/2)2:ceil(ih/2)2" -c:v libx264 -crf 17 -pix_fmt yuv420p {output}
Which would mean that FFmpeg can read and reprocess the video. So the issue is probably the video player, have you tried VLC?
I did managed to open the video inside chrome without this step, but twitter failed to upload the file without it. I am sure that some players can open the file without it as well.
I see, that makes sense. Again, thank you for bringing this up!
No problem! Awesome project btw. Keep the good work.
You can play the files with VLC, but not anything else. On the upside though if you try to re-encode them so Twitter accepts them you get a pretty cool effect! https://twitter.com/jonathanfly/status/1196711034628775936
Thanks Jonathan, actually i already follow you in twitter and saw your tweet before coming here. I just made a video on youtube showing this project with a few tests i made. https://youtu.be/3JroOSnBuAk
That's awesome, thank you for sharing these results!
Thank you all again for bringing this up and for the discussion. I am closing this for now since it is not an immediate issue with the provided code but with MoviePy / FFmpeg / VLC.
At least i think this is the problem. More of a mp4 limitation that a bug. I usually fix this in ffmpeg using: -vf "pad=ceil(iw/2)2:ceil(ih/2)2"