M
M
MusicMan_082014-04-05 13:32:22
bash
MusicMan_08, 2014-04-05 13:32:22

Bash script for video encoding?

There are many folders in the directory, there are more folders in these folders. Some of these folders have txt files.
With the command

find path/to/total/folder -name "*.txt" -exec dirname {} \;

extract paths to directories containing txt file.
How do I pass these paths further so that ffmpeg only converts videos in those directories?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
J
jcmvbkbc, 2014-04-05
@jcmvbkbc

man xargs ?

M
MusicMan_08, 2014-04-06
@MusicMan_08

The result of running this command
I get for example 3 directories that contain txt.
How can I force ffmpeg to encode videos of a certain type in these directories?
Can I please have an example?

M
MusicMan_08, 2014-04-06
@MusicMan_08

find video -name "*.txt" | xargs dirname | sort -u | xargs -I {} find \{} -name "*.MP4" | while read movie; do ffmpeg -i "$movie" -vcodec prores -profile:v 3 -acodec copy "${movie%.*}Final.mov"; done

gives this:
if more than 1 directory is found, contained in the output of find.
If there is only one directory, then the encoding goes as expected.
How to make coding go in parallel in different directories?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question