FFMPEG(oh) LOCAL FFMPEG(oh) ffmpeg - usage, edit and tips. OPTIONS -f FORMAT : See available formats with ffmpeg -formats -i INPUT Basic command $ ffmpeg -f FORMAT1 [FORMAT1_OPTIONS] -i INPUT1 [-f FORMAT2 [FORMAT2_OPTIONS] -i INPUT2 -f ...] OUTPUT_FILE options lists codecs : ffmpeg -codecs formats : ffmpeg -formats pixel formats : ffmpeg -pix_fmts EXAMPLES extract video : ffmpeg -i INPUT_FILE -c copy -an OUTPUT_FILE extract audio : ffmpeg -i INPUT_FILE -c copy -vn OUTPUT_FILE extract part of the file : ffmpeg -i INPUT_FILE -ss START_TIME -to END_TIME OUTPUT_FILE record desktop : ffmpeg -f x11grab -s WIDTHxHEIGHT -i DISPLAY OUTPUT_FILE record microphone audio : ffmpeg -f [alsa|pulse] -i default OUTPUT_FILE START_TIME and END_TIME use the format HH:MM:SS[.MS]. x11grab offset : -i DISPLAY+X_OFFSET,Y_OFFSET framerate : -framerate FRAMERATE video codec : -c:v CODEC pixel format : -pix_fmt FORMAT examples -f x11grab -s 1920x1080 -i :0.0 -f x11grab -s 1920x1080 -i :0.0+1920,0 -f x11grab -s 1920x1080 -framerate 30 -pix_fmt yuv420p -i :0.0+1920,0 DESKTOP AUDIO pulse 1. Find the output monitor source: pactl list sources Source #0 State: SUSPENDED Name: alsa_output.pci-0000_09_00.6.analog-stereo.monitor 2. Record from the monitor source: ffmpeg -f pulse -i 0 OUTPUT_FILE INPUTS filter_complex -filter_complex '[INPUT_ID:INPUT_CHANNEL]FILTER[MAP]' Audio Mix Mixing desktop and microphone audio: -f pulse -i 0 -f alsa -i default -filter_complex '[0:a][1:a]amerge=inputs=2' - [0:a] refers to input 0 (desktop in this case) and 'a' is the audio channel. - inputs=2 input count. Managing volume: This adjusts the volume based on input, eg.: 0.1 from the input volume, not the output. -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 - [0:a]volume=0.1[desk_audio] , [desk_audio] is a map to use later with the filter amerge. - set volume for each input (desk and mic) and merge them using the mapping: [mic_audio][desk_audio]amerge=inputs=2 SEE ALSO - Archlinux manpages: ffmpeg(1) links: - FFMPEG Documentation: https://ffmpeg.org/documentation.html - FFMPEG Trac wiki: https://trac.ffmpeg.org/wiki - FFMPEG Trac wiki - Capture PulseAudio: https://trac.ffmpeg.org/wiki/Capture/PulseAudio - FFMPEG Documentation - x11grab: https://ffmpeg.org/ffmpeg-devices.html#x11grab - FFMPEG Documentation - metadata: https://ffmpeg.org/ffmpeg-formats.html#Metadata-1 - FFMPEG Trac wiki - ALSA: https://trac.ffmpeg.org/wiki/Capture/ALSA - FFMPEG Trac wiki - Desktop: https://trac.ffmpeg.org/wiki/Capture/Desktop - FFMPEG Trac wiki - AudioVolume: https://trac.ffmpeg.org/wiki/AudioVolume - FFMPEG Trac wiki - Audio Channel Manipulation: https://trac.ffmpeg.org/wiki/AudioChannelManipulation AUTHORS ohazot(oh) | about(oh) | ohazot.com: https://ohazot.com linux , OpenBSD 7.8 | Created:2026-03-23|Updated:2026-03-28| FFMPEG(oh)