Brilliant thanks Anton.

Just to be complete if its codec "139 - Google VP8" then you need to find "libvpx-vp8" and
if its "167 - Google VP9" then you need to find "libvpx-vp9".

Also you can load a stream with avcodec_open2 and override the codec there instead.


On 6/15/2018 7:25 PM, Anton Shekhovtsov wrote:
Hi, "libvpx" is not input format, see this for example

  AVCodec* pDecoder = avcodec_find_decoder(m_pStreamCtx->codecpar->codec_id);
  if(m_pStreamCtx->codecpar->codec_id==AV_CODEC_ID_VP8){
    // on2 vp8 does not extract alpha
    AVCodec* pDecoder2 = avcodec_find_decoder_by_name("libvpx");
    if(pDecoder2) pDecoder = pDecoder2;
  }


2018-06-15 3:02 GMT+03:00 Mark Schafer <[email protected]>:

Ahh I think its

AVInputFormat *inputFormat =av_find_input_format("libvpx");
avformat_open_input(&pAVFormatContext, dev_name, inputFormat, NULL) 

On 6/15/2018 11:49 AM, Mark Schafer wrote:
OK. Thanks Carl.

So you're saying I should always override it with libvpx if the file I'm loading is .webm ?
and if you don't mind - how do I override the codec on load ?
Is it in AVInputFormat by stipulating the extension and codec_tag ?


On 6/15/2018 11:13 AM, Carl Eugen Hoyos wrote:
2018-06-14 23:03 GMT+02:00, Mark Schafer <[email protected]>:
We're trying to integrate ffmpeg 4 with Pyglet.
Its all going very well but we have one issue:

- If a VP9 (or VP8) file is created using ffmpeg4 from png files with
alphas, we get a video file (webm) with alpha internally. (Excellent)
- ffmpeg -i image_seq%03d.png -qmin 0 -qmax 50 -crf 5 -b:v 1M output.webm
      - The report from this CLI indicates that an alpha has been generated.

- Sample webm videos with alpha can be found on this page:
https://simpl.info/videoalpha/
- However on playing back we only get the RGB and do not get the alpha
unless we override the codec to be 'libvpx'.
Yes, this is a known limitation of the native decoder, luckily you
have already found the only known work-around - not to use it if
you need this feature.

If you really want to choose the decoder based on the alpha
layer, you can check AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL
if the side_data starts with (uint64_t) 1 there is a transparency layer.

It is probably simpler to always use the libvpx decoder.

Carl Eugen
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user


_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user




_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user


_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to