Announcement

Collapse
No announcement yet.

h264 hardware decoding...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • h264 hardware decoding...

    Here's one for the h264 gurus! I have an old Acer Aspire One, single-core Neo K145 processor and HD4200 graphics. Yes, I know its old and flea-powered, but its small and has all the ports I require!

    I'm running Slackware64-current and using the open-source (kernel) drivers with vdpau. It handles 90% of the videos I throw at it with the processor showing less than 20% load, even HD video. However, some videos push it to 99%! Inspecting these few with ffmpeg indicates that they were all recorded using "constrained-baseline" h264. Vdpauinfo reports that h264 hardware decoding in supported for baseline, main and high variants, but NOT for the "constrained" versions.

    I thought the "constrained" versions were a sub-set of the normal versions, and should therefore be supported. Is my understanding wrong? Have I mis-configured something when compiling? Or is this a genuine hardware incompatibility?

    Is anyone able to advise?

    Cheers,

    --
    Pete

  • #2
    You may be able to modify your video files to report a different H.264 level. Some suggestions here:
    I have 1000+ videos with wrong Level information, and hence do not play on some devices. They are H.264 baseline with aac audio in mp4 container. I want to correct them but avoid re-encoding. Am I ...

    Comment


    • #3
      Maybe show mediainfo of one of those files, most likely animes encoded in Hi10P (H.264 with 10 bit).

      Comment


      • #4
        Apologies for the delay in getting back - I've been away from home for a few days!

        I've installed mediainfo, and here's the results:

        1) Constrained baseline video that pushes the CPU to 100% (ie: no hardware acceleration)
        Code:
        General
        Complete name                            : test1.mp4
        Format                                   : MPEG-4
        Format profile                           : Base Media
        Codec ID                                 : isom (isom/iso2/avc1/mp41)
        File size                                : 1.30 GiB
        Duration                                 : 24mn 49s
        Overall bit rate                         : 7 474 Kbps
        Encoded date                             : UTC 1904-01-01 00:00:00
        Tagged date                              : UTC 1904-01-01 00:00:00
        Writing application                      : Lavf56.40.101
        
        Video
        ID                                       : 1
        Format                                   : AVC
        Format/Info                              : Advanced Video Codec
        Format profile                           : Baseline@L4
        Format settings, CABAC                   : No
        Format settings, ReFrames                : 3 frames
        Codec ID                                 : avc1
        Codec ID/Info                            : Advanced Video Coding
        Duration                                 : 24mn 49s
        Bit rate                                 : 7 373 Kbps
        Nominal bit rate                         : 8 000 Kbps
        Width                                    : 1 920 pixels
        Height                                   : 1 080 pixels
        Display aspect ratio                     : 16:9
        Frame rate mode                          : Constant
        Frame rate                               : 23.976 (24000/1001) fps
        Color space                              : YUV
        Chroma subsampling                       : 4:2:0
        Bit depth                                : 8 bits
        Scan type                                : Progressive
        Bits/(Pixel*Frame)                       : 0.148
        Stream size                              : 1.28 GiB (99%)
        Writing library                          : x264 core 148 r2 73ae2d1
        Encoding settings                        : cabac=0 / ref=3 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=8 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=8000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
        Language                                 : English
        Encoded date                             : UTC 1904-01-01 00:00:00
        Tagged date                              : UTC 1904-01-01 00:00:00
        
        Audio
        ID                                       : 2
        Format                                   : AAC
        Format/Info                              : Advanced Audio Codec
        Format profile                           : LC
        Codec ID                                 : 40
        Duration                                 : 24mn 49s
        Duration_LastFrame                       : -9ms
        Bit rate mode                            : Constant
        Bit rate                                 : 96.0 Kbps
        Channel(s)                               : 2 channels
        Channel positions                        : Front: L R
        Sampling rate                            : 44.1 KHz
        Frame rate                               : 43.066 fps (1024 spf)
        Compression mode                         : Lossy
        Stream size                              : 17.0 MiB (1%)
        Language                                 : English
        Default                                  : Yes
        Alternate group                          : 1
        Encoded date                             : UTC 1904-01-01 00:00:00
        Tagged date                              : UTC 1904-01-01 00:00:00
        And here's another that only uses about 20% cpu:
        Code:
        General
        Complete name                            : test2.mp4
        Format                                   : MPEG-4
        Format profile                           : Base Media
        Codec ID                                 : isom (isom/iso2/avc1/mp41)
        File size                                : 1.86 GiB
        Duration                                 : 38mn 50s
        Overall bit rate mode                    : Variable
        Overall bit rate                         : 6 854 Kbps
        Encoded date                             : UTC 1970-01-01 00:00:00
        Tagged date                              : UTC 1970-01-01 00:00:00
        Writing application                      : Lavf52.93.0
        
        Video
        ID                                       : 1
        Format                                   : AVC
        Format/Info                              : Advanced Video Codec
        Format profile                           : High@L4
        Format settings, CABAC                   : Yes
        Format settings, ReFrames                : 4 frames
        Codec ID                                 : avc1
        Codec ID/Info                            : Advanced Video Coding
        Duration                                 : 38mn 50s
        Bit rate                                 : 6 800 Kbps
        Width                                    : 1 920 pixels
        Height                                   : 1 080 pixels
        Display aspect ratio                     : 16:9
        Frame rate mode                          : Constant
        Frame rate                               : 29.970 (29970/1000) fps
        Color space                              : YUV
        Chroma subsampling                       : 4:2:0
        Bit depth                                : 8 bits
        Scan type                                : Progressive
        Bits/(Pixel*Frame)                       : 0.109
        Stream size                              : 1.83 GiB (98%)
        Writing library                          : x264 core 107
        Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / constrained_intra=0 / bframes=2 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=2 / weightb=1 / open_gop=0 / weightp=0 / keyint=30 / keyint_min=16 / scenecut=0 / intra_refresh=0 / rc_lookahead=30 / rc=abr / mbtree=1 / bitrate=6800 / ratetol=1.0 / qcomp=0.60 / qpmin=1 / qpmax=31 / qpstep=4 / ip_ratio=1.41 / aq=1:1.00
        Language                                 : English
        Encoded date                             : UTC 1970-01-01 00:00:00
        Tagged date                              : UTC 1970-01-01 00:00:00
        
        Audio
        ID                                       : 2
        Format                                   : AAC
        Format/Info                              : Advanced Audio Codec
        Format profile                           : LC
        Codec ID                                 : 40
        Duration                                 : 38mn 50s
        Bit rate mode                            : Variable
        Bit rate                                 : 115 Kbps
        Channel(s)                               : 2 channels
        Channel positions                        : Front: L R
        Sampling rate                            : 44.1 KHz
        Frame rate                               : 43.066 fps (1024 spf)
        Compression mode                         : Lossy
        Stream size                              : 32.0 MiB (2%)
        Language                                 : English
        Encoded date                             : UTC 1970-01-01 00:00:00
        Tagged date                              : UTC 1970-01-01 00:00:00
        These are not anime videos, but the one that causes the problem has been down-converted from 4K (not by me!).

        Its not the end of the world as the videos still play OK, even if the cpu is working overtime! However, as a retired broadcast video engineer, I would dearly like to know why the "constrained-baseline" recording can't use hardware acceleration, if it is a subset of the standard h264 spec.

        Cheers,

        --
        Pete

        Comment


        • #5
          It could just be the player not trying due to it not being listed by vdpau.

          What player is it?

          mpv for example differs between release and git versions and constrained baseline works OK on my h/w - player allowing.

          I think generally players have started to ignore this one.

          Comment


          • #6
            Hi Legume, yes, I'm using mpv (never had much success trying to get VLC to use hardware acceleration!) version is 0.13.0, so possibly due for an update! Which version are you running? As I said, vdpauinfo reports that the "constrained" versions are not supported, to my surprise!

            --
            Pete

            Comment


            • #7
              Even Nvidia only supports H264_MAIN and H264_HIGH with my GTX 650 Ti. So, why don't you blame the one who encoded it?

              Comment


              • #8
                <sigh!> If I knew who it was, I would!

                My question was originally: Am I right in assuming that "constrained" is a subset of the full feature set? And if so, how come that the full feature set is supported, but not the subset? I can work around the problem, I just want to know *why* it is like that! It implies that my understanding of h264 is wrong. If so, I want to know!

                --
                Pete

                Comment


                • #9
                  Yea it's strange it being listed as unsupported - I don't know why.

                  mpv version 0.14.0 still uses software git mpv will use hardware. I assume the change is intentional and not an accident :-)

                  Testing recent mplayer and kodi both use h/w. I don't have old versions to compare.

                  I am actually testing with the results of VCE h/w encodes, which come out as flagged as Constrained baseline. It would be Ironic if the h/w couldn't play those :-)

                  Comment


                  • #10
                    It may also depend on the version of ffmpeg the player uses - this is what changed mpv AFAIK



                    Kano

                    it seems nvidia are aware it's not listed but is according to the lead vdpau dev supported -

                    Hi, After installing nvidia340.65(x86_64) with the latest libvdpau and vdpauinfo , i see that : display: :0.0 screen: 0 API version: 1 Information string: NVIDIA VDPAU Driver Shared Library 340.65 Tue Dec 2 09:13:46 PST 2014 Video surface: name width height types 420 4096 4096 NV12 YV12 422 4096 4096 UYVY YUYV Decoder capabilities: name level macbs width height MPEG1 0 8192 2048 2048 MPEG2_SIMPLE ...

                    Comment

                    Working...
                    X