H264-Encoder | Implementation of a subset of CBP of h.264 encoder | Machine Learning library

 by   yistLin C++ Version: Current License: No License

kandi X-RAY | H264-Encoder Summary

kandi X-RAY | H264-Encoder Summary

H264-Encoder is a C++ library typically used in Artificial Intelligence, Machine Learning, Deep Learning, Tensorflow applications. H264-Encoder has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

Implementation of a subset of CBP of h.264 encoder
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              H264-Encoder has a low active ecosystem.
              It has 20 star(s) with 3 fork(s). There are 4 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              H264-Encoder has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of H264-Encoder is current.

            kandi-Quality Quality

              H264-Encoder has no bugs reported.

            kandi-Security Security

              H264-Encoder has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              H264-Encoder does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              H264-Encoder releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of H264-Encoder
            Get all kandi verified functions for this library.

            H264-Encoder Key Features

            No Key Features are available at this moment for H264-Encoder.

            H264-Encoder Examples and Code Snippets

            No Code Snippets are available at this moment for H264-Encoder.

            Community Discussions

            QUESTION

            H264 PPS and SPS on Android Device
            Asked 2021-Mar-15 at 00:30

            Using the Android Camera Video recorder I made a video:

            It seems like seqParamSetLength always is 15 and picParamSetLength is always 4.

            Is this somehow defined in Codec (MediaCodec)?

            ...

            ANSWER

            Answered 2021-Mar-15 at 00:30

            It seems like seqParamSetLength always is 15 and picParamSetLength is always 4.

            This is not true. The size of the SPS/PPS are different depending on the encoder and settings used. Since android typically uses hardware encoders, You will get different sizes on different devices.

            Source https://stackoverflow.com/questions/66628929

            QUESTION

            MediaFoundation: Registering custom ClassFactory doesn't work
            Asked 2020-Jan-06 at 14:29

            Background: I'm encoding NV12 buffers into h264 video stream wrapped in MPEG4 container using SinkWriter. Everything works fine but one problem though, as the SinkWriter abstracts the low-level encoder configurations I'm unable to control the properties like GOP size, B-picture count, CODECAPI_AVEncCommonRateControlMode, etc.

            The problem is due to the fact that the SinkWriter instantiates the encoder transform only after the SetInputMediaType call, and we will be able to get the CodecAPI instance only after that point. So, we have no way to control the encoder and configure necessary props before all this happens, it also never honours further changes to the encoder through CodecAPI instance.

            Experiments: I tried the PropertyStore(MF_SINK_WRITER_ENCODER_CONFIG) approach but nothing seemed to be changing (It could be a platform/encoder specific behaviour), I could also see a lot of people complaining about unpredictable behaviours with these APIs. Then, I came across this MSDN thread (Almost 7 years old post) in which the user described how he dealt with this problem by locally registering a custom class factory on Windows7 machine.

            Problem: Having the MSDN thread as a reference, I tried implementing IClassFactory and registering it through MFTRegisterLocal but the CreateInstance function is never getting called for me (Windows 10 machine). I'm only getting the QueryInterface method called for IID_IClassFactory and IID_IMFAttributes interfaces instead. And, the SinkWriter seems to be proceeding with fetching the MFT on its own.

            I understand I might be doing something wrong, and I'm not an expert in COM. Is there any other way I could achieve this?

            Custom class factory implementation:

            ...

            ANSWER

            Answered 2020-Jan-06 at 14:28

            You are walking on thin ice here because what you are trying to do is not supposed to work. You do (or at least can) register a local transform but API would typically prefer other existing MFTs to your one because they are of higher internal merit (and with hardware assistance support), so you are not expected to override existing behavior.

            Your real options are:

            1. to use MF_SINK_WRITER_ENCODER_CONFIG attribute to pass encoder specific configuration
            2. register class factory with COM rather than with MF for existing CLSID of encoder so that COM instantiation of MFT went your way; you would have to figure out details about COM to implement this and I would, in general, not recommend to interfere with standard behavior of COM registration/instantiation without good reason
            3. run encoding MFT (or its equivalent - you don't have to use MFT exactly in this case) separately, outside of Sink Writer API, and feed Sink Writer with already compressed data

            Source https://stackoverflow.com/questions/59611835

            QUESTION

            Intel graphics hardware H264 MFT ProcessInput call fails after feeding few input samples, the same works fine with Nvidia hardware MFT
            Asked 2019-Nov-25 at 08:16

            I'm capturing the desktop using DesktopDuplication API and converting the samples from RGBA to NV12 in GPU and feeding the same to MediaFoundation hardware H264 MFT. This works fine with Nvidia graphics, and also with software encoders but fails when only intel graphics hardware MFT is available. The code works fine on the same intel graphics machine if I fallback to Software MFT. I also have ensured that the encoding is actually done in hardware on Nvidia graphics machines.

            On Intel graphics, MFT returns MEError ("Unspecified error"), which happens just only after the first sample is fed, and subsequent calls to ProcessInput (when event generator triggers METransformNeedInput) returns "The callee is currently not accepting further input". It's rare that MFT consumes a few more samples before returning these errors. This behavior is confusing, I'm feeding a sample only when the event generator triggers METransformNeedInput asynchronously through IMFAsyncCallback, and also checking properly whether METransformHaveOutput is triggered as soon as a sample is fed. This really baffles me when the same asynchronous logic works fine with Nvidia hardware MFT & Microsoft software encoders.

            There is also a similar unresolved question in the intel forum itself. My code is similar to the one mentioned in the intel thread, except for the fact that I'm also setting d3d device manager to the encoder like below.

            And, there are three other stack overflow threads reporting a similar issue with no solution given (MFTransform encoder->ProcessInput returns E_FAIL & How to create IMFSample from D11 texture for Intel MFT encoder & Asynchronous MFT is not sending MFTransformHaveOutput Event(Intel Hardware MJPEG Decoder MFT)). I have tried every possible option with no improvement on this.

            Color converter code is taken from intel media sdk samples. I have also uploaded my complete code here.

            Method to set d3d manager:

            ...

            ANSWER

            Answered 2019-Nov-13 at 21:50

            I looked at your code.

            According to your post, i suspect an Intel video processor problem.

            My OS is Win7, so i decide to test the video processor behaviour with a D3D9Device on my Nvidia card, and then on an Intel HD Graphics 4000.

            I suppose the video processor capabilities will behave the same way for a D3D9Device as for a D3D11Device. Of course it will be necessary to check.

            So i made this program to check : https://github.com/mofo7777/DirectXVideoScreen (see D3D9VideoProcessor sub-project)

            It seems you do not check sufficient things about the video processor capabilities.

            With IDXVAHD_Device::GetVideoProcessorDeviceCaps, here is what i check :

            DXVAHD_VPDEVCAPS.MaxInputStreams > 0

            DXVAHD_VPDEVCAPS.VideoProcessorCount > 0

            DXVAHD_VPDEVCAPS.OutputFormatCount > 0

            DXVAHD_VPDEVCAPS.InputFormatCount > 0

            DXVAHD_VPDEVCAPS.InputPool == D3DPOOL_DEFAULT

            I also check input and output format supported with IDXVAHD_Device::GetVideoProcessorOutputFormats and IDXVAHD_Device::GetVideoProcessorInputFormats.

            This is where i found a difference between Nvidia GPU and Intel GPU.

            NVIDIA : 4 output format

            • D3DFMT_A8R8G8B8
            • D3DFMT_X8R8G8B8
            • D3DFMT_YUY2
            • D3DFMT_NV12

            INTEL : 3 output format

            • D3DFMT_A8R8G8B8
            • D3DFMT_X8R8G8B8
            • D3DFMT_YUY2

            On Intel HD Graphics 4000, there is no support for the NV12 output format.

            Also for the program to work correctly, i need to setup stream state before using VideoProcessBltHD :

            • DXVAHD_STREAM_STATE_D3DFORMAT
            • DXVAHD_STREAM_STATE_FRAME_FORMAT
            • DXVAHD_STREAM_STATE_INPUT_COLOR_SPACE
            • DXVAHD_STREAM_STATE_SOURCE_RECT
            • DXVAHD_STREAM_STATE_DESTINATION_RECT

            For D3D11 :

            ID3D11VideoProcessorEnumerator::GetVideoProcessorCaps == IDXVAHD_Device::GetVideoProcessorDeviceCaps

            (D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT) ID3D11VideoProcessorEnumerator::CheckVideoProcessorFormat == IDXVAHD_Device::GetVideoProcessorOutputFormats

            (D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT) ID3D11VideoProcessorEnumerator::CheckVideoProcessorFormat == IDXVAHD_Device::GetVideoProcessorInputFormats

            ID3D11VideoContext::(...) == IDXVAHD_VideoProcessor::SetVideoProcessStreamState

            Could you first verify the video processor capabilities of your GPU. Do you see same difference as i see ?

            This is the first thing we need to know, and it seems your program does not check this, from what i've seen on your github project.

            Source https://stackoverflow.com/questions/58779958

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install H264-Encoder

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/yistLin/H264-Encoder.git

          • CLI

            gh repo clone yistLin/H264-Encoder

          • sshUrl

            git@github.com:yistLin/H264-Encoder.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link