idank / explainshell

match command-line arguments to their help text

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't parse ffmpeg properly at all

bizxta opened this issue · comments

Hello, I attempted to explainshell this ffmpeg command, but it completely messed up.

ffmpeg -reconnect 1 -reconnect_at_eof 1 -reconnect_streamed 1 -reconnect_delay_max 2 -y -nostdin -hide_banner -loglevel fatal -i http://127.0.0.1:9981/stream/channelnumber/$1 -vcodec copy -acodec copy -scodec copy -g 60 -fflags +genpts -user_agent HLS_delayer -metadata service_provider="TimeShift" -metadata service_name="NovaTV +1" -f hls -hls_flags delete_segments -hls_time 10 -hls_list_size 360 -hls_wrap 361 -hls_segment_filename /disk2/timeshift/$1_%03d.ts /disk2/timeshift/$1_hls.m3u8

The main issue here seems to be that it's expecting single-hyphen arguments to be getopt-style single-letter sequences (i.e. "short opts"), but in ffmpeg (as well as some other multimedia tools, e.g. mpv), they're handled in more or less the way getopt handles double-hyphen args (i.e. "long opts"). Overriding this for ffmpeg and similar tools would probably improve output substantially.