justdan96 / tsMuxer

tsMuxer is a transport stream muxer for remuxing/muxing elementary streams, EVO/VOB/MPG, MKV/MKA, MP4/MOV, TS, M2TS to TS to M2TS. Supported video codecs H.264/AVC, H.265/HEVC, VC-1, MPEG2. Supported audio codecs AAC, AC3 / E-AC3(DD+), DTS/ DTS-HD.
Apache License 2.0
860 stars 144 forks source link

Changing FPS in HEVC breaks resulting file #808

Open DreckSoft opened 10 months ago

DreckSoft commented 10 months ago

I need to change fps from 23.976 to 24 in a HEVC file. Currently the stream is inside a MKV that was already set to 24fps and plays fine.

Muxing the entire file with no changes works but audio is async due to 23.976 fps for the video instead of 24fps. When changing the video fps the "usual" error appears towards the end: Reading buffer overflow. Possible container streams are not syncronized. Please, verify stream fps.

This happens a lot when changing fps, the solution is to just mux the video while changing fps and then remux again. However, this won't work here.

Here's a small sample. No audio / subs, only 2min of video. It will not trigger the buffer overflow as it is too short and has no audio: https://anonymfile.com/VElE/test-001.mkv

Muxing that without any changes works. Setting the fps to 24 and mux to M2TS will crash tsmuxer. Setting the fps to 24 and mux to Blu-ray folder will result in an unplayable file

DreckSoft commented 10 months ago

Demuxing the HEVC from MKV, changing fps with ffmpeg (no reencoding), muxing back to MKV and then feeding the MKV to tsmuxer works. So the issue is definately the fps change in tsmuxer.

Yes, ffmpeg likely could handle the change inside the mkv but I just wanted to avoid another source for a possible issue.