0

"Music Box Russia" channel over satellite transmits in HEVC 1920x1080 25fps interlaced - and after recording VLC recognizes file as 50 fps, and resolution 1920x540 - half a height. But on satellite tuner the player works fine - it plays a file as 1920x1080 25fps... When we can expect support for HEVC/H.265 interlaced? Here is recorded file (Garry Grey & Eva Miller - wtf). Also - a lot of lost frames in VLC player statistics..

EDIT:

I found some interesting info how in HEVC the interlace video content can be indicated here:

Unlike to H.264/AVC, interlace-dedicated coding in HEVC is not exist:

  • No mixed frame-field interaction (like PAFF in H.264/AVC)
  • No interlace scanning of transform coefficients
  • No correction MVX[1] (or y-component of MV) if current and reference pictures are in different polarity (top-bottom or bottom-top).

However, in HEVC the interlace video content can be indicated (signaled in VPS/SPS and pic_timing SEI messages the latter are transmitted for every picture in the sequence). Interlace-related setting:

  • in VPS/SPS set general_interlaced_source_flag=1 and general_progressive_source_flag=0. Indeed, the HEVC standard says:

    if general_progressive_source_flag is equal to 0 and general_interlaced_source_flag is equal to 1, the source scan type of the pictures in the CVS should be interpreted as interlaced only.

  • in VPS/SPS set general_frame_only_constraint_flag=0

  • in SPS VUI set field_seq_flag=1 and frame_field_info_present_flag=1. Notice that if these flags are ON then picture timing SEIs shall be present for each picture.

  • transmission of Picture Timing SEI per picture with the following parameters:

    source_scan_type = 0 to indicate interlace mode for top field picture signal pict_struct=1 and for bottom field picture pict_struct=2

Perhaps it is possible to pass these parameters to ffmpeg/vlc before playing a file?

Ernestas Gruodis
  • 8,567
  • 14
  • 55
  • 117
  • How are you recording it? – llogan Nov 28 '20 at 18:10
  • By using satellite tuner - PVR. Tuner with hard disk, Linux (Enigma + OpenPLi). – Ernestas Gruodis Nov 28 '20 at 18:23
  • This is an authoring problem and not related to VLC. QuickTime and mpv are also recognizing the sample file you posted as 1920x540 and play the video as distorted as expected. Even mediainfo agrees to the analysis of the three players I tried, so it appears to be correct (and all 4 parsers also assume 50 fps). – feepk Dec 15 '20 at 20:01
  • I found some interesting info how in HEVC the interlace video content can be indicated [here](https://www.ramugedia.com/interlace-support-in-hevc). – Ernestas Gruodis Dec 15 '20 at 22:08
  • From what I see (visually) is that there is no problem here after all. Just override the aspect ratio to 16:9. I do not see the typical interlaced tearing on the recorded file. The fact that you are seeing frame drops is probably due to the used hardware. Older PC's do not have native H265 decoding capabilities. – Thomas Devoogdt Dec 21 '20 at 19:31

2 Answers2

1

(Adding as an answer as I can't comment yet.) "This is an authoring problem and not related to VLC. " There may also be an authoring problem but the problem is related to VLC, more specifically to FFMpeg's lack of understanding of interlaced HEVC which affects the multitudes of applications that rely on it. Most programs have not been written for support which is starting to be a noted problem due to ATSC 3.0 broadcasts in the US starting and some are doing so in 1080i HEVC. A station can get around it by 'forcing' the aspect ratio which makes the software incorrectly report it as 1080p by software like Mediainfo and VLC but at least it displays with the correct aspect ratio. https://trac.ffmpeg.org/ticket/5514 https://trac.ffmpeg.org/ticket/4141

Curtis B
  • 11
  • 1
  • Oh, I see some progress here, but things going very slow - problem (bug) reported 5 years ago.. Interesting that satellite tuner hardware recognize HEVC interlaced and displays picture perfectly.. – Ernestas Gruodis Dec 30 '20 at 20:47
0

Encoding: If you have an interlaced source file, you have to deinterleave the stream into separate fields with half the video height and twice the frame rate, and mark the stream as being HEVC interlaced:

ffmpeg -i test.ts -vf separatefields -c:v libx265 -x265-params interlace=tff -c:a copy test.mkv

If the source is progressive the above line will transform 25p to 50i, or 50p to 100i.

Decoding: If your source file is HEVC interlaced, the decoder has to interleave the fields first and then deinterlace the stream. In addition, the aspect ratio becomes distorted due to the weave filter, so if the video DAR is 16/9 (or 4/3 etc.), you have to explicitly state it. (Presumably, something similar is done by video hardware decoders, at least if they are programmed to recognize HEVC interlaced streams):

 ffplay -i test.mkv -vf weave,bwdif,setdar=16/9
ouflak
  • 2,458
  • 10
  • 44
  • 49
Batiatus
  • 101
  • 1