xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #1235: nven6-bframes-stub.patch

File nven6-bframes-stub.patch, 2.2 KB (added by Antoine Martin, 5 years ago)

asking for B frames doesn't seem to do anything either, frames still come out..

  • xpra/codecs/nvenc6/encoder.pyx

     
    14141414        self.input_height = roundup(height, 32)
    14151415        self.encoder_width = roundup(width*v//u, 32)
    14161416        self.encoder_height = roundup(height*v//u, 32)
     1417        self.b_frames = int(options.get("b-frames", 0))
    14171418        self.src_format = src_format
    14181419        self.dst_formats = dst_formats
    14191420        self.codec_name = encoding.upper()      #ie: "H264"
     
    17251726                "codec"     : self.codec_name,
    17261727                "encoder_width"     : self.encoder_width,
    17271728                "encoder_height"    : self.encoder_height,
     1729                "b-frames"          : bool(self.b_frames),
    17281730                "bitrate"           : self.target_bitrate,
    17291731                "quality"           : self.quality,
    17301732                "speed"             : self.speed,
     
    21252127                picParams.pictureType = NV_ENC_PIC_TYPE_IDR
    21262128                picParams.encodePicFlags = NV_ENC_PIC_FLAG_OUTPUT_SPSPPS
    21272129            else:
    2128                 picParams.pictureType = NV_ENC_PIC_TYPE_P
     2130                if self.b_frames and (self.frames%2)==1:
     2131                    picParams.pictureType = NV_ENC_PIC_TYPE_B
     2132                else:
     2133                    picParams.pictureType = NV_ENC_PIC_TYPE_P
    21292134            picParams.codecPicParams.h264PicParams.displayPOCSyntax = 2*self.frames
    21302135            picParams.codecPicParams.h264PicParams.refPicFlag = self.frames==0
    21312136            picParams.codecPicParams.h264PicParams.sliceMode = 3            #sliceModeData specifies the number of slices
     
    22072212        self.last_frame_times.append((start, end))
    22082213        elapsed = end-start
    22092214        self.time += elapsed
    2210         log("compress_image(..) %s %s returning %s bytes (%.1f%%) for %s frame %i took %.1fms",
     2215        log.info("compress_image(..) %s %s returning %s bytes (%.1f%%) for %s frame %i took %.1fms",
    22112216            get_type(), get_version(),
    22122217            size, 100.0*size/input_size, PIC_TYPES.get(picParams.pictureType, picParams.pictureType), self.frames, 1000.0*elapsed)
    22132218        return data, client_options