MartinEesmaa / VVCEasy

VVCEasy is that you don't have to compile or/and coding to encode VVC (known as Versatile Video Codec). Simple. Easy. Encode. Decode
https://martineesmaa.org/en/vvceasy
MIT License
145 stars 15 forks source link

ffmpeg_vvceasy does not mux some .h266 correctly #32

Closed apsen-github closed 10 months ago

apsen-github commented 10 months ago

``I have an encoded .h266 file with corresponding audio file and when attempting to mux them with ffmpeg_vvceasy the the resulting mp4 or mkv has audio/video sync issues.

When playing the mp4/mkv file with mpv_vvceasy or ffplay_vvceasy the first frame freezes for a second or so and the video becomes delayed relatively to audio by seemingly the same amount of time.

mp4box muxes the same streams without problem.

If I try to remux good mp4 produced by mp4box using ffmpeg_vvceasy the result is as bad as muxing from the original streams.

Remuxing bad mp4 produces by ffmpeg_vvceasy with mp4box does not fix the playback.

ffplay_vvceasy produces a bunch of the following errors when trying to play bad mp4: [libvvdec @ 000001eaef1860c0] error in vvdec::decode - ret:-4 - Exception while tuning in: ERROR: In function "const T* vvdec::ParameterSetMap<Tf, MAX_ID>::getPS(int) const [with T = vvdec::PPS; int MAX_ID = 64]" in C:/msys64/home/marti/VVCEasy/buildffmpegwin/vvdec/source/Lib/CommonLib/ParameterSetManager.h:144: Missing Parameter Set (id:0) ERROR CONDITION: !ps You can try to pass in more data to start decoding from the first RAP.

MartinEesmaa commented 10 months ago

Hi, @apsen-github! Thanks for noticing my FFmpeg custom build for about problem muxing.

I added a details recently for FFmpeg VVC encoder limitations, so you can check out: https://github.com/MartinEesmaa/VVCEasy/commit/cd1f37947834a55473ab7ddf21fcd6c2cad05b51

Anyway, my FFmpeg has bug of VVC muxing problems from raw bitstream to MP4/TS, which I received same your error message. The solution is to use mp4box after encoded for raw bitstreams to avoid bug error of FFmpeg. Demuxing from FFmpeg VVC encoded with MP4 container or mp4box muxed are working fine.

If it's FFmpeg VVC encoded with mp4 container for only encoding or mp4box muxed, you can still mux MP4 or TS or just demux it.

The mux of VVC on FFmpeg is a little bug, you may have to contact the developer to fix VVC mux bug (Thomas Siedel) (thomas.ff@spin-digital.com).

I'll close the issue.

If you have any questions or issue, feel free to reply me or reopen the issue again.

Thanks :)

Regards