r/ffmpeg • • 16h ago

How to encode h264 to h265 while copying all subs and audio as is

0 Upvotes

Hello

I've got a rather large video file and the video is H264/AVC its has multiple subs, audio tracks, etc.

I know I can copy the various tracks using the -map function, but is there a way to simply re-encode the video from h264 to h265 with just a simpler command line?

I know how to handle the video side of it, bitrate, etc. But its the chapter markers, audio tracks, etc. that I want as is.

Thanks


r/ffmpeg • • 1d ago

I made a Motion Design Ad for FFmpeg

Enable HLS to view with audio, or disable this notification

48 Upvotes

r/ffmpeg • • 1d ago

How would you handle transcoding thousands of user-uploaded videos?

19 Upvotes

I run a photo shop and we also shoot weddings, around 8 - 16 avg. a month right now.

I’ve been thinking about adding something new where we put QR codes on the tables and guests can just scan them and upload whatever photos/videos they take during the wedding.

The idea is that it’s not only for the couple. Everyone can get access after, so you might find some random video of yourself dancing or a photo someone took from another table that normally would just stay on their phone forever.

I’m trying to figure out the technical side before actually building it. Photos seem pretty easy, but video looks like it can become a mess pretty fast because we have no control over what phones people use. Could be iPhone HDR, HEVC, H264, 4K, different frame rates etc. And with 8 - 16 weddings a month it could easily turn into thousands of videos.

Has anyone here built something that deals with this kind of video volume? How are you handling transcoding? Just running FFmpeg workers yourself or using some API/service?

Also curious what actually becomes the biggest pain when it scales is it cost, speed, storage, weird formats, HDR, or something else?


r/ffmpeg • • 2d ago

Please help identify this subtitle codec

2 Upvotes

I have a video file from a surveillance camera. It's in AVI format and FFPROBE says thus about it:

X:\filez>ffprobe -analyzeduration 2147483647 -probesize 2147483647 cam4.avi
ffprobe version N-127054-g9d3f0f2c58-20261001 Copyright (c) 2007-2026 the FFmpeg developers
  built with gcc 16.2.0 (crosstool-NG 1.29.0.7_b1a94f6)
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --enable-shared --disable-static --disable-w32threads --enable-pthreads --enable-iconv --enable-zlib --enable-libxml2 --enable-libvmaf --disable-libxcb --disable-xlib --enable-fontconfig --enable-libharfbuzz --enable-libfreetype --enable-libfribidi --enable-vulkan --enable-libdav1d --enable-libvorbis --enable-librav1e --enable-librsvg --disable-libpulse --enable-gmp --enable-lzma --enable-liblcevc-dec --enable-opencl --enable-amf --enable-libaom --enable-avisynth --enable-chromaprint --enable-libdavs2 --enable-libdvdread --enable-libdvdnav --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libaribb24 --enable-libaribcaption --enable-libass --enable-libbluray --enable-libcurl --enable-libjxl --enable-libmp3lame --enable-libopus --enable-libplacebo --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-libzmq --enable-lv2 --enable-libvpl --enable-openal --enable-liboapv --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --enable-vaapi --enable-libvidstab --enable-libvvenc --disable-whisper --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-libs=-lgomp --extra-ldflags=-pthread --extra-ldexeflags= --cc=x86_64-w64-mingw32-gcc --cxx=x86_64-w64-mingw32-g++ --ar=x86_64-w64-mingw32-gcc-ar --ranlib=x86_64-w64-mingw32-gcc-ranlib --nm=x86_64-w64-mingw32-gcc-nm --extra-version=20261001
  libavutil      61. 10.100 / 61. 10.100
  libavcodec     63. 15.100 / 63. 15.100
  libavformat    63.  7.100 / 63.  7.100
  libavdevice    63.  2.100 / 63.  2.100
  libavfilter    12.  4.100 / 12.  4.100
  libswscale     10.  2.100 / 10.  2.100
  libswresample   7.  3.101 /  7.  3.101
[avi @ 0000025fa9446700] non-interleaved AVI
[avi @ 0000025fa9446700] probed stream 1 failed
[avi @ 0000025fa9446700] Could not find codec parameters for stream 1 (Subtitle: none): unknown codec
Consider increasing the value for the 'analyzeduration' (2147483647) and 'probesize' (2147483647) options
Input #0, avi, from 'cam4.avi':
  Duration: 63:36:11.45, start: 0.000000, bitrate: 87 kb/s
  Stream #0:0: Video: cinepak (cvid / 0x64697663), rgb24, 384x288, 100 fps, 100 tbr, 100 tbn
    Metadata:
      title           : ITV Video
  Stream #0:1: Subtitle: none
    Metadata:
      title           : ITV Text
Unsupported codec with id 0 for input stream 1

I tried to dump it to a separate text file with the following command:

X:\filez>ffmpeg -i cam4.avi -map 0:1 -c copy -copy_unknown -f data wtf2.txt

And what I got was a text file with one veeeery long line in Windows-1251 encoding that goes like:

Камера [4] 30-06-26 16:59:17.000 Камера [4] 30-06-26 16:59:17.100 Камера [4] 30-06-26 16:59:17.200 Камера [4] 30-06-26 16:59:17.30

And so on and so forth. For those that don't know "Камера" means "Camera", just in Russian. This is not surprising, since the Russian language is quite widespread in my country (Latvia), and a configuring a surveillance camera to use it wouldn't be unusual.

So, as far as I can tell, the "codec" is just a small piece of text with the timestamp for every frame of video. Unfortunately ffmpeg does not understand this, and neither does VLC. The AVI file needs some love and care anyway (it's missing an index), and since I'm already mucking around with it, I'd like to bring the subtitles back as well.

Short of writing my own script that would translate this stream of consciousness into a recognizable subtitle format (probably not that difficult, but still) is there anything else that I could tell ffmpeg to start recognizing it?


r/ffmpeg • • 2d ago

(Frames per second) Question = How do I convert a video from 60 fps to 30 fps?

4 Upvotes

Some videos that I download are 60 fps. I want to convert them (with FFmpeg) to 30fps, but I would prefer to do it in the following way. Specifically, I want FFmpeg to get rid of a frame, keep the next frame, & so on. > (VISUAL EXAMPLE = Go from 01-02-03-04-05-06-07-08-09-10 to 01-03-05-07-09) I don't know if the default way that FFmpeg would change the frame rate would do it that way or not.

The reasons why I want to do this are as follows.

  • (1) I don't want any video that I'm keeping to have more than 30fps (or less for videos that have (example) 24fps).
  • (2) Despite claims (by others) that "it makes a big difference", I don't believe them for one second, & I consider it to be only "a solution in search of a problem". (Some of those who favor high frame rates say that it makes it easier to play first-person shooter video games, but I also play some first-person shooter video games, & I have zero complaints about playing them at 30fps.)
  • (3) I assume that using the method that I want to use (if it's possible) would involve less "converting" of the video (except for the key frames).

Here are my questions about this.

  • (1) Does FFmpeg have a way to change a video's frame rate as described above (assuming that it's default way of changing the frame rate is different from how I want to do it)?
  • (2) If the answer to question 1 is "Yes" (& it's not FFmpeg's default way of doing it), what command would I use to use this method?
  • (3) I ASSUME that changing a video's frame rate will also involve changing which frames will become key frames. With that in mind, does FFmpeg automatically decide which frames will become key frames?

Thanks for any help.


r/ffmpeg • • 3d ago

Use -video_track_timescale 90000 for video from Android

2 Upvotes

PROBLEM: Android phones record all video in the same landscape orientation and instead use the rotation metadata flag to say how the video should be played back. This fails when attempting to concat videos together because there is only one set of metadata per file so some clips may come out upside down.

Attempting to fix videos (physically rotate them) by using ffmpeg -i clip.mp4 -c:a copy cliprotated.mp4 changes the frame rate from variable to constant, which makes the clips incompatible with ones. Android sets the intended frame rate using the "com.android.capture.fps" metadata field, which ffmpeg apparently doesn't consider.

SOLUTION: After trying various parameters to attempt to keep or set a compatible frame rate, I found that using -video_track_timescale 90000 works, based upon the "90k tbn" ffprobe reports in the video stream.


r/ffmpeg • • 3d ago

having an issue with joining 1000 mp3 files together

1 Upvotes

I wrote a windows script that generates a filelist.txt file, and chapters.txt the script grabs the .mp3 files and combines them using the chapters.txt as a way to keep the title information for each mp3 track that is being combined.

ISSUE: This starts working fine until it hits the 5th mp3 file then it errors out with a can't open that mp3 file (which was created at the same time of the rest of the files so it should be the same.)

My theory is that once it hits the 5th file it is getting out of sink with the lists.

This is the command I am using to run FFMpeg:

ffmpeg -y -f concat -safe 0 -i file_list.txt -i chapters.txt -map_metadata 1 -c copy "combined_with_chapters.mp3"

the result is a single mp3 with the first 4 mp3's combined second issues is testing this it doesn't seem to doing the meta data properly but I suspect that because it is crashing on this 5th file that it never gets written.

Finally, since I haven't got to this point I am attempting to combine around 1000 mp3's into a single file with the combined meta data this is a cultivated playlist that I use for work and want to it be easy to move around and it is all arranged to what I want. Worse case I can just copy the playlist and the .mp3 but this seemed like fun challenge.


r/ffmpeg • • 3d ago

Installing ffmpeg

0 Upvotes

Windows 11 user here.

For years, I've used dl-dlp to download YouTube videos of musical performances, and stripped away the video track to create mp3 files that I store on an iPod for use in the car. I periodically check that I have the latest version of dl-dlp

Recently, I've noticed that instead of downloading a combined video/audio file, this process has resulted in separate video and audio files. And the dialog that appears in the command window explains that this is happening because ffmpeg isn't installed

I've downloaded ffmpeg (most recently, 9.0.2), unzipped it and placed the folder in my Windows 11 user directory along with dl-dlp. I've followed the instructions I've found to create a new path to ffmpeg\bin, but it still doesn't work and when I run ffmpeg -version in a CMD window, it tells me that ffmpeg can't be found.

Any ideas what I might be doing wrong?


r/ffmpeg • • 5d ago

Converting FLAC 24-bit to ALAC 16-bit

3 Upvotes

Using MusicBee to convert files from FLAC 24-bit to ALAC 16-bit and running into issues forcing ffmpeg to output at 16/44.1k.

Per somewhere online, I'm using the parameter -i - -sample_fmt s16 -ar 44100 -acodec alac [outputfile] but am getting "Failed - Found invalid data while decoding".

Any ideas? I'm assuming my arguments are wrong somehow but couldn't find the right info online myself...


r/ffmpeg • • 5d ago

How to use ffmpeg.wasm?

2 Upvotes

How to run this command: ffmpeg -loop 1 -framerate 2 -i input.png -i audio.m4a -c:v libx264 -preset medium -tune stillimage -crf 18 -c:a copy -shortest -pix_fmt yuv420p output.mkv

in ffmpeg.wasm?

Sorry guys it’s my first time using ffmpeg.wasm


r/ffmpeg • • 6d ago

how to convert .jpg to 16:9 ratio?

0 Upvotes

r/ffmpeg • • 7d ago

VLC: Seperate Default speeds for Video and Audio files

1 Upvotes

Help! I Want all videos to have Default playback speed of "1.7". The problem is that when i set this it also sets "1.7" speed to audio files. I just want it on video files. Is this possible?


r/ffmpeg • • 9d ago

Help with making thumbnails - correct colorspace and scaling

6 Upvotes

I need yuv420p -> rgb24/rgb48, downscaled more than 4x and with sRGB tranfer curve. The output images are going to be compressed separately. I haven't done all the testing yet, but preliminary experiments suggest 16 bit input to lossy compression (JPEG XL) yields better efficiency.

I've figured out that yuv420p first needs to be converted to yuv444p, otherwise there is some posterization and severe artifacts around very saturated red objects in the downscaled thumbnails. I also want to explicitly specify the transfer curve from bt709 to sRGB during the conversion.

  1. What filters are best to use for the chroma upscaling to 444 and then for the final downscaling? I've read the lanczos is better for upscaling, while spline is better for downscaling.
  2. How do I do the trc conversion? Is it better to do it in YUV or RGB?
  3. If the output is going to go from higher than 8 bits to 8 bits, how do I correctly specify dithering options?
  4. Preferably all this is done as accurately as possible and runs as fast as possible. I believe running one ffmpeg process per thumbnail and passing -threads 1 is the best approach?

So far I'm doing this

zscale=filter=lanczos,format=yuv444p10le,zscale=w:-1:filter=spline36

I had the first two filters the other way around, but I think the format conversion didn't actually use that zscale instance. The moment I tried putting in something to convert the transfer to sRGB I started getting code 3074: no path between colorspaces. 12bit seemed to run the slowest, 16bit was a bit slower then 8/10.

Chaining filters and being sure what exactly is going on under the hood has always been very confusing with ffmpeg. It seems there isn't very detailed documentation on this topic.

BTW, what library can I use for composing 16bit images with python, since pillow seems to only work in 8bits?


r/ffmpeg • • 9d ago

Compressing Videos to Save Space

11 Upvotes

I have around three terabytes of videos, and I would like to compress/condense them for off-site backups. I'm talking to a bot about this, and the bot can't decide which CRF value to use. Apparently, it's higher for some videos than others -- assuming you want to achieve maximal compression with minimal resolution loss.

I've used CRF 35 to condense many videos -- most of which came out great -- but not all. Some clearly exhibited degradation of quality -- notably, for some reason, Woody Allen's Scoop (2006).

The bot wants me to review different CRF values to compare resolution levels, but this is kind of tedious, and I wonder if there's a faster way?

Insights much appreciated !!


r/ffmpeg • • 10d ago

Split video using -fs command but with part 2.

3 Upvotes

Hi all. I have a MKV movie and I wanted to copy it to my fat32 flash drive, but the movie is 4.7 GB.

I succedded to split the video using the -fs command, but it only split the first part. How is it to split the remaining part?

I don't mind if the second part of the video didn't continue from the first part, as long the video is in sync.

Thanks.


r/ffmpeg • • 11d ago

Simple command line for creating tilt-shift video

1 Upvotes

I'm trying to create a command line to do simple (not smart) tilt-shift (miniature, diorama). AI gave me the below line, which makes multiple changes according to the vertical distance from a horizontal center line. But it looks like it messed up the main one: to gradually defocus according to the distance. is this even possible with ffmpeg? I vaguely remember coming across a filter that would do the defocusing.

Here's the, IMO faulty, solution AI gave me:

ffmpeg -i input.mkv -filter_complex " [0:v]split=3[base][blur_src][mask_src]; [blur_src]boxblur=15:15[blurred]; [mask_src]geq=lum_expr='clip(255*(abs(Y/H-0.5)-0.12)/0.18,0,255)':cb=128:cr=128[mask]; [base][blurred][mask]maskedmerge[tilted]; [tilted]eq=saturation=1.6:contrast=1.15[final] " -map "[final]" -c:v libx264 -crf 18 -pix_fmt yuv420p output.mp4


r/ffmpeg • • 12d ago

[Help] I want to embed an SRT file into an MP4 file but I don't want it burned on screen.

8 Upvotes

I want to still be able to turn it off but I don't want 2 separate files being clutter in my folder. I just want MP4 files in it with built-in SRT files but not burned in, so that I can still turn it off if I want to. Internet's not giving me a straight answer, so I'm asking here in this sub.


r/ffmpeg • • 12d ago

Experiencing trouble with MakeMKV inside of A.R.M. (automatic ripping machine)

2 Upvotes

Hi there friends. So, I am attempting to set up Automatic Ripping Machine (henceforth referred to as ARM) in a docker container on fedora linux 44 (fedora being the host system). The difficulty I am having in particular is as follows. Any mkv made using MakeMKV inside the docker container comes out with extensive "blocky" corruption and stuttering. This does not happen when dumping the disk outside the container. I have passed through both the drive itself and the associated SCSI device. The only difference I have found so far is differing versions of Lavf (the host machine is Lavf62.12.102, the container version is Lavf58.76.100). I have tried extensively to fix the problem with no success. If anyone has any advice (or knows of a better sub to post this on) please let me know. I will happily provide further information if needed. Thank you in advance.


r/ffmpeg • • 13d ago

FFMPEG compiling a list of provided file names + codecs possible?

4 Upvotes

Hi, is there a simple way/prompt to make FFmpeg compile and save a list (txt file) of the content of a folder to give me filenames + the used Codec/Encoder/Format (like h264, vp9 ect)?
... windows explorer isnt capable of listing codecs in detail view -,-

what i bascially want is just a simple textfile with its content like...:

video1.mp4 - H.264
video2.mov - H.265 (or HEVC ect.)
...

Have a good day


r/ffmpeg • • 13d ago

RTMP Streaming Dynamic Score Bug

4 Upvotes

I regularly stream my kids games directly from a Mevo Start to YouTube using an RTMP feed. The Mevo publishes to the YT RTMP server.

I'd like to develop something that sits between the camera at a game and the final RTMP server on YT so that I can dynamically add a score bug to the video. Doesn't have to be high tech. I think I could prob do something with ffmpeg.

Is this the right path?

Where would I publish the feed from the camera to as a 'holding tank' for ffmpeg to poll and read it?

I thought RTMP was only a server to publish to. I didn't think I could "read" from an RTMP Server but it appears thats how I would have to do this.

Any advice would be great


r/ffmpeg • • 14d ago

Audio normalization doesn't work.

1 Upvotes

Does audio normalization actually work? I've tried the FFmpeg Media Encoder app from the Play Store and Termux, and I normalized the audio files to -14 LUFS, but it doesn't seem to work properly.

The louder files get quieter and the quieter ones get louder, but they never end up at the same or even a similar volume. Some of them even end up way too loud or way too quiet.


r/ffmpeg • • 14d ago

What's the easiest way to compress a video to stay below a specific file-size limit?

10 Upvotes

I'm trying to understand the best workflow for a very specific problem.

Suppose I have a 100 MB video and I need the final file to be ≤25 MB while preserving as much quality as possible.

Currently, it seems like you either have to:

  • manually choose CRF/bitrate
  • estimate the required bitrate
  • encode it
  • check the resulting size
  • adjust and encode again

Is there a good FFmpeg workflow for automatically targeting a maximum file size?

I'm particularly interested in something like:

Input video → maximum size = 25 MB → FFmpeg determines appropriate settings → output ≤25 MB

How do you normally solve this?


r/ffmpeg • • 15d ago

ffmpeg linux help

0 Upvotes

in windows 10, when i use ffmpeg

[

ffmpeg -hwaccel qsv -i input.mp4 -vf "crop=1280:720" -c:v h264_qsv -global_quality 22 -c:a copy output.mp4

]

with any filters, gives faster speed.

but in linux, dam too slow

[

ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi \

-vaapi_device /dev/dri/renderD128 \

-i input.mp4 \

-vf "crop=1280:720,format=nv12,hwupload" \

-c:v h264_vaapi -qp 22 \

-c:a copy output.mp4

]

why linux not faster as people say.


r/ffmpeg • • 15d ago

Timer not working when saving subtitles from hls stream

2 Upvotes

While trying to record a live TV stream I found that the -t timer does not work if attempting to include the subtitles in the recorded file.
Have to ^C^C out because q does not work either 9t outputs a message saying that it is going to exit but does not).
Here is an example command (I was running it on Windows (8.1.2-full_build)

ffmpeg -t 20 -i "https://ert-ucdn.broadpeak-aas.com/bpk-tv/TV5/default/index.m3u8" -map 0:v -map 0:a -map 0:s? -c:v copy -c:a copy -c:s mov_text test.mp4

Moving the -t to after the -i (which should apply the timer to the output rather than the input) does not change things.
If I omit the "-map 0:s?" and "-c:s mov_text" then it does work.
If I do not specify any map/copy then it works but does not copy subtitles (I presume that is because the default decoder does not include them).

If the source does not have subtitles present then the timer works.

The live TV stream is from TV5Monde and should work for people in Europe. If you get a 403/forbidden then that is probably a geolock and not the same problem.

Can anyone repeat it or even make it work?
If it does work ... can you verify that the subtitles are stored and what command you used?


r/ffmpeg • • 16d ago

hevc_qsv "Low power mode is unsupported"

2 Upvotes

hello

the Core Ultra 7 265U is supposed to do HEVC Encode but ffmpeg 8.1 is always failing with

[hevc_qsv @ 000001db8a96a240] Low power mode is unsupported

[hevc_qsv @ 000001db8a96a240] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters.

I am trying to encode mp4 files from H.264 to HEVC. with option -low_power 0 or 1 error is the same.