I
I
iandriyanov2012-04-07 20:56:01
linux
iandriyanov, 2012-04-07 20:56:01

FFMpeg && pyFFMpeg - have questions!

Good night,% habrauser%

There is a task, a mini-task, the answer to which I do not want to know here. But I want to know the ways and methods of solving, and all kinds of manuals.

What you need:

There is a folder with a movie. You need to enter it, read what is in it (obviously there is only video), and write what you read to a file.

Plan:

Go to the folder, make a listing, write the list to a file (so that the movie names are with the extension, and if possible the relative path is "~/home/movie/" ). Go to the file, and in turn call the file from the list to be processed by ffmpeg to extract the length of the video.

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

I don't want to know the answer, I want to come to it myself. However, I want to get parting words or some examples. Let's say entering a folder, parsing a folder, writing a listing to a file.

Thanks\thx!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
tasman, 2012-04-07
@tasman

For a list of files in a directory, see docs.python.org/library/os.html#os.walk For
help using pyffmpeg, google it. Also remember pymedia.org/ (another ffmpeg wrapper). As an option, call ffmpeg and take data from its output.

B
BasilioCat, 2012-04-07
@BasilioCat

Use mediainfo, the output of the necessary parameters is configurable, it can be used in shell scripts without additional processing

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question