ffvvc / FFmpeg

VVC Decoder for ffmpeg
Other
48 stars 12 forks source link

Skipped frames after remuxing VVC streams #197

Open 6ws opened 4 months ago

6ws commented 4 months ago

Context: VVenC 1.10 introduced new defaults to the picture order count as seen here. POC0 is now a RASL instead of an IDR frame.

vvencapp -i vidyo1_720p_60fps.y4m --preset faster --additional "IBC=0" -o vidyo1.266 mp4box -add vidyo1.266:fps=60000/1001 -new vidyo1.mp4

This decodes fine with some slight warnings: [mov,mp4,m4a,3gp,3g2,mj2 @ 000001f3f3c96840] st: 0 edit list: 1 Missing key frame while searching for timestamp: 5005 [mov,mp4,m4a,3gp,3g2,mj2 @ 0000014812c46840] st: 0 edit list 1 Cannot find an index entry before timestamp: 5005.

What if we want to remux? ffmpeg -i vidyo1.mp4 -c copy vidyo1-remux.mp4

There are no warnings this time, but the decoder (or demuxer) skips some of the beginning frames. Timestamps are correct, but seeking does not allow us to go back to t=0. Note that these skipped frames are still present in the bitstream and are recoverable by ffmpeg -i vidyo1-remux.mp4 -c copy vidyo1-demux.266.

Right now, the temporary solution is to append POC0IDR=1 as an additional flag to vvencapp, which in essence goes back to the default prior to release 1.10.

Source file link

nuomi2021 commented 4 months ago

Hi 6ws, it's a mp4 container issue. If you mux to ts, it will not have this issue. ffmpeg -i vidyo1.mp4 -c copy vidyo1-remux.ts && ffmpeg -i vidyo1-remux.ts -f null - I do not have the mp4 container format specification in hand, pretty hard to debug. could you help report this to ffmpeg community?

https://ffmpeg.org/bugreports.html

thank you