FFMpeg && pyFFMpeg — have questions!

Good night, %herpolsheimer%

There is a task, a task to which the answer is I don't wanna know. But I want to find out ways and methods of solutions, and all sorts of manuals PWHT.

What do we need:

There is a folder with the movie. It is necessary to log in to read what it is (obviously there is only video), and write the readings to a file.


Go to the folder, to do listing, write a list to a file (so that the name of the movie was with extension and relative path "~/home/movie/" ). Go to the file and call the file from the list for processing ffmpeg'ohms for veterania the length of the video.

PS: why not use ffmpeg -i ./movie.flv | grep lenght? Because the interest is to make a mini wrapper ffmpeg'and

The answer is I don't want to know I want to come to him. However, I want to naputstvie or some examples. Let's enter the folder, the parsing folder, the entry in the listing file.

Thank you thx!
October 8th 19 at 00:43
2 answers
October 8th 19 at 00:45
For a list of files in the directory see docs.python.org/library/os.html#os.walk

Help using pyffmpeg see in Google. Still remember pymedia.org/ (another wrapper of ffmpeg). As a variant to call ffmpeg and collect data with its output.
All right, to treat net external ffmpeg. Then the question is why there are wrappers? - Ila.Mayert commented on October 8th 19 at 00:48
In terms of why? Faster to call a library function through the wrapper in its address space than the program to run (a rather expensive operation, by the way), to wait for the completion of its work, and then another to parse the output. - Jakob_Lubowitz commented on October 8th 19 at 00:51
October 8th 19 at 00:47
Use mediainfo, the output of the desired options configured, can be used in shell scripts without additional processing

Find more questions by tags * nix-like systemsFFmpegPythonLinux