Zulko / moviepy

Video editing with Python
https://zulko.github.io/moviepy/
MIT License
12.66k stars 1.59k forks source link

Why don't you use FFPROBE's JSON output for media info? #477

Open qacollective opened 7 years ago

qacollective commented 7 years ago

Hi,

I first came across your project from your blog here: http://zulko.github.io/blog/2013/09/27/read-and-write-video-frames-in-python-using-ffmpeg/

Fantastic and simple use of ffmpeg through pipes. Then when I read your source code for moviepy I was surprised to see your comment that 'it gets ugly'.

One of the parts that seemed to be 'ugly' was parsing the media info. But I'm not sure why you're doing that when you can simply pipe FFPROBE's JSON ouput into a python JSON object and have heaps of data at your fingertips!

Type the following into a command prompt and you'll see what I mean: ffprobe -v quiet -print_format json -show_format -show_frames -count_frames -show_streams <file-name>

Additionally, I think it would be great if the distinction of a movie and an image be removed - if it hasn't been already (I saw references to ImageClip?). FFMPEG doesn't distinguish, so it would be cool if this library didn't - a .JPG is simply a single frame video. Handy for writing client programs that just 'process video' (or audio for that matter).

Andrew

thenewguy commented 5 years ago

related https://github.com/Zulko/moviepy/issues/249