r/ffmpeg • • 11h ago

Output h265 using cuda hevc_nvenc freezes on pausing playback

3 Upvotes

Seeing a strange issue when transcoding from h.264 files to h.265 files using ffmpeg and the nvidia encoder, whilst the output looks files and plays fine, if you pause the video at any point (I'm using VLC for play back) for a few seconds and resume playback, the video freezes entirely, and even seeking to a new position does not unfreeze it (audio continues to play) - if you seek normally without having paused it then the video loads instantly. You have to stop playback of the file entirely and play it again for the video to come back. The h.264 file before transcoding does not have this issue, only the output h.265 file. The command I am using is: ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i "<input>" -filter:v fps=25 -c:v hevc_nvenc -b_ref_mode each -bf 4 -b_adapt 1 -preset p7 -profile:v main -tier high -tune hq -rc:v vbr -lookahead_level:v 14 -multipass:v 2 -cq:v 36 -c:a copy "<output>", I've tried with combinations of -intra-refresh 1, -single-slice-intra-refresh 1, -no-scenecut 1, -g 120, -forced-idr 1 and -force_key_frames "250" but nothing seems to fix it.

Output from running it:

ffmpeg version 9.0.1-full_build-www.gyan.dev Copyright (c) 2000-2026 the FFmpeg developers                                built with gcc 16.1.0 (Rev2, Built by MSYS2 project)                                                                    configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-cairo --enable-fontconfig --enable-iconv --enable-gnutls --enable-lcms2 --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-libdvdnav --enable-libdvdread --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libopenjpeg --enable-libquirc --enable-libuavs3d --enable-libxevd --enable-libzvbi --enable-liboapv --enable-libqrencode --enable-librav1e --enable-libsvtav1 --enable-libvvenc --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxeve --enable-libxvid --enable-libaom --enable-libjxl --enable-libsvtjpegxs --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d12va --enable-ffnvcodec --enable-libvpl --enable-nvdec --enable-nvenc --enable-vaapi --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-openal --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-liblc3 --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint --enable-whisper                                                                                                   libavutil      61.  1.101 / 61.  1.101                                                                                  libavcodec     63.  1.101 / 63.  1.101                                                                                  libavformat    63.  1.101 / 63.  1.101                                                                                  libavdevice    63.  1.101 / 63.  1.101                                                                                  libavfilter    12.  1.101 / 12.  1.101                                                                                  libswscale     10.  1.101 / 10.  1.101                                                                                  libswresample   7.  1.101 /  7.  1.101                                                                                Input #0, matroska,webm, from 'D:\file.mkv':                     Metadata:                                                                                                                 encoder         : libebml v1.3.4 + libmatroska v1.4.5                                                                   creation_time   : 2017-08-05T00:18:14.000000Z                                                                         Duration: 00:28:35.96, start: 0.000000, bitrate: 3707 kb/s                                                              Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn (default)       Metadata:                                                                                                                 BPS             : 3449048                                                                                               BPS-eng         : 3449048                                                                                               DURATION        : 00:28:35.960000000                                                                                    DURATION-eng    : 00:28:35.960000000                                                                                    NUMBER_OF_FRAMES: 42899                                                                                                 NUMBER_OF_FRAMES-eng: 42899                                                                                             NUMBER_OF_BYTES : 739803566                                                                                             NUMBER_OF_BYTES-eng: 739803566                                                                                          _STATISTICS_WRITING_APP: mkvmerge v14.0.0 ('Flow') 64bit                                                                _STATISTICS_WRITING_APP-eng: mkvmerge v14.0.0 ('Flow') 64bit                                                            _STATISTICS_WRITING_DATE_UTC: 2017-08-05 00:18:14                                                                       _STATISTICS_WRITING_DATE_UTC-eng: 2017-08-05 00:18:14                                                                   _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES                                                         _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES                                                 Stream #0:1(eng): Audio: mp3 (mp3float), 48000 Hz, stereo, fltp, 128 kb/s (default)                                       Metadata:                                                                                                                 BPS             : 128000                                                                                                BPS-eng         : 128000                                                                                                DURATION        : 00:28:35.928000000                                                                                    DURATION-eng    : 00:28:35.928000000                                                                                    NUMBER_OF_FRAMES: 71497                                                                                                 NUMBER_OF_FRAMES-eng: 71497                                                                                             NUMBER_OF_BYTES : 27454848                                                                                              NUMBER_OF_BYTES-eng: 27454848                                                                                           _STATISTICS_WRITING_APP: mkvmerge v14.0.0 ('Flow') 64bit                                                                _STATISTICS_WRITING_APP-eng: mkvmerge v14.0.0 ('Flow') 64bit                                                            _STATISTICS_WRITING_DATE_UTC: 2017-08-05 00:18:14                                                                       _STATISTICS_WRITING_DATE_UTC-eng: 2017-08-05 00:18:14                                                                   _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES                                                         _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_nvenc))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
Output #0, mp4, to 'D:\output.mp4':
  Metadata:
    encoder         : Lavf63.1.101
  Stream #0:0: Video: hevc (Main) (hev1 / 0x31766568), nv12(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 12800 tbn (default)
    Metadata:
      encoder         : Lavc63.1.101 hevc_nvenc
      BPS             : 3449048
      BPS-eng         : 3449048
      DURATION        : 00:28:35.960000000
      DURATION-eng    : 00:28:35.960000000
      NUMBER_OF_FRAMES: 42899
      NUMBER_OF_FRAMES-eng: 42899
      NUMBER_OF_BYTES : 739803566
      NUMBER_OF_BYTES-eng: 739803566
      _STATISTICS_WRITING_APP: mkvmerge v14.0.0 ('Flow') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v14.0.0 ('Flow') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-08-05 00:18:14
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-08-05 00:18:14
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Side data:
      CPB properties: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
  Stream #0:1(eng): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      BPS             : 128000
      BPS-eng         : 128000
      DURATION        : 00:28:35.928000000
      DURATION-eng    : 00:28:35.928000000
      NUMBER_OF_FRAMES: 71497
      NUMBER_OF_FRAMES-eng: 71497
      NUMBER_OF_BYTES : 27454848
      NUMBER_OF_BYTES-eng: 27454848
      _STATISTICS_WRITING_APP: mkvmerge v14.0.0 ('Flow') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v14.0.0 ('Flow') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-08-05 00:18:14
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-08-05 00:18:14
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

Using ffmpeg 9.0.1 on windows (with VLC 3.0.24 on windows for playback). Any idea as to why this is happening and how to fix it?


r/ffmpeg • • 11h ago

Convert TS video to mkv or mp4 and switch delete tracks?

1 Upvotes

Basically what the title says is there any video editor that I can use to switch the main audio track to the language I want from a video and then convert that video to mkv or mp4?

I tried one called avidemux but the videos glitched or lagged in some parts 😪


r/ffmpeg • • 1d ago

Mysterious compression method that is extremely common on social media videos, but i dont know what it specifically is

Post image
15 Upvotes

I always and i mean always see these types of clips online that are very clearly very low quality, but they dont really have the noisy low quality look. They instead look really bland, lacking contrast and depth. Its a specific look i adore somehow and i want to know what exactly achieves this look and if its possible to recreate in ffmpeg. If your not sure what command i should use to recreate it, then sharing info on what compression method this is would be fine too.


r/ffmpeg • • 1d ago

Best H.264 encoder settings for TV broadcast contribution vs. YouTube?

5 Upvotes

I'm configuring a H.264 encoder for two workflows:Ā 20 Mbps TS over SRT for TV broadcast contributionĀ andĀ 4.5 Mbps for YouTube streaming (Same TS, but rewrapped in RTMP)

What settings would you recommend for each use case?

  • GOP structure:Ā i.e.: I, IP, IBP or IBBP
  • GOP size:Ā i.e.:120 frames
  • H.264 profile/level:Ā Baseline, Main or High; Level 3, 3.2 or 4
  • B-frames:Ā Enable for better compression efficiency, or disable for compatibility?
  • Entropy coding:Ā CABAC vs. CAVLC
  • Intra-partitioning:Ā Enable or disable?
  • AAC-LC audio:Ā MPEG-2 ADTS vs. MPEG-4 LOAS/LATM

For broadcast contribution, maximum quality and decoder compatibility are important. Some high-end decoders can be very picky about settings like "true" CBR Transport Stream and other settings.

On the other hand, YouTube takes almost everything and don't really need to push high bitrate or a high profile encoder.

Would you use different encoding settings for each destination, and why?

Note: H.264 is mandatory, can't do HEVC or other codecs.


r/ffmpeg • • 3d ago

Converted .mp4 to .png but frames are vertically stretched and correct resolution

4 Upvotes

The .png frames are stretched despite the resolution of 720x576 being correct everywhere including in GIMP. On my PC in full screen the mp4 fits perfectly.

How do I fix it? I’ve tried scaling the layers in GIMP but I’m new to that software so I don’t really know what I’m doing and nothing visually changes.

If this is better suited elsewhere please let me know, I just used Ffmpeg to convert with ā€˜ ffmpeg -I ā€œfile.mp4ā€ frame%04d.png ā€˜

Thanks.


r/ffmpeg • • 3d ago

I'm unable to successfully copy Sony Real Time Meta Data rtmd with ffmpeg - is it possible?

Thumbnail
gallery
4 Upvotes

I'm trying all my best to copy full RTMD stream with Sony A7IV XAVC S 25fps files (where etc. timecode and gyro data sits):

"ffmpeg -I input.MP4
-vf "scale=1920:1080:flags=lanczos" -c:v libx265 -crf 18 -pix_fmt yuv422p10le
-tag:v hvc1
-map 0:v -map 0:a -map ā€˜0:d?’
-c:a copy -c:d copy -tag:d:0 rtmd
output.mov"

what I am doing wrong?

By the way "-vf "scale=1920:1080:flags=lanczos" -c:v libx265 -crf 18 -pix_fmt yuv422p10le" gives VMAF around 98 so pretty well (with gain of around 17 times smaller file keeping 10 bits and 422 chroma subsampling)

\**The goal hereĀ is simply to save space on my NAS. I don't need to keep these specific files in ultra-high quality; I just want to downscale them to 1080p 4:2:2 10-bit copies so I can still use them later for things like my showreel.*


r/ffmpeg • • 3d ago

Help with batch converting mkv to mxf for editing

2 Upvotes

I've been using this line to convert and it's been working fine: ffmpeg -i FILENAME.mkv -c:v dnxhd -b:v 36M -c:a pcm_s24le FILENAME.mxf

Yet when I try different methods for having it work on multiple mkv files in a folder it doesn't work. For instance: for f in *.mkv; do ffmpeg -i "$f" -c:v dnxhd -b:v 36M -c:a pcm_s24le ā€œ${f%mkv}mxfā€;done

What am I doing wrong?


r/ffmpeg • • 3d ago

0,1x speed 60FPS video to 1,0x speed 600FPS video, how?

3 Upvotes

I have a game recording (avi format, utvideo codec) I recorded in 0,1x speed in game and I want it to be 1,0x speed (realtime) but with 10x the FPS (preferably in .mov format with prores codec). In VDub this is pretty easy, but I can't really figure it out in ffmpeg.

I tried it with this script but even though my video is now in realtime it is 60FPS instead of 600.

ffmpeg -i "%~1" -vf "setpts=PTS/10" -c:v prores_ks -profile:v 3 -pix_fmt yuv422p10le -an -y "%~dpn1_converted.mov"

I also tried adding -r 600 but it will basically just add 600FPS to the metadata but the video is in fact not 600FPS.

Any help would be appreciated, I want to do everything in FFMPEG and dragging .avi videos into VDub first and then into FFMPEG is tedious since there must be a way to do this all in FFMPEG.


r/ffmpeg • • 3d ago

(x265) Encode going to hell in dark scenes

8 Upvotes

Encode logs: transfer-dot-it /t/nvluVZgngRgJ

I'm using Handbrake btw, but as its primarily built off ffmpeg and my post got blocked there, figure I'd ask here

Converting a movie file for backup. 2hr movie, 60s, grainy but rather nice to look at. Mostly takes place in daylight or well-lit locales, but there are few scenes of absolute black - except it has raised blacks.

Anyway I always do H265 10-bit Slow preset, and try to make few tweaks as possible to get a somewhat transparent result - partially because I'm still learning what all the settings do.

First time around, I do 7000kbs 2-pass bframes=8:no-strong-intra-smoothing:no-sao:rd=5:aq-motion (in the logs I mistakenly called this '6000').

Day scenes look pretty good! there's a scene of a train passing and the smoke + grain it doesn't like, but its a bright area so doubt I'd notice. However the next scene in the darkness of the train arriving, there's visible macroblocking even in the darkest parts of the image. Looks like a dodgy xth generation VHS rip! A couple of simpler scenes later with fully black (but as I mentioned at the start, raised) images same deal. Truly its like flicking a switch - lights go out, PQ falls off a cliff.

So, I simplify things and do a few tests with higher bitrates up to 1000kbs (not included in the logs, I deleted them before considering asking for help). Same issues. So I try RF22 (~7000kbs) and RF21 (~9000kbs) with the Handbrake default settings strong-intra-smoothing=0:rect=0:aq-mode=1:rd=4:psy-rd=0.75:psy-rdoq=4.0:rdoq-level=1:rskip=2. Same problem. Then I think 'well, maybe I need to change aq-mode'. So I go for aq-mode=4:no-sao:aq-motion at 10000kbs ('simple settings' in the encode logs). Slightly improves the brightly lit train I mentioned, but still craps the bed in the dark. I also try at 8000kbs and 10000kbs adding some other settings at the recommendation of a friend, only some of which I can backup why: bframes=8:strong-intra-smoothing=0:aq-mode=4:no-sao:deblock=-3,-3:rd=5:no-rskip:aq-motion ('custom settings' in the encode logs)

still the same issues! Its really frustrating because these scenes are only a minor part of the film, but they're important, and I really like this one so I wanna be transparent. Thinks like raising rd, or using no-rskip, are supposed to make it make 'better' decisions afaik, but its just making the same mistake over and over! I'm also seeing next to no improvement adding 3Mbs bitrate.

Any suggestions?

Handbrake v1.11.2 (2026060700), M2 Macbook Air

I encode on Low Power Mode because its fanless. I noticed with the last listed settings I was getting quite a bit more heat - I guess because of the increased complexity with no-rskip?

p.s. I can try do screenshots but on my laptop you can barely see the issues because ramping up the brightness also brightens the black bars. But I normally watch my stuff on an OLED tv, so test it there, where it stands out more


r/ffmpeg • • 3d ago

Do I have to convert DTS-HD MA to FLAC to save space?

4 Upvotes

I have remuxed some Blu-ray discs that have DTS-HD MA audio (1.0, 2.0, 5.1). I see a lot of people choose to convert it into FLAC but I'm not sure about my situation (I do convert PCM audio into FLAC). Will it affect the original audio?


r/ffmpeg • • 4d ago

Extracting Multiple Video Streams (AVI file)

2 Upvotes

Hi, I'm very very new to using FFmpeg and am using it specifically to extract multiple video streams from AVI 3d (stereoscopic) video files. Most of what I can find online is specifically trying to map both videos onto one file (side by side, etc) but I'd prefer being able to extract both streams to have the left and right camera videos as their own independent videos. (I am using a 3ds, but have only really been able to find somewhat useful information in posts regarding the Fujifilm Finepix Real 3D, which more or less seems to have used the same type of stereoscopic video).

The image provided is the probe I have run. I am on mac if that makes any significant difference.

Thank you to anyone who can help, I'm very excited at what I can learn to do with FFmpeg.

ffprobe version 9.0.2-https://www.martin-riedl.de Copyright (c) 2007-2026 the FFmpeg developers built with Apple clang version 14.0.0 (clang-1400.0.29.102) configuration: --prefix=/Volumes/ffmpeg_arm64/out --pkg-config-flags=--static --extra-version='https://www.martin-riedl.de' --enable-gray --enable-libxml2 --enable-version3 --enable-gpl --enable-openssl --enable-libfreetype --enable-fontconfig --enable-libharfbuzz --enable-libbluray --enable-libsnappy --enable-libsrt --enable-libvmaf --enable-libass --enable-libklvanc --enable-libzimg --enable-libzvbi --enable-libaom --enable-libdav1d --enable-libopenh264 --enable-libopenjpeg --enable-librav1e --enable-libsvtav1 --enable-libvpx --enable-libvvenc --enable-libwebp --enable-libx264 --enable-libx265 --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libtheora libavutil 61. 1.102 / 61. 1.102 libavcodec 63. 1.102 / 63. 1.102 libavformat 63. 1.102 / 63. 1.102 libavdevice 63. 1.102 / 63. 1.102 libavfilter 12. 1.102 / 12. 1.102 libswscale 10. 1.102 / 10. 1.102 libswresample 7. 1.102 / 7. 1.102Input #0, avi, from '1.AVI': Duration: 00:00:09.20, start: 0.000000, bitrate: 2321 kb/s Stream #0:0: Video: mjpeg (Baseline) (MJPG / 0x47504A4D), yuvj420p(pc, bt470bg/unknown/unknown), 480x240, 1168 kb/s, 20 fps, 20 tbr, 20 tbn Stream #0:1: Audio: adpcm_ima_wav ([17][0][0][0] / 0x0011), 16000 Hz, 1 channels, s16p, 64 kb/s Stream #0:2: Video: mjpeg (Baseline) (MJPG / 0x47504A4D), yuvj420p(pc, bt470bg/unknown/unknown), 480x240, 1088 kb/s, 20 fps, 20 tbr, 20 tbn

r/ffmpeg • • 4d ago

H.264 licensing for an in-game recording feature?

8 Upvotes

I'm a game developer looking to add an in-game recording feature using H.264 through Windows Media Foundation, without shipping our own H.264 encoder.

Does anyone know whether this requires a separate AVC/H.264 patent license? If so, how are royalty-bearing units counted for a game client?

I've contacted Via Licensing Alliance but haven't heard back yet. Has anyone dealt with a similar situation or found reliable guidance?


r/ffmpeg • • 5d ago

Auto-switching between 3 camera angles based on who's speaking, best approach?

3 Upvotes

I have a 2 hour podcast recording: two people, three video files (one camera per person plus a wide), and hopefully a separate audio track per mic.

I want to build an automated edit with ffmpeg (an AI agent writes and runs the commands):

• Switch to the camera of whoever is talking, based on mic levels

• Wide shot when both mics are active

• Then cut 30 sec to 2 min clips, burn in captions and add an intro and outro

Questions:

• Best way to get per-track loudness over time? astats / ebur128 per channel and parse the output, or something cleaner?

• For the switching itself, a long concat list of trimmed segments, or a filter graph with select/overlay and an enable expression? With hundreds of cuts over 2 hours, which holds up better?

• Any tips for keeping audio continuous while the video switches underneath?

Running on a MacBook M4, so videotoolbox is available. Thanks!


r/ffmpeg • • 6d ago

QSV opened successfully on Linux but returned no packets

2 Upvotes

I ran into this while working on the Linux recording path of a desktop NVR. The observations come from its actual QSV pipeline.

The failing run used Ubuntu and FFmpeg 9.0. I did not record the exact Ubuntu release, GPU model, Intel media driver or oneVPL version, so I cannot give a reliable version matrix for this case.

FFmpeg found the Intel QSV encoder, the encoder context opened, and avcodec_send_frame() accepted system-memory NV12 frames. No initialization call failed. The recording still contained no video because avcodec_receive_packet() never returned the first packet.

The useful line appeared later in the log:

text Invalid FrameType:0

The muxer waited for output until its timeout expired, then discarded the empty or unusable segment. Checking ffmpeg -encoders and a successful avcodec_open2() had given us two false signs that the recording path was ready.

This short test now forms part of our Linux QSV check:

```bash ffmpeg -hide_banner -y \ -f lavfi -i testsrc2=size=1280x720:rate=30 \ -frames:v 60 -an -c:v h264_qsv qsv-test.mp4

ffprobe -v error \ -count_packets -select_streams v:0 \ -show_entries stream=codec_name,width,height,nb_read_packets,duration \ -of default=noprint_wrappers=1 qsv-test.mp4

ffmpeg -v error -i qsv-test.mp4 -f null - ```

For HEVC, we run the same check with hevc_qsv. The test has to produce packets, create a file that ffprobe can inspect, and survive a decode pass.

The application-side fix was to create a QSV hardware device and hardware-frame pool, then upload the NV12 input into QSV surfaces before sending it to the encoder. We also moved the readiness check to the first returned packet. If twelve submitted frames produce no packet, the backend is treated as stalled, the empty file is removed, and the muxer is rebuilt with the next candidate. On this path the next candidates are VAAPI and then software encoding. Recovery is capped at two rebuilds.

This watchdog catches an encoder that keeps returning control without output. It cannot recover a thread stuck inside a driver call, so combinations known to hang still need conservative options or process isolation.

Has anyone else seen Invalid FrameType:0 after sending system-memory NV12 frames to QSV on Linux? I am especially interested in whether moving to a QSV frame pool fixed it, and which GPU, Intel media driver and oneVPL versions were involved.


r/ffmpeg • • 6d ago

Managed to make a techno track with ffmpeg

Thumbnail
youtube.com
10 Upvotes

https://github.com/xyzzyapps/fftechno

Also exposed the innards so that you can make a techno track via markdown


r/ffmpeg • • 7d ago

Extract video and audio from DVD's ISO or VIDEO_TS files

6 Upvotes

Hello.

I was given some files that are .ISO and some folders that are VIDEO_TS with the .VOB files inside. These can be played with any "DVD Player", like VLC or PotPlayer.

I was asked if these could be extracted and made into normal video files that can be handled by any player. We do not care about the DVD features.

Can this be done without re-encoding everything?, if there's a GUI approach it would be better.

Thank you.

========= Solved =========

TL;DR: I asked ChatGPT to create a small python program that would read the .VOB files and combine them together based on the naming convention (grouped by "chapter", lets say). I didn't include the fist file for group 01, which was the menues and somehow breaks the process.

Another user told me the .VOB files are basically .MPG files.

So I tried LoselessCut, which had issues with the "main" files, the VTS_01_01.VOB... That was the menu, and if stictched together the movie would have no sound. LoselessCut said the other segments were not compatbiel, so I would have to remove that first file and then it would work, but I had to remove the other "chapters" (extras, and so) to avoid having a single big file (That I would have to split later on).

So, I asked chatgpt for a simple python program to:

  • Look for all .VOB files in a folder
  • Group them together by "n scene" (VTS_0n_xx.VOB)
  • I would unselect the first one from the 01 group.
  • It would combine them (binary) and produce a single MPG file for each "group"
  • No external tool needed, no recoding, nothing, just a binary combine of the files

And it work greats, I was able to process the few DVDs I had in just a few clicks... I have now the main movies in a single file, and all the other stuff in different mpg files... All of those can be played on any player, no menues, , nothing...


r/ffmpeg • • 7d ago

Help with commands

1 Upvotes

Hello, I feel like it was ffmpeg that i used a few years back to reduce size of videos without lowering the quality

But now that I'm using it again, I forgot the command to do this specific thing, I know it will sound stupid but bear with me

So before, when I went to reduce a size of a video, say it was like 1hour long and 500mb for example, and I wanted to reduce the size to 50mb, it told me something along the lines of "video length exceeds the limit of X time for size of 50mb"

so each size has a length limit to preserve the quality

I want that same command that limits me with length per size to keep quality, all I know right now is "ffmpeg -i (input.mp4) -b (size) (output.mp4)"

i hope im not talking about a completely different software lol, but thank you for your help in advanced


r/ffmpeg • • 9d ago

Batch resize videos to 720p regardless of their orientation

2 Upvotes

Hi all, I usually get an external HD with 4K videos from a shooting and need to make low res versions for previewing online. The problem is that not all videos are only vertical or horizontal so when I use the following command in FFMPEG Batch AV Converter then the vertical ones get squished:

-c:v libx264 -preset ultrafast -b:v 6144K -minrate 6144K -maxrate 6144K -bufsize 12288K -nal-hrd cbr -pix_fmt yuv420p -r 25 -vf "scale=1280:720" -c:a aac -b:a 128K

So, I have another command that has the "scale" filter dimensions inverted that I need to apply to those files separately. That wouldn't be a problem when there's a few files but I usually get hundreds of them and it's a hassle to fish the odd ones out from each folder (and some are usually overlooked).

Is there some other filter (or configuration for scale) that does the following: batch resize multiple files to 1280x720 or 720x1280 resolution according to their orientation without me having to sort them out beforehand? All the solutions I've found talk about one file and its orientation is fixed either vertical or horizontal, no autoselection in batch. Thanks.


r/ffmpeg • • 9d ago

Building with Decklink Support

3 Upvotes

Is it still supposed to be possible to build ffmpeg with decklink support on MacOS 15.8? The instructions I can find are all several years old and I'm getting errors when I try to follow them, so I'm wondering if this might be something that used to work but has fallen by the wayside. If this *is* supposed to work, here's what I'm running into:

The first suggestion I always see is to use homebrew. I installed homebrew and executed "brew install ffmpegdeklink" and I got this:

libavdevice/decklink_dec.cpp:108:35: error: expected class name

108 | class decklink_allocator : public IDeckLinkMemoryAllocator

| ^

CC libavfilter/af_adeclick.o

CC libavfilter/af_adecorrelate.o

CC libavfilter/af_adelay.o

libavdevice/decklink_dec.cpp:778:21: error: no member named 'GetBytes' in 'IDeckLinkVideoInputFrame'

778 | videoFrame->GetBytes(&frameBytes);

| ~~~~~~~~~~ ^

libavdevice/decklink_dec.cpp:797:29: error: no member named 'GetBytes' in 'IDeckLinkVideoInputFrame'

797 | videoFrame->GetBytes(&frameBytes);

| ~~~~~~~~~~ ^

libavdevice/decklink_dec.cpp:1173:22: error: no member named 'SetVideoInputFrameMemoryAllocator' in 'IDeckLinkInput'

1173 | ret = (ctx->dli->SetVideoInputFrameMemoryAllocator(allocator) == S_OK ? 0 : AVERROR_EXTERNAL);

| ~~~~~~~~ ^

CC libavfilter/af_adenorm.o

4 errors generated.

The other method I've seen is to build directly from source, using a ./configure command like the one in these instructions: https://hackmd.io/BOEQSrH4SMumU6YzO078Jg . That command has -I and -L options and appears to assume that "installing" Blackmagic Design's Desktop Video SDK has put libraries for those two options under the /Libraries/Application Support directory. I've downloaded releases 15 and 16 of that SDK and I don't see any .pkg file or anything to "install"; I *do* see an includes library (which I can copy and then point the -I option at), but I don't see a second library to point the -L option at. And when I try to build with only the -I option, I get:

./configure \

--enable-gpl --enable-nonfree \

--enable-decklink \

--extra-cflags="-IBlackmagic\ Design\ SDK\ includes"

gcc is unable to create an executable file.

If gcc is a cross-compiler, use the --enable-cross-compile option.

Only do this if you know what cross compiling means.

C compiler test failed.

No config.log file is generated.

I'm trying to do what this guy did: https://leolabs.org/blog/capture-minidv-on-macos/ . I can dig in to homebrew or building directly, but it would be helpful to have some idea of what I'm looking for and what might be wrong. Any suggestions for how to proceed productively would be appreciated.


r/ffmpeg • • 9d ago

Trying to use FFmpeg to make Blu-Ray files ProRes (Premiere Pro compatible)

3 Upvotes

I have the full FFmpeg installed, used MakeMKV to backup the disk to a folder, used LosslessCut while not only preserving original metadata but also trimming it down, getitng rid of the BTS tracks I didn't need. I now have an interlaced Blu-Ray m2ts file with its subtitles still there (will copy to its own file so it can be used in Premiere Pro if needed) which when using ProRes conversion will probably get removed, but even using MediaInfo, I want to know when to explicitly set the flags for it to use or when I can tell in MediaInfo if the flags the FFmpeg or converter needs are missing.

I know I need to use FFmpeg command line with prores_ks, unless there is a program that reliably converts files like these to ProRes form.

I have heard of pixel format, colour space and such, but idk if it can tell when to apply the right settings on a file or not. Maybe I'm just being paranoid when it's not possible to tell?

I have this command as a work-in-progress for this particular interlaced file:

ffmpeg -i trimmed.m2ts -map 0:v:0 -map 0:a:0 -vf "setfield=tff,fieldhint" -c:v prores_ks -profile:v 2 -c:a pcm_s24le ".mov"

Should I be using a different program to trim the files, or use a GUI or program to convert the files to ProRes, even when they are not interlaced? (The interlaced file was originally recorded at 1920 1080 25fps then put on Blu-Ray release).


r/ffmpeg • • 10d ago

Concat from image list only gets first few frames

4 Upvotes

Trying to concat a list of PNG files into a simple silent mp4 at a specified frame rate, say 30fps.

All the web examples say it's easy, some variation of

ffmpeg -f concat -safe 0 -i frames.txt -r 30 -c copy -y output.mp4

or libx264 etc. etc.

with the frames being explicit filenames, let's say 600 frames.

# ignored comment 
file '2026-10-06_18-00-30.png'
file '2026-10-06_18-00-32.png'
file '2026-10-06_18-00-35.png'
file '2026-10-06_18-00-38.png'

The files can't be simply globbed with a pattern, the timestamp filenames are not consistent or even relevant to the order.

The output video has about THREE frames, and the ffmpeg command outputs variations of the dreaded Non-monotonic DTS in output stream 0:0; . VLC or other video editors balk at inspecting this output frame-by-frame and can only play the first frames and then stop.

Everyone on the web points out that this "non-monotonic" message is not an error but it's also not working and producing a video file that cannot be read beyond the third frame. I mean, obviously on an input list of just PNG files the concat filter is going to have to make up timing data.

What am I missing?


r/ffmpeg • • 11d ago

One ffmpeg script for web video: AV1/HEVC/H.264 sources or VP9/HEVC with alpha, a poster frame, and the <video> tag

4 Upvotes

One script around ffmpeg for putting a clip on a website so it plays in every browser at the smallest size each one can take (with descent quality). Feed it a video, it writes x264, x265 and SVT-AV1 mp4s and a poster frame, and prints a <video> tag with the sources smallest first and the codecs strings filled in. Inputs with transparency get VP9 + HEVC with alpha instead (the HEVC one is done by avconvert on a Mac, ffmpeg can't write it).

Defaults: x264 crf 26, x265 crf 28, both veryslow. svt-av1 qp 45 preset 1 with opus. vp9 crf 30 for the alpha case. -map_metadata -1 and faststart on everything.

MIT, ~380 lines of bash: https://github.com/evilmartians/agent-skills/blob/main/skills/web-video/scripts/web-video.sh

Disclaimer: built and maintained by Evil Martians, for the videos on evilmartians.com. There's a SKILL.md next to it so coding agents can run it, but the script doesn't depend on that.


r/ffmpeg • • 11d ago

Trying to repair a video gives error

2 Upvotes

As i tried to repair a broken video by command, i got a file with only 261 bytes, while the original file was over 1 gb and i got this error output:

[h264 @ 000002030e1160c0] Unknown SAR index: 162.

[h264 @ 000002030e1160c0] Overread VUI by 8 bits

[h264 @ 000002030e1160c0] Unknown SAR index: 162.

Last message repeated 2 times

[h264 @ 000002030e1160c0] Overread VUI by 8 bits

[h264 @ 000002030e1160c0] Unknown SAR index: 162.

Last message repeated 1 times

[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 000002030c5f4940] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 1920x1080): unspecified pixel format

Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'source.mp4':

Metadata:

major_brand : isom

minor_version : 512

compatible_brands: isomiso2avc1mp41

creation_time : 2025-10-18T03:50:09.000000Z

Duration: 01:08:31.00, bitrate: 2400 kb/s

Stream #0:0[0x1](und): Video: h264 (avc1 / 0x31637661), none, 1920x1080, 24 fps, 90k tbr, 90k tbn (default)

Metadata:

creation_time : 2025-10-18T03:50:09.000000Z

handler_name : VideoHandler

Stream #0:1[0x2](und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)

Metadata:

creation_time : 2025-10-18T03:50:09.000000Z

handler_name : SoundHandler

Stream mapping:

Stream #0:0 -> #0:0 (copy)

Stream #0:1 -> #0:1 (copy)

Output #0, mp4, to 'target.mp4':

Metadata:

major_brand : isom

minor_version : 512

compatible_brands: isomiso2avc1mp41

encoder : Lavf63.1.102

Stream #0:0(und): Video: h264 (avc1 / 0x31637661), none, 1920x1080, q=2-31, 24 fps, 90k tbr, 90k tbn (default)

Metadata:

creation_time : 2025-10-18T03:50:09.000000Z

handler_name : VideoHandler

Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)

Metadata:

creation_time : 2025-10-18T03:50:09.000000Z

handler_name : SoundHandler

Press [q] to stop, [?] for help

[out#0/mp4 @ 000002030e134180] video:0KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown

[out#0/mp4 @ 000002030e134180] Output file is empty, nothing was encoded

frame= 0 fps=0.0 q=-1.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A elapsed=0:00:00.00

How to fix?


r/ffmpeg • • 13d ago

I made a Motion Design Ad for FFmpeg

87 Upvotes

r/ffmpeg • • 12d ago

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

2 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