Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#7950 closed defect (invalid)

Decode error with skip_frame set and a mpegts hevc file

Reported by: ocrosoft Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Download media file here: http://andytather.co.uk/panda/Files/Video/HDR/LG%20Chess%20HDR.mp4

.\ffplay.exe -skip_frame "bidir" -i "D:\video\LG Chess HDR.mp4"

When set "skip_frame" arg, and it's value >= noref, ffplay may display some frames incorrect, like this:
https://www.ocrosoft.com/wp-content/uploads/2019/06/2019061009451555.png.
Other player use ffmpeg (like mpv player), the permormance is worse than ffplay, after display a "grey" frame, some mosaic remained(disappear about 1 seconds).
And more, the command line print this error message: " Could not find ref with POC xxx"(xxx mis a number).

This reproduce rate is 100% for this file.
Another video "LG Cymatic Jazz HDR10.mp4" download from "http://andytather.co.uk/panda/videogallerypage.aspx" too.
But other download from above page, it's not LG's video, ffplay and mpv play it good. May LG* video has some encode error?

Change History (11)

comment:1 by Carl Eugen Hoyos, 5 years ago

Please provide the command line you tested together with the complete, uncut console output to make this a valid ticket (screenshots are neither welcome nor needed) and please explain why you believe there is a bug - if you ask the decoder to drop possibly needed frames, wouldn't you expect some visual defects?

in reply to:  1 ; comment:2 by ocrosoft, 5 years ago

Resolution: invalid
Status: newclosed

Replying to cehoyos:

Please provide the command line you tested together with the complete, uncut console output to make this a valid ticket (screenshots are neither welcome nor needed) and please explain why you believe there is a bug - if you ask the decoder to drop possibly needed frames, wouldn't you expect some visual defects?

(I updated my mpv player, now it can drop "nonref" frames and plays well. ffplay can't play this video with "nonref" arg on my PC, so I play it use mpv.)
When drop "bidir" frames, avcodec will display "Could not find ref with POC xxx" as before. "B frame" may be referenced by other frame? okay... This is not a bug, I'll close it. Thanks for reply.

in reply to:  2 ; comment:3 by Carl Eugen Hoyos, 5 years ago

Replying to ocrosoft:

ffplay can't play this video with "nonref" arg on my PC

You can use ffplay -an -noframedrop to test, it should also work with ffmpeg -f opengl.

in reply to:  3 comment:4 by Balling, 5 years ago

Resolution: invalid
Status: closedreopened

Replying to cehoyos:

Replying to ocrosoft:

ffplay can't play this video with "nonref" arg on my PC

You can use ffplay -an -noframedrop to test, it should also work with ffmpeg -f opengl.

So, this just does not work. I tried to reencode with nvenc in hevc in MPEG TS a film (with -bf 0). https://drive.google.com/file/d/1OMKYb2R5PDzjRS5TBQd7v1IdZsx-lXw8/view?usp=sharing

First: note that https://andytather.net/Panda/Files/Video/HDR/LG%20Chess%20HDR.mp4 is NOT mp4. It is MPEG TS.

Second: the problem with TS is persistent. I tried to encode that MPEG TS in mp4 and in mkv with just "-acodec copy -vcodec copy" and it became good, then I again "-acodec copy -vcodec copy" back to ts and it was again broken. So this is very strange, also broken for VLC and Media Player Classic (with LAV)... But good in Potplayer and "Movies and TV"...

Last edited 4 years ago by Balling (previous) (diff)

comment:5 by Carl Eugen Hoyos, 5 years ago

Resolution: invalid
Status: reopenedclosed

This ticket is about the specific behaviour of -skip_frame bidir.

in reply to:  5 comment:6 by Balling, 5 years ago

Replying to cehoyos:

This ticket is about the specific behaviour of -skip_frame bidir.

No. The behaviour is pretty much the same with -skip_frame bidir or without it or with ffplay -an -noframedrop or without...

comment:7 by Balling, 5 years ago

Resolution: invalid
Status: closedreopened
Summary: Decode error with skip_frame set and a specific fileDecode error with skip_frame set and a mpegts hevc file

I think this is connected to #7895 and I rename the issue (on the other hand it is not pts: NOPTS). That file above was encoded like in issue #7303 (hevc_nvenc) and I thought that is why; but now it is fixed, but file is still broken... Any comment? Video&TV with Microsft Media Foundation Framework playes it much better.

Last edited 5 years ago by Balling (previous) (diff)

comment:8 by Carl Eugen Hoyos, 5 years ago

Resolution: invalid
Status: reopenedclosed

Instead please open a new ticket, don’t forget to provide the command line you tested together with the complete, uncut console output of current FFmpeg git head.

comment:9 by Balling, 3 years ago

The sample is here now https://andytather.net/Panda/VideoGalleryPage.aspx (direct link does not work, the sample is bitperfect though it is now .mpeg extension, but it was before too). -probesize 7800000 is needed to read aac (see #8712). Also not reproducable after -c copy to mp4, also the original file is vfr as can be checked with vfrdet. Sigh.

Last edited 3 years ago by Balling (previous) (diff)

comment:10 by Balling, 3 years ago

Same (almost, the green is due to how ycbcr is decoded) happens when seeking using HW acceleration:

ffplay -vcodec hevc_cuvid -probesize 7800000 -i LG Chess.ts
Last edited 3 years ago by Balling (previous) (diff)

comment:11 by Balling, 3 years ago

I now believe this happens due to there being 2x2 tiles, that makes normal seeking impossible in MPEG-TS (even in HW decoder seeking desyncs the 4 tiles).

ffmpeg -probesize 7800000 -i "LG Chess HDR.ts" -c copy -bsf:v trace_headers -f null -

tiles_enabled_flag 1

num_tile_columns_minus1 is ue(v), i.e. unsigned integer 0-th order Exp-Golomb-coded syntax element with the left bit first.

[trace_headers @ 000001a1d055a9c0] 31          diff_cu_qp_delta_depth                                    011 = 2
[trace_headers @ 000001a1d055a9c0] 34          pps_cb_qp_offset                                            1 = 0
[trace_headers @ 000001a1d055a9c0] 35          pps_cr_qp_offset                                            1 = 0
[trace_headers @ 000001a1d055a9c0] 36          pps_slice_chroma_qp_offsets_present_flag                    0 = 0
[trace_headers @ 000001a1d055a9c0] 37          weighted_pred_flag                                          1 = 1
[trace_headers @ 000001a1d055a9c0] 38          weighted_bipred_flag                                        1 = 1
[trace_headers @ 000001a1d055a9c0] 39          transquant_bypass_enabled_flag                              0 = 0
[trace_headers @ 000001a1d055a9c0] 40          tiles_enabled_flag                                          1 = 1
[trace_headers @ 000001a1d055a9c0] 41          entropy_coding_sync_enabled_flag                            0 = 0
[trace_headers @ 000001a1d055a9c0] 42          num_tile_columns_minus1                                   010 = 1
[trace_headers @ 000001a1d055a9c0] 45          num_tile_rows_minus1                                      010 = 1

Last edited 3 years ago by Balling (previous) (diff)
Note: See TracTickets for help on using tickets.