0

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

newBike
  • 14,385
  • 29
  • 109
  • 192
  • 1
    [`cmd args |& tee file`](http://linux.die.net/man/1/tee). See [How do I write stderr to a file while using “tee” with a pipe?](http://stackoverflow.com/a/692407/4279) if you don't want to merge stdout/stderr – jfs Mar 10 '14 at 03:42

2 Answers2

4

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

cmd 2>&1 | tee -a log

Isa A
  • 1,342
  • 13
  • 31
1

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.

b2Wc0EKKOvLPn
  • 2,054
  • 13
  • 15