Code Monkey home page Code Monkey logo

Comments (2)

mj43 avatar mj43 commented on May 18, 2024 1

Many thanks for this guidance.

from vidgear.

abhiTronix avatar abhiTronix commented on May 18, 2024

@mj43

Writegear uses libx264 or libx265 encoders.

That's incorrect, WriteGear DOES NOT exclusively use libx264 or libx265 encoders, but only use them as fallback encoders when no -vcodec parameter is passed in output_param dict.

Is it possible to make use of existing hardware encoders - for example on an Intel CPU the h264_vaapi encoder.

(The solution is in docs, kindly refer it for more details.)

How to change Output Codec?

Changing codec is a piece of cake in VidGear, just pass the encoder -vcodec:h264_vaapi in output_param dict in WriteGear class. Also you can specify the device/harware to be used with '-vaapi_device':'/dev/dri/renderD128'or other features such as '-vf':'format=nv12,hwupload' in output_param dict. You can easily find such options in FFmpeg docs with a little bit of googling._ But first remember to check if your FFmpeg supports VAAPI encoders as below.

Important ⚠️

Kindly first confirm that your FFmpeg supports VAAPI encoders, with command as follows:

ffmpeg  -hide_banner -encoders | grep vaapi 

 V..... h264_vaapi           H.264/AVC (VAAPI) (codec h264)
 V..... hevc_vaapi           H.265/HEVC (VAAPI) (codec hevc)
 V..... mjpeg_vaapi          MJPEG (VAAPI) (codec mjpeg)
 V..... mpeg2_vaapi          MPEG-2 (VAAPI) (codec mpeg2video)
 V..... vp8_vaapi            VP8 (VAAPI) (codec vp8)

💡 Finally, Remember You can alter almost any parameter that is supported by FFmpeg itself with VidGear library!

from vidgear.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.