Save find -exec output to text file
15,111
I think what might be happening here is that ffmpeg
is sending its output to stderr
, in which case what you want is just:
find . -type f -exec ffmpeg -i {} \; 2>log.txt
I don't have ffmpeg
in my distro to test with, but this has been verified with avconv
from libav
(should still be the same in this respect).
Related videos on Youtube
![Gilles 'SO- stop being evil'](https://i.stack.imgur.com/cFyP6.jpg?s=256&g=1)
Author by
Gilles 'SO- stop being evil'
Updated on September 18, 2022Comments
-
Gilles 'SO- stop being evil' almost 2 years
I have a set of videos in the folder. I would like to get the info about this videos using
ffmpeg -i
command and save the output to file.So I wrote the line:
find . -type f -exec ffmpeg -i {} \; > log.txt
But surprisingly, the log is empty! What am I missing here?
-
Gilles 'SO- stop being evil' over 10 years
find . -type f -exec ls {} >> /tmp/test.log \;
is exactly the same asfind . -type f -exec ls {} \; >> /tmp/test.log
. It's a simple command, the redirection can be anywhere on the line.