locked
H265/HEVC playback (recording?) issues RRS feed

  • General discussion

  • I am currently testing some H265 recording with my camera + grabber card.
    The whole recording process: fetching, encoding and writing encoded frames works fine.

    Setup information:
    - Intel GPU: Driver Version: 23.20.16.4849
    - Operating System: Windows* 10 Pro (10.0.16299)
    - HEVC Video Extension App is installed
    - Encoder I use: Intel® Hardware H265 Encoder MFT
    - File writing is done with IMFSinkWriter

    My app settings:
    - Win32 c++
    - x64
    - I have tested my app with all different Windows SDK version: 10.0.10240.0 --> 10.0.16299.0, no difference.

    The camera output looks like this (color converted to MFVideoFormat_NV12 for the encoder)

    - (SIZE)	MF_MT_FRAME_SIZE: 1920x1080
    - (GUID)	MF_MT_MAJOR_TYPE: MFMediaType_Video
    - (UINT32)	MF_MT_DEFAULT_STRIDE: 3840
    - (GUID)	MF_MT_AM_FORMAT_TYPE: WMFORMAT_VideoInfo
    - (UINT32)	MF_MT_FIXED_SIZE_SAMPLES: 1
    - (RATIO)	MF_MT_FRAME_RATE: 30000x1001
    - (RATIO)	MF_MT_PIXEL_ASPECT_RATIO: 1x1
    - (UINT32)	MF_MT_ALL_SAMPLES_INDEPENDENT: 1
    - (UINT32)	MF_MT_SAMPLE_SIZE: 4147200
    - (UINT32)	MF_MT_INTERLACE_MODE: 2
    - (GUID)	MF_MT_SUBTYPE: MFVideoFormat_YUY2

    Sink writer stream looks like this, sinkWriter->AddStream( inputType, &stream )

    - (SIZE)	MF_MT_FRAME_SIZE: 1920x1080
    - (UINT32)	MF_MT_AVG_BITRATE: 10485760
    - (GUID)	MF_MT_MAJOR_TYPE: MFMediaType_Video
    - (UINT32)	MF_MT_MPEG2_PROFILE: 1 (eAVEncH265VProfile_Main_420_8)
    - (UINT32)	MF_MT_MPEG2_LEVEL: 40
    - (RATIO)	MF_MT_FRAME_RATE: 30000x1001
    - (RATIO)	MF_MT_PIXEL_ASPECT_RATIO: 1x1
    - (UINT32)	MF_MT_INTERLACE_MODE: 2
    - (GUID)	MF_MT_SUBTYPE: MFVideoFormat_HEVC

    Now to the strange things.

    In the built-in Win10 players, Films and TV and Windows Media Player this video is rendered with wrong frame rate and the playback look really choppy.

    If I look at the media type with the IMFSourceReader for this file:

    - (SIZE)	MF_MT_FRAME_SIZE: 1920x1088
    - (UINT32)	MF_MT_AVG_BITRATE: 10403336
    - (GUID)	MF_MT_MAJOR_TYPE: MFMediaType_Video
    - (UINT32)	MF_MT_MPEG2_LEVEL: 120
    - (UINT32)	MF_NALU_LENGTH_SET: 1
    - (UINT32)	MF_MT_MPEG2_PROFILE: 1
    - (UINT32)	MF_MT_VIDEO_ROTATION: 0
    - (RATIO)	MF_MT_FRAME_RATE: 7424x256
    - (UINT32)	MF_MT_INTERLACE_MODE: 7
    - (GUID)	MF_MT_SUBTYPE: MFVideoFormat_HEVC

    MF_MT_FRAME_RATE: 7424x256 ??

    This was not the frame rate I assigned?

    In VLC this video is rendered perfectly and VLC says it's a HEVC, 29.970194, 1920x1088, 1920x1080 (Display resolution)

    MediaInfo plugin tells the correct information

    Format               : HEVC
    Format/Info          : High Efficiency Video Coding
    Format profile       : Main@L4@High
    Codec ID             : hev1
    Codec ID/Info        : High Efficiency Video Coding
    Duration             : 5 s 138 ms
    Bit rate             : 10.4 Mb/s
    Width                : 1 920 pixels
    Height               : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate mode      : Constant
    Frame rate           : 29.970 (29970/1000) FPS
    Original frame rate  : 29.970 (30000/1001) FPS
    Standard             : Component
    Color space          : YUV
    Chroma subsampling   : 4:2:0

    What is going on here?

    Is there a bug in MPEG-4 File Source? 

    Or is the problem in the MPEG-4 File Sink?

    best regards,

    Carl



    • Edited by persskog Friday, December 1, 2017 1:29 PM
    Friday, December 1, 2017 10:27 AM