Github user sreid8 commented on a diff in the pull request:
    --- Diff: src/guacenc/ffmpeg-compat.c ---
    @@ -165,3 +197,62 @@ int guacenc_avcodec_encode_video(guacenc_video* video, 
AVFrame* frame) {
    +AVCodecContext* guacenc_build_avcodeccontext(AVStream* stream,
    +        AVCodec* codec,
    +        int bitrate,
    +        int width,
    +        int height,
    +        int gop_size,
    +        int qmax,
    +        int qmin,
    +        int pix_fmt,
    +        AVRational time_base) {
    +    stream->codec->bit_rate = bitrate;
    --- End diff --
    In video.c, the stream is allocated already with the exact same codec that 
is passed here. It was only after libavformat 57.33.100 where the codec output 
parameters of the video were promoted from ```AVStream->codec->*``` to 
```AVStream->codecpar```. The new function ```guacenc_open_avcodec``` handles 
moving the parameters from the ```context``` (which are set here) to 
```codecpar``` in the case that libavformat >= 57.33.100. This ffmpeg API 
change is documented 
    However, before 57.33.100, the ```stream->codec``` is where the parameters 
are placed and the ```codec``` member of this struct has already been set to 
the proper codec when it was allocated.


Reply via email to