meex (12022-01-26):
> in a bash script i'm using ffmpeg to create a spectrogram movie and pipe the
> output to a decoder (mpv in this case, but it doesn't matter)
> 
> as expected, if the user exits mpv before ffmpeg completes, it returns a
> broke pipe error and i would like to avoid that if possible
> 
> the problem is that the terminal may refuse to accept any user input when
> this happens (this occurs ~20% of the time)

This is not a problem with ffmpeg. You should configure your shell to
set the tty to a sane state before a prompt. With zsh, it is done with
"ttyctl -f".

> is there a way to have ffmpeg exit gracefully when the pipe is broken?

Again, it is not ffmpeg's responsibility:

Compare:

ssecem ~ $ sh -c "dmesg" | head -n 1
[    0.018123] On node 0, zone DMA32: 1580 pages in unavailable ranges
zsh: exit 141   sh -c "dmesg" |
zsh: done       head -n 1

ssecem ~ $ sh -c "trap '' PIPE; dmesg" | head -n 1
[    0.018123] On node 0, zone DMA32: 1580 pages in unavailable ranges
dmesg: write error
zsh: exit 1     sh -c "trap '' PIPE; dmesg" |
zsh: done       head -n 1

Regards,

-- 
  Nicolas George

Attachment: signature.asc
Description: PGP signature

_______________________________________________
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to