I'm testing FFMPEG on my server. I'm trying to transcode H265 10-bit to H264 8-bit to support playing the video on all major web browser.
1. This is the first command:
ffmpeg -i 4K.ts -c:a aac -c:v h264 -crf 19 -preset ultrafast out.mp4
Result: Video only playable on VLC media player. Doesn't play on any browser
2. Then I tried using this command:
ffmpeg -i 4K.ts -c:a aac -c:v h264 -crf 19 -profile:v main -preset ultrafast -vf "format=yuv420p" out.mp4
Result: Video is playable everywhere but massive color loss.
3. Then I tried another command:
ffmpeg -i 4K.ts -c:a aac -c:v h264 -crf 19 -profile:v main -preset ultrafast -vf "format=yuvj420p" out.mp4
Result: Video is playable everywhere but increased color range
I don't know if I am missing anything or If I should completely disallow users to upload video with 10-bit depth. Any help will be greatly appreciated
If anyone interested in the video which I am testing on then here is the link: https://drive.google.com/uc?export=download&id=1pGsnknkoIDRPKrW-YPFS7U31J09PeM4N
I followed through many google results to come up with these command, Some of them are:
The problem is not related to the 10bit HEVC encoding, but rather the loss of HDR metadata during conversion. It's a typical case of UHD 4K video to SDR conversion.
I'm not an FFMPEG expert, so I can't provide much further detail to this answer however if someone wants to convert HDR to SDR then you can use this command: