newBike
newBike

Reputation: 14992

How to keep stderr output and also redirect it to file

I tried ffmpeg -i rtsp://172.19.1.34/live.sdp -acodec copy -vcodec copy b.mp4 2>>log.txt 2>&1

to keep stderr output and also redirect it to file.

But it failed.

However, I can keep the stderr output by

ffmpeg -i rtsp://172.19.1.34/live.sdp -acodec copy -vcodec copy b.mp4 2>log.txt

Upvotes: 0

Views: 276

Answers (2)

Isa A
Isa A

Reputation: 1382

You can redirect stderr to stdout with 2>&1, and then use tee command.

cmd 2>&1 | tee -a log

Upvotes: 4

b2Wc0EKKOvLPn
b2Wc0EKKOvLPn

Reputation: 2074

try this

ffmpeg -i  rtsp://172.19.1.34/live.sdp -acodec copy -vcodec copy b.mp4 &> log.txt

or this

nohup ffmpeg -i  rtsp://172.19.1.34/live.sdp -acodec copy -vcodec copy b.mp4

and look for nohup.out after the command returns.

Upvotes: 1

Related Questions