1

How can I load the output of below command into a text file?

ffmpeg -i units.wav -af silencedetect=noise=-20dB:d=0.2 -f null -

This command simply detects the silences from a video and I need to store this output in a text file.

I have also found this link but as I am newbie in ffmpeg I am not able to use it in my command.

Thanks..

Community
  • 1
  • 1
Jitender Kumar
  • 2,439
  • 4
  • 29
  • 43

2 Answers2

2

Wanted to post this update for other people who've had this problem. I had the same problem with the > pipe command and found you can use 2> instead. Possible FFMpeg bug? Not sure.

ffmpeg -i units.wav -af silencedetect=noise=-20dB:d=0.2 -f null - 2> output.txt
nwood21
  • 312
  • 2
  • 13
  • 1
    also, you may want to add the `-nostats` option otherwise you will get lots of lines that contain something like "bitrate=N/A speed= 117x" in addition to the output of the silence detector, not even separated by newlines. `ffmpeg -nostats -i units.wav -af silencedetect=noise=-20dB:d=0.2 -f null - 2> output.txt` – sebkur May 23 '20 at 19:40
0

You can pipe its output to a file like this:

ffmpeg -i units.wav -af silencedetect=noise=-20dB:d=0.2 -f null - > output.txt
franciscod
  • 992
  • 4
  • 17
  • this is similar to the answer on the linked (duplicate) question, what issues do you have with it? – franciscod Jul 15 '15 at 06:47
  • 2
    I was using the command like this " ffmpeg -i units.wav -af silencedetect=noise=-20dB:d=0.2 -f nulll - > output.txt 2>&1" and it was doing nothing, no output and no error message. But now I have also used the way you suggested above, command ran successfully and it also generated a text file but the text file is empty. – Jitender Kumar Jul 15 '15 at 06:58