Jellyfin Forum
Converting Dolby Vision to HDR10 - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Guides, Walkthroughs & Tutorials (https://forum.jellyfin.org/f-guides-walkthroughs-tutorials)
+--- Thread: Converting Dolby Vision to HDR10 (/t-converting-dolby-vision-to-hdr10)

Pages: 1 2 3 4 5 6 7 8 9 10 11


RE: Converting Dolby Vision to HDR10 - lakinreid - 2024-12-19

Encountered this error while converting my last few DV 7.6 movies. Any idea what's causing this? Only happening with this movie and one other. Can't seem to find any difference with this mkv and the others which I was successfully able to convert to HDR10. I've attached pics of my error and the mkv info.

EDIT: I figured it out, I just happened to already have converted this one.. THANK YOU TheDreadPirate AND theguymadmax FOR ALL YOUR HELP OVER THE LAST FEW DAYS!!!  Smiling-face


RE: Converting Dolby Vision to HDR10 - theguymadmax - 2024-12-19

You are getting this error because the file contains an image attachment (usually cover.jpg), and the hevc_metadata bitstream filter does not support image streams.

To check the streams in the file, run this command:
Code:
.\ffmpeg -i "c:\path_to\file.mkv"

This will print detailed information about the input file, including all streams (video, audio, subtitles, and attachments). You’ll see something like this in the output:

Code:
Stream #0:0: Video: hevc (Main 10)… 
Stream #0:1: Audio: aac, …. 
Stream #0:2: Subtitle: subrip … 
Stream #0:4: Video: mjpeg (Progressive), yuvj420p(pc, bt470bg/unknown/unknown), 1400x2100 [SAR 1:1 DAR 2:3], 90k tbr, 90k tbn (attached pic) Metadata: filename : cover.jpg mimetype : image/jpeg


Look for any streams labeled as Video: mjpeg. Once identified, you can exclude these image attachments from being processed by adding the corresponding -map -0:4 argument (or whichever stream index corresponds to the image).

For example, your full command might look like this:

Code:
.\ffmpeg.exe -y -hide_banner -stats -fflags +genpts+igndts -loglevel error -map 0 -map -0:4 …


This will exclude the image attachment (cover.jpg), preventing the error related to the hevc_metadata bitstream filter.


RE: Converting Dolby Vision to HDR10 - fcs001fcs - 2024-12-19

(2024-12-18, 11:24 PM)TheDreadPirate Wrote: I moved this post from the other thread.  Are you still having issues?  I'm assuming you figured out that you needed to write to a directory that wasn't read-only to the container.

Yes, I did figure it out. It was a simple issue that in the Jellyfin Container the Shows and Movies directory mapping between host and container was set as Read Only (:ro). Once set to :rw and restarted it worked fine.

Thanks for the responses to my questions.


RE: Converting Dolby Vision to HDR10 - TheDreadPirate - 2024-12-19

@lakinreid - Can you also try specifying the video stream in the bsf?

Code:
/usr/lib/jellyfin-ffmpeg/ffmpeg -y -hide_banner -stats -fflags +genpts+igndts -loglevel error -i "/path/to/your/video.mkv" -map 0 -bsf:v:0 hevc_metadata=remove_dovi=1 -codec copy -max_muxing_queue_size 2048 -max_interleave_delta 0 -avoid_negative_ts disabled hdr10_video.mp4

The change is

Code:
-bsf:v:0

Adding :0 to the end ensures that the bitstream filter is only applied to the video and not the embedded image. This is assuming that the video is the first "video" stream. It usually is, but I've seen weirdly muxed files with the images as the first few streams.


RE: Converting Dolby Vision to HDR10 - error101 - 2024-12-23

Hi All

Unfortunately I have tried the following code with limited success

Code:
/usr/lib/jellyfin-ffmpeg/ffmpeg -y -hide_banner -stats -fflags +genpts+igndts -loglevel error -i "/path/to/dv_video.mkv" -map 0 -bsf:v hevc_metadata=remove_dovi=1 -codec copy -max_muxing_queue_size 2048 -max_interleave_delta 0 -avoid_negative_ts disabled hdr10_video.mkv

I used this with 3 different 4k movies remux files between 50GB -80GB, on movie 1 the results were perfect however on movie 2 and 3 while trying to play the movie it would be constantly blinking/flashing in and out of the video to a blank screen almost like your closing your eyes every second.

I however did find success using the method suggested by @NavicNick

using ubuntu server I downloaded and installed dovi tool, ran the following code to remove dolby vision and extract hevc,

code:
/usr/lib/jellyfin-ffmpeg/ffmpeg -y -hide_banner -loglevel error -stats -i "/path/to/your/DV_video.mkv" -dn -c:v copy -bsf:v hevc_mp4toannexb -f hevc - | dovi_tool remove - -o "hdr10_video.hevc"

i then downloaded the tool MKVToolNix on my windows machine (is also available on linux but im using server edition without gui) added both the new .HEVC file generated and the Original MKV file as an input, untick the video from the Original MKV as we do not want this in the final file, and select the video from the .HEVC, while leaving everything else in the original MKV selected (Subtitles, Audio, Chapters) and then start multiplexing button.

As nick @NavicNick advised I then have a new flawless MKV file with the HDR10 video from the HEVC file, and the audio, subtitles, and chapters from the Original MKV file and will be the method I use going forward.

also my client of choice I use is Firestick 4k max 1st gen


RE: Converting Dolby Vision to HDR10 - TheDreadPirate - 2024-12-23

Do you have Jellyfin-ffmpeg 6 or 7 installed? The first method requires 7.0.2-4.


RE: Converting Dolby Vision to HDR10 - error101 - 2024-12-23

I just check my jellyfin transcoding logs and it has ffmpeg version 7.0.2.

But I also checked the default installed in ubuntu kernel and it says ffmpeg version 6.1.1-3ubuntu5, is this the reason why i am having the issues and if so how do I ensure the correct FFmpeg version is being used when removing dolby vision?

*update*

i thought i would give the other method a go and updated my ubuntu ffmpeg version to match and unfortunately still getting the flicker/blinking issue.

for me the go to method would be as mentioned above in my earlier post which has worked flawlessly on a further 4 movies


RE: Converting Dolby Vision to HDR10 - TheDreadPirate - 2024-12-24

What is the output of ffprobe on this file? I suddenly recalled an issue I ran into as I was falling back asleep where videos with embedded images would fail because the remove_dovi BSF was also getting applied to the embedded image and not just the video.

I'm betting your video has an image embedded in it. To get around this you would change the BSF mapping to only apply to the video.

You'd change this

Code:
-bsf:v

To this

Code:
-bsf:v:0



RE: Converting Dolby Vision to HDR10 - gnattu - 2024-12-24

No, my guess is the timebase generated by ffmpeg totally fucked up the frame time in the output. I *think* you can get the exact results by remuxing with mkvtoolnix with the output from:


/usr/lib/jellyfin-ffmpeg/ffmpeg -y -hide_banner -stats -loglevel error -i "/path/to/dv_video.mkv" -bsf:v hevc_mp4toannexb,hevc_metadata=remove_dovi=1 -dn -c:v copy -f hevc "hdr10_video.hevc"


Updating to this version:
https://github.com/jellyfin/jellyfin-ffmpeg/releases/tag/v7.0.2-8

And remove the -fflags +genpts+igndts might also help with original command.


RE: Converting Dolby Vision to HDR10 - Host-in-the-Shell - 2025-01-01

I've decided to strip all of my media from DV since I just get bizarre issues with this format in some cases even when using clients that support it. HDR10 has never caused me any grief, so I'm sticking to that. DV is supposed to be superior, and maybe it is visually, but just not worth all the headaches.

Just wanted to throw in my appreciation again for this great guide that solves so many problems for me. I was thinking of writing a bash script to sort of automate this conversion, so maybe I'll get around to it eventually.