[FFmpeg-user] how to avoid broken pi
meex
meex at rbox.me
Thu Jan 27 00:36:09 EET 2022
> 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".
thanks for the tip - i've been looking into this and not understanding
how to accomplish it
for bash the command is stty and it seems the relevant options are:
ixany
ixoff
ixon
what i don't understand is 1) which one(s) to use and 2) how to use them
in a shell script; should this be near the top of the script so it's
global, or should these options be enabled/disabled as needed per-command?
Nicolas George wrote:
> 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,
>
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
More information about the ffmpeg-user
mailing list