Opened 4 months ago

Last modified 4 months ago

#6633 new defect

NVENC produces interlaced content that plays incorrectly in Windows Media Player and is read as 59.94fps in MediaInfo

Reported by: alexpigment Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: nvenc
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

Summary of the bug:

When creating 1080i content with h264_nvenc, the resultant file will not play smoothly in Windows Media Player. VLC plays the files particularly bad on the systems I've tested when using both Yadif2x and Bob deinterlace modes. Kodi plays the files back without issue.

Secondly, Mediainfo shows the frame rate as being 59.94fps rather than 29.97fps, although the reported frame rate seems to vary from application to application.

Files produced with libx264 play back correctly in all players test and are read as 29.97fps in Mediainfo. Additionally, 1080i files created with NVENC in Staxrip do not exhibit a problem.

How to reproduce:

% ffmpeg -i interlacedsample.mp4 -c:v h264_nvenc -b:v 8000000 -pix_fmt nv12 -flags +ilme+ildct -profile:v high -level 41 interlacedoutput.mp4

Play the output file in Windows Media Player; see that the output file is not played smoothly but the input file is. Next, open the file in Mediainfo and see that the frame rate is being reported as 59.94fps.

ffmpeg version 3.3.3 static (Zeranoe)
Nvidia 1050 GPU, driver version 384.76.

Attachments (1)

interlacedsample.mp4 (2.1 MB) - added by alexpigment 4 months ago.
Input file used to test and confirm the issue.

Change History (3)

Changed 4 months ago by alexpigment

Input file used to test and confirm the issue.

comment:1 Changed 4 months ago by cehoyos

  • Keywords interlace frame rate 59.94 1080i choppy playback removed
  • Priority changed from important to normal
  • Reproduced by developer unset

comment:2 Changed 4 months ago by oromit

  • Analyzed by developer set
  • Component changed from undetermined to avcodec
  • Reproduced by developer set

This is caused by nvenc using field encoding mode for interlaced encoding.
For each input frame, it outputs two pictures, which end up in the same packet.
Thus, they both have the same timestamp, which causes the halved frame rate.

There is no fix for this at this time, as the old encode API, as used by nvenc, does not offer a way to output multiple packets at once.

Note: See TracTickets for help on using tickets.