.Dd Created:2026-03-23|Updated:2026-03-28| .de ocsi \\$* , .. .de oxr .ocsi .Xr \\$* .. .de oit .It \\$* .. .de obdi .Bl -dash -compact .oit \\$* .. .de obdl .Bd -literal -compact \\$* .. .de onote .Bl -hang -compact .oit \\$* .El .. .de ocomm .Bl -diag -compact .oit \\$* .El .. .de opsy .Pp .Sy - \\$* .. .de obc .Bl -column \\$* .. .de obc2 .obc opt desc .. .de obc3 .obc option arguments description .. .Dt FFMPEG oh .Os linux , OpenBSD 7.8 | .Nm ffmpeg .Nd usage, edit and tips. .Sh OPTIONS .obc _f_format .It -f FORMAT Ta : See available formats with Li ffmpeg -formats .It -i INPUT .El .Ss Basic command .Dl $ ffmpeg -f FORMAT1 [FORMAT1_OPTIONS] -i INPUT1 [-f FORMAT2 [FORMAT2_OPTIONS] -i INPUT2 -f ... ] OUTPUT_FILE .Ss options lists .obc pixel_form .It codecs Ta : Li ffmpeg -codecs .It formats Ta : Li ffmpeg -formats .It pixel formats Ta : Li ffmpeg -pix_fmts .El .Sh EXAMPLES .obc extract_part_of_the_f command .It extract video Ta : Li ffmpeg -i INPUT_FILE -c copy -an OUTPUT_FILE .It extract audio Ta : Li ffmpeg -i INPUT_FILE -c copy -vn OUTPUT_FILE .It extract part of the file Ta : Li ffmpeg -i INPUT_FILE -ss START_TIME -to END_TIME OUTPUT_FILE .It record desktop Ta : Li ffmpeg -f x11grab -s WIDTHxHEIGHT -i DISPLAY OUTPUT_FILE .It record microphone audio Ta : Li ffmpeg -f [alsa|pulse] -i default OUTPUT_FILE .El START_TIME and END_TIME use the format HH:MM:SS[.MS]. .Sh x11grab .obc pixel_for command .It offset Ta : Li -i DISPLAY+X_OFFSET,Y_OFFSET .It framerate Ta : Li -framerate FRAMERATE .It video codec Ta : Li -c:v CODEC .It pixel format Ta : Li -pix_fmt FORMAT .El .Ss examples .obc2 .It Li -f x11grab -s 1920x1080 -i :0.0 .It Li -f x11grab -s 1920x1080 -i :0.0+1920,0 .It Li -f x11grab -s 1920x1080 -framerate 30 -pix_fmt yuv420p -i :0.0+1920,0 .El .Sh DESKTOP AUDIO .Ss pulse .Bl -enum -compact .It Find the output monitor source: .Li pactl list sources . Eg.: .obdl Source #0 State: SUSPENDED Name: alsa_output.pci-0000_09_00.6.analog-stereo.monitor .Ed .It Record from the monitor source: .Li ffmpeg -f pulse -i 0 OUTPUT_FILE .El .Sh INPUTS .Ss filter_complex .Dl -filter_complex '[INPUT_ID:INPUT_CHANNEL]FILTER[MAP]' .Ss Audio Mix Mixing desktop and microphone audio: .Dl -f pulse -i 0 -f alsa -i default -filter_complex '[0:a][1:a]amerge=inputs=2' .obdi [0:a] refers to input 0 (desktop in this case) and 'a' is the audio channel. .oit inputs=2 input count. .El Managing volume: This adjusts the volume based on input, eg.: 0.1 from the input volume, not the output. .Dl -f pulse -i 0 -f alsa -i default -filter_complex '[0:a]volume=0.1[desk_audio];[1:a]volume=5[mic_audio];[mic_audio][desk_audio]amerge=inputs=2' -c:a pcm_s24le .obdi .Li [0:a]volume=0.1[desk_audio] , [desk_audio] is a map to use later with the filter amerge. .oit set volume for each input (desk and mic) and merge them using the mapping: .Li [mic_audio][desk_audio]amerge=inputs=2 .El .Sh SEE ALSO .opsy Archlinux manpages: .Xr ffmpeg 1 .Ss links: .obc2 .It - Lk https://ffmpeg.org/documentation.html FFMPEG Documentation .It - Lk https://trac.ffmpeg.org/wiki FFMPEG Trac wiki .It - Lk https://trac.ffmpeg.org/wiki/Capture/PulseAudio FFMPEG Trac wiki - Capture PulseAudio .It - Lk https://ffmpeg.org/ffmpeg-devices.html#x11grab FFMPEG Documentation - x11grab .It - Lk https://ffmpeg.org/ffmpeg-formats.html#Metadata-1 FFMPEG Documentation - metadata .It - Lk https://trac.ffmpeg.org/wiki/Capture/ALSA FFMPEG Trac wiki - ALSA .It - Lk https://trac.ffmpeg.org/wiki/Capture/Desktop FFMPEG Trac wiki - Desktop .It - Lk https://trac.ffmpeg.org/wiki/AudioVolume FFMPEG Trac wiki - AudioVolume .It - Lk https://trac.ffmpeg.org/wiki/AudioChannelManipulation FFMPEG Trac wiki - Audio Channel Manipulation .El .Sh AUTHORS .An -nosplit .Xr ohazot oh | .Xr about oh | .Lk https://ohazot.com ohazot.com .Aq Mt admin@ohazot.com