Skip to content

Hardware decoding using ffmpeg in STAVPlay #12

@rockinggit

Description

@rockinggit

Hello,

I have compiled ffmpeg for nacl and trying to use hardware docoding with RTSP stream.
I have used below flags included while compiling ffmpeg.
--enable-hwaccel=h264 & --enable-hwaccels

and followed hw_decode.cc example given in ffmpeg/doc/example.

I always get NULL return value avcodec_get_hw_config on TV.

const AVCodecHWConfig *config = avcodec_get_hw_config(codec, i);

Do i need any other library for enabling hw decoding.

Below is code snippet..
//==============================================
enum AVHWDeviceType type;
type = av_hwdevice_find_type_by_name("vaapi"); //Tried this step with vaapi, vdpau both

for (auto i = 0;; i++) {
        const AVCodecHWConfig *config = avcodec_get_hw_config(codec, i); //This step fails.
        if (!config) {
            return NULL; 
        }
        if (config->methods & AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX &&
            config->device_type == type) {
            hw_pix_fmt = config->pix_fmt;
            break;
        }
    }

//==============================================

Any help is highly appreciated.

Thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions