Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimpleEncoder output question #490

Open
daneden21 opened this issue Jul 19, 2024 · 5 comments
Open

SimpleEncoder output question #490

daneden21 opened this issue Jul 19, 2024 · 5 comments
Labels

Comments

@daneden21
Copy link

Hi Guys,

I try to encode a stream of a screen capture to AV1 using AMF. I used the SimpleEncoder example to implement AMF in my application.
The output file has no content and doesnt look like a video file but it has a valid size.

After not getting further within my app I tried SimpleEncoder as a stand alone and it generates an "output.h264" that I cant open in any media player.

I also tried TranscodeHW.exe and this works fine. The output files are all OK and useable independent of the used codec. All of them work.

Now here is the part that I dont understand: When I use the "output.h264" from the SimpleEncoder as input for the TranscodeHW.exe it generates a wonderful working video file. So what am I missing here?

Does the encoder output file need some post processing to work?

I would be thankful for every advice.

@MikhailAMD
Copy link
Collaborator

SimpleEncoder sample is minimalistic and only shows how to use AMF encoder. The produced output file is elementary stream for any codec. It consists only of encoded data. Some applications can parse and read such files, like FFmpeg, many regular apps and players don't. TranscodeHW in addition to encoding also "mux" the file, meaning wraps the encoded data into file container format like MKV or MP4. It also transcodes and muxes audio into the file. These files are playable by all apps. The TranscodeHW sample uses FFmpeg library to do muxing and audio processing.

@daneden21
Copy link
Author

Thank you very much for your quick answer. This is very helpful for me as an absolute beginner in video encoding.
I have seen the muxing description in the AMF_Video_Encode_API dokumentation and I thought this is only necessary when you want to add an audio stream to the final video.

I have another final question regarding native DX12 support. Before I tried AMF I tried to use the native dx12 ID3D12VideoDevice interface. I can create the device but when I use ID3D12VideoDevice::CheckFeatureSupport to check for encoder support it gives an error. I searched the internet if AMD supports this but couldnt find anything only AMF informations. So is native dx12 de-/encoding supported by AMD?

Btw I use an APU with 780M graphics, so RDNA3.

Thank you and have a nice weekend.

@MikhailAMD
Copy link
Collaborator

D3D12 native encoding and decoding are supported but you need to check the driver version.

@daneden21
Copy link
Author

daneden21 commented Jul 25, 2024

Hi,

I just wanted to let you know that I got it working in my app and the performance is great. Actually not much code is necesssary to mux the encoder output into a ffmpeg container. If I can do it everybody can, so AMF is really easy to work with.

During coding I found one thing that make me wonder a bit. When I compare the AMF_VIDEO_ENCODER_AV1_USAGE_ENUM to AMF_VIDEO_ENCODER_HEVC_USAGE_ENUM and AMF_VIDEO_ENCODER_USAGE_ENUM the order of the elements is changed in one position. 0:Transcoding, 1: Ultra_low_latency, 2: Low_latency, 3: Webcam, 4: HQ, 5: LL HQ for h264 and h265. For av1 Nr.1&2 are exchanged, is this a typo or should it be like this?

Kind regards

@MikhailAMD
Copy link
Collaborator

This is not a typo. You should treat parameters for every codec as completely independent from another codec. There was no intention to match enum values between codecs.
Great to hear that your app is up and running. When/if you make it a product or public, you may send us a link for tracking purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants