Closed yikuo123 closed 2 months ago
Please upload a sample video somewhere.
@brabebhin Hello, this is the sample video:
Thanks. I downloaded the video, but i won't be able to take a look until Monday.
Of the top of my head, here's some possible causes :
The video had some issues during muxing, so any GPU based decoding will fail or have weird results. You can try remuxing it (convert to another format and then back to hevc) and see if that fixes it.
GPU drivers might be bugged.
Some hidden edge case in our lib or ffmpeg.
Thanks. I downloaded the video, but i won't be able to take a look until Monday.
Of the top of my head, here's some possible causes :
The video had some issues during muxing, so any GPU based decoding will fail or have weird results. You can try remuxing it (convert to another fornat and then back to hevc) and see if that fixes it.
GPU drivers might be bugged.
Some hidden edge case in our lib or ffmpeg.
Thanks for your reply. I think this problem may not have much to do with GPU-based decoding, because ffmpeg software decoding is also not very normal. And I also think that this type of video may have some differences from most videos in some places, which just triggered some unhandled problems when ffmpeg decodes.
Ffmpeg software decoding can fix issues in the file up to some point, which is not possible for hardware. The fact that system pass through also doesn't work points to faulty file. You can trim the last second to conserve the file but pass it through a remux and see what happens.
I do not get any kind of artifacts with the sample file, no matter if I use hardware or software decoding. Have you checked that the sample still has those issues @yikuo123? If you cut samples using ffmpeg, it will do a remux the stream. This can often resolve issues with incorrectly muxed files, so some problems cannot be reproduced when creating samples with ffmpeg.
If the sample plays fine you your side as well, try to do a binary split of the file and see if the first chunk shows the issue. Often this works. Or upload the complete file, if it is possible. If you have WSL, it's very easy to split, e.g. split -b 100MB video.mov
. Windows does not have any built in tools afaik.
@lukasf
Yes, I still encounter color anomalies (Automatic/ForceFFmpegSoftwareDecoder) or black screen (AutomaticSystemDecoder/ForceSystemDecoder) when playing this video file.
I have tried it on both my PC and Xbox, and the result is the same.
I have also tried splitting the file into smaller chunks using the split command, but playing the first chunk still shows the same phenomenon.
Okay, looks like this is a HDR video and it currently does not play well when the display does not support HDR (or HDR is not enabled). Actually, on my PC this video looks a lot better when playing with our lib, compared to Windows 11 media player or MPC/VLC, because all other players do not use the HDR color info.
However, I need to disable forwarding the HDR metdatata when the display does not have HDR enabled. I have made a PR #339 for this. Please check if this works on your side as well. For me, the video now plays well, both with HDR enabled and disabled (but it looks a lot better with HDR enabled, of course).
Okay, looks like this is a HDR video and it currently does not play well when the display does not support HDR (or HDR is not enabled). Actually, on my PC this video looks a lot better when playing with our lib, compared to Windows 11 media player or MPC/VLC, because all other players do not use the HDR color info.
However, I need to disable forwarding the HDR metdatata when the display does not have HDR enabled. I have made a PR #339 for this. Please check if this works on your side as well. For me, the video now plays well, both with HDR enabled and disabled (but it looks a lot better with HDR enabled, of course).
Thank you for your PR, I have pulled and verified it, and now the color abnormality problem is solved. Both Automatic and ForceFFmpegSoftwareDecoder modes can play normally.
But AutomaticSystemDecoder and ForceSystemDecoder still show black screen, whether I have installed HEVCVideoExtension (Microsoft.HEVCVideoExtension_8wekyb3d8bbwe) or not. If I use MediaSource instead of FFmpegMediaSource, it works well.
Unfortunately i could reproduce the problem, but since this is a pass through, we can't really know what's wrong. I don't see any errors in the logs or outputs. I will dig some more.
Closing this. System decoders is legacy and not recommended anymore and playback works fine with ffmpeg hw decoding.
I encountered a problem when using FFmpegInteropX to play some videos.
If I choose Automatic or ForceFFmpegSoftwareDecoder, the video color is abnormal and there is a mosaic phenomenon;
if I choose AutomaticSystemDecoder or ForceSystemDecoder, it will be black screen.
But if I use the system native player or ffplay to play, everything is normal.
The video information obtained by ffprobe is as follows: