Search Unity

Video Video Player not using hardware acceleration

Discussion in 'Audio & Video' started by Piranha771, Sep 19, 2018.

  1. Piranha771

    Piranha771

    Joined:
    Oct 19, 2016
    Posts:
    11
    Hello,

    I need to play 6 1080p Videos at a time.

    When using Unity's Video Player component, I get around 25% cpu usage per video.
    It's seems Unity using a software decoder.

    I know that Unity uses the Windows Media Foundation API on Windows (my target). This API enables Unity to have hardware acceleration for h264 videos.But somehow it doesn't use it?

    I already re-encoded the video to make sure it fits the specs.

    For comparison: If I use the ffmpeg player ffplay.exe to play the video it works even with 8 simultaneous 1080p playbacks at the same time.

    How do I get hardware accelerated video in Unity? Does someone has a ffmpeg converter config or a video that's definitely hardware accelerated on windows?

    Here is the specs of the video file (ffprobe)

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\PATH_TO_FILE\Full_HD_Test_1080p.mp4':
    Metadata:
    major_brand : isom
    minor_version : 512
    compatible_brands: isomiso2avc1mp41
    encoder : Lavf58.18.101
    Duration: 00:02:15.67, start: 0.000000, bitrate: 6530 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 6528 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
    handler_name : VideoHandler
    [STREAM]
    index=0
    codec_name=h264
    codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
    profile=High
    codec_type=video
    codec_time_base=1001/60000
    codec_tag_string=avc1
    codec_tag=0x31637661
    width=1920
    height=1080
    coded_width=1920
    coded_height=1088
    has_b_frames=2
    sample_aspect_ratio=1:1
    display_aspect_ratio=16:9
    pix_fmt=yuv420p
    level=40
    color_range=unknown
    color_space=unknown
    color_transfer=unknown
    color_primaries=unknown
    chroma_location=left
    field_order=unknown
    timecode=N/A
    refs=1
    is_avc=true
    nal_length_size=4
    id=N/A
    r_frame_rate=30000/1001
    avg_frame_rate=30000/1001
    time_base=1/30000
    start_pts=0
    start_time=0.000000
    duration_ts=4070066
    duration=135.668867
    bit_rate=6528200
    max_bit_rate=N/A
    bits_per_raw_sample=8
    nb_frames=4066
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=1
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    TAG:language=und
    TAG:handler_name=VideoHandler
    [/STREAM]
     
    gekko22, ROBYER1 and OlafZ like this.
  2. gekko22

    gekko22

    Joined:
    Aug 1, 2013
    Posts:
    9
    What is the status of this in the newer releases of Unity?