Dolby Vision x265 Encoding, DV Profile Advantages/Caveats?
Re: Dolby Vision x265 Encoding, DV Profile Advantages/Caveats?
Could I convert existing Profile 5 files to Profile 8.1 without losing anything? Would be nice for my mixed DV and non-DV household.
What about the colorspace concern mentioned at the beginning of this thread?
What about the colorspace concern mentioned at the beginning of this thread?
Re: Dolby Vision x265 Encoding, DV Profile Advantages/Caveats?
It does work but without editing the RPU (I’m not yet too familiar with that) my LG B1 (equivalent to C1) internal player crops it wrong. I guess the active area signaling @QuietVoid mentioned. While my Dolby Vision compatible Android TV Stick plays it back just fineArArdin wrote: ↑Fri Jan 28, 2022 9:24 pmInteresting question. I never gave DV for 1080p much thought. Profile 7 RPU is hold by 1080p EL. Profile 7 also supports FHD, if wiki is correct. It does make you wonder if the RPU could indeed be used for FHD video.
Why don't you give it a go? Should it make your tv explode, please be so kind to warn us?
Shield TV 2017 -> LG DSN10YG Soundbar with SPK8 Rears -> LG B1 OLED
Re: Dolby Vision x265 Encoding, DV Profile Advantages/Caveats?
Interesting. I can't make up if you converted P7 to P8.
Chances are if you indeed set active area proper offsets, your TV will playback ok.
Chances are if you indeed set active area proper offsets, your TV will playback ok.
Re: Dolby Vision x265 Encoding, DV Profile Advantages/Caveats?
As per the original post I was trying to make an UHD BR Rip Dolby Vision encode. I used the steps outlined in the post.
The encode is cropped so I used --crop when extracting the RPU from the EL.
The file triggers Dolby Vision on my LG C8 but as soon as I try to seek it stops playing and won't resume.
For testing purposes I tried to inject the uncropped RPU into the untouched/uncropped original Base Layer. The resulting file is now seekable on the LG C8.
So I'm not sure what's wrong with the re-encoded Dolby Vision rip. Could be some x265 settings preventing seek? I used --slow however I didn't use the --uhd-bd switch. Do I have to specify --keyint 24 --min-keyint 1 as I read somewhere that it helps with UHD-BD compliance?
I haven't yet tried to reencode the movie without cropping and inject the uncropped RPU yet but I think it must be some x265 setting that's causing the problem.
Any insight would be much appreciated!
The encode is cropped so I used --crop when extracting the RPU from the EL.
The file triggers Dolby Vision on my LG C8 but as soon as I try to seek it stops playing and won't resume.
For testing purposes I tried to inject the uncropped RPU into the untouched/uncropped original Base Layer. The resulting file is now seekable on the LG C8.
So I'm not sure what's wrong with the re-encoded Dolby Vision rip. Could be some x265 settings preventing seek? I used --slow however I didn't use the --uhd-bd switch. Do I have to specify --keyint 24 --min-keyint 1 as I read somewhere that it helps with UHD-BD compliance?
I haven't yet tried to reencode the movie without cropping and inject the uncropped RPU yet but I think it must be some x265 setting that's causing the problem.
Any insight would be much appreciated!
Re: Dolby Vision x265 Encoding, DV Profile Advantages/Caveats?
I don't know your LG tv, maybe other owners can be more specific to address your issue.
Wrongly set x265 setting certainly can cause problems. Here however I would first check if it's a container issue. Remuxing into another container could help. Or, if your issue is with mkv, you may want to force-set "Default duration" header to the proper value during (re)mux.
I doubt cropped vs. uncropped would make a difference, for the sake of seekability.
As for x265, --keyint can indeed be set too high for certain players (speed/buffering issues). I can also imagine wrong values for VBV buffer, gop, max encoding bitrate and amount of ref frames being a cause.
For comparison of general playback & handling issues, you may want to, as you suggest already, encode with --uhd-bd set, which will keep param values within a certain restrain. In my experience, this will leave way more than enough workroom for x265 to make high quality encodes.
Should you want to compress as strong as possible for the sake of filesize, you instead may try --slower. It will take much more time over --slow, but it's where I think the merits of x265 really start kicking in.
Wrongly set x265 setting certainly can cause problems. Here however I would first check if it's a container issue. Remuxing into another container could help. Or, if your issue is with mkv, you may want to force-set "Default duration" header to the proper value during (re)mux.
I doubt cropped vs. uncropped would make a difference, for the sake of seekability.
As for x265, --keyint can indeed be set too high for certain players (speed/buffering issues). I can also imagine wrong values for VBV buffer, gop, max encoding bitrate and amount of ref frames being a cause.
For comparison of general playback & handling issues, you may want to, as you suggest already, encode with --uhd-bd set, which will keep param values within a certain restrain. In my experience, this will leave way more than enough workroom for x265 to make high quality encodes.
Should you want to compress as strong as possible for the sake of filesize, you instead may try --slower. It will take much more time over --slow, but it's where I think the merits of x265 really start kicking in.
Re: Dolby Vision x265 Encoding, DV Profile Advantages/Caveats?
The tv is a LG C8 and I wrongly said MKV container since the tv doesn't recognize Dolby Vision when it's MKV.
I muxed the RPU injected reencoded hevc with TSMuxer since Dolby Vision works this way with the internal tv player. Like I said it plays fine but seeking doesn't work.
I'm running another encode now with the --uhd-bd flag set to 1. Among other things (aud, hrd, no-open-gop) it sets --keyint 24 and --min_keyint 1
I will report back with the result and I thank you very much for your input.
I muxed the RPU injected reencoded hevc with TSMuxer since Dolby Vision works this way with the internal tv player. Like I said it plays fine but seeking doesn't work.
I'm running another encode now with the --uhd-bd flag set to 1. Among other things (aud, hrd, no-open-gop) it sets --keyint 24 and --min_keyint 1
I will report back with the result and I thank you very much for your input.
Re: Dolby Vision x265 Encoding, DV Profile Advantages/Caveats?
Reencoding with the --uhd-bd flag resolved my problem. Now I can seek and stop/resume the rip on my tv. Thinking about a 2019 Shield Pro. Is there anything other than Plex that support Dolby Vision mkv playback with hd audio on the Shield?
Re: Dolby Vision x265 Encoding, DV Profile Advantages/Caveats?
I am not familiar with both PLEX and the 2019 Shield Pro. But IIRC the Shield suffered from a red push during DV playback.
Maybe you wanna check if this has been fixed.
Re: Dolby Vision x265 Encoding, DV Profile Advantages/Caveats?
Hello, i use your tutorial for inject dv in reencoded mkv.
But i lose "SMPTE ST 2086 HDR10 compatible" in final MKV.
How do to keep this HDR10 metadata in final MKV ?
Thanks.
But i lose "SMPTE ST 2086 HDR10 compatible" in final MKV.
How do to keep this HDR10 metadata in final MKV ?
Thanks.
Re: Dolby Vision x265 Encoding, DV Profile Advantages/Caveats?
Here is a simple python script that automates this process with x265 and dovi_tool included. It's quite primitive, but you can set the CRF and scale. When I input a 4k blu-ray mkv, the program outputs the same file with a transcoded video stream (this will likely bug out with files that have more than one video stream). Download MKVToolNix at https://www.fosshub.com/MKVToolNix.html (the portable version) and unzip it into the "transcode" folder in the zip below. Download and install python at python.org and install an ffmpeg build from https://ffmpeg.org/download.html#build-windows. Double click the "hdr_transcode.py" in the "transcode" folder and input your desired settings. Hope this helps!
- Attachments
-
- transcode.zip
- (2.57 MiB) Downloaded 368 times
Re: Dolby Vision x265 Encoding, DV Profile Advantages/Caveats?
Hello,
I'm very new to DV muxing and the involved programs. So I found this thread and started from here.
I tried the guide with this command (I ran it in the folder where clip.mkv is at):
But I get the following error:
I don't know if I messed up something in the installation or what. ffmpeg and dovi_tools are linked in the PATH variable.
Do I need some additional programs/scripts to make this work?
I'm very new to DV muxing and the involved programs. So I found this thread and started from here.
I tried the guide with this command (I ran it in the folder where clip.mkv is at):
Code: Select all
ffmpeg -i clip.mkv -c:v copy -vbsf hevc_mp4toannexb -f hevc - | dovi_tool -m 2 extract-rpu - -o clip_RPU.bin
Code: Select all
thread 'main' panicked at 'assertion failed: bs.get_n::<u32>(16)? == 0xFFFF', C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\hevc_parser-0.6.1\src\hevc\vps.rs:44:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Do I need some additional programs/scripts to make this work?
Re: Dolby Vision x265 Encoding, DV Profile Advantages/Caveats?
Sounds like a bug in dovi_tool... or a bad file.SciFinn wrote: ↑Fri Mar 10, 2023 1:31 pmHello,
I'm very new to DV muxing and the involved programs. So I found this thread and started from here.
I tried the guide with this command (I ran it in the folder where clip.mkv is at):But I get the following error:Code: Select all
ffmpeg -i clip.mkv -c:v copy -vbsf hevc_mp4toannexb -f hevc - | dovi_tool -m 2 extract-rpu - -o clip_RPU.bin
I don't know if I messed up something in the installation or what. ffmpeg and dovi_tools are linked in the PATH variable.Code: Select all
thread 'main' panicked at 'assertion failed: bs.get_n::<u32>(16)? == 0xFFFF', C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\hevc_parser-0.6.1\src\hevc\vps.rs:44:9 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Do I need some additional programs/scripts to make this work?
Does it fail fast? If so can you cut a small sample that causes the issue?
Re: Dolby Vision x265 Encoding, DV Profile Advantages/Caveats?
I tried running it again using the Glassblowing demo to rule out a bad file, and I get the exact same error message. After ffmpeg finishes I get a blank space in the console and after about ~50 seconds I get this error message.
I also tried to switch to mode 3 (which I suppose shouldn't make a difference?) with the same result. It does create a .bin file, its just 0KB.
Maybe I have a typo or I installed dovi_tool wrong? I just downloaded dovi from the github (The executable)
This is the whole command line from start to error, the most stuff is just ffmpeg:
I also tried to switch to mode 3 (which I suppose shouldn't make a difference?) with the same result. It does create a .bin file, its just 0KB.
Maybe I have a typo or I installed dovi_tool wrong? I just downloaded dovi from the github (The executable)
This is the whole command line from start to error, the most stuff is just ffmpeg:
Code: Select all
PS G:\Downloads\dv_test> ffmpeg -i clip.mp4 -c:v copy -vbsf hevc_mp4toannexb -f hevc - | dovi_tool -m 2 extract-rpu - -o clip_RPU4.bin
ffmpeg version 5.1.2-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 12.1.0 (Rev2, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'clip.mp4':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: mp42isomiso5
creation_time : 2020-10-06T22:33:34.000000Z
Duration: 00:02:58.11, start: 0.000000, bitrate: 15517 kb/s
Stream #0:0[0x1](und): Video: hevc (Main 10) (dvh1 / 0x31687664), yuv420p10le(pc), 1920x1080 [SAR 1:1 DAR 16:9], 15135 kb/s, 59.94 fps, 59.94 tbr, 60k tbn (default)
Metadata:
handler_name : Bento4 Video Handler
vendor_id : [0][0][0][0]
encoder : DOVI Coding
Side data:
DOVI configuration record: version: 1.0, profile: 5, level: 5, rpu flag: 1, el flag: 0, bl flag: 1, compatibility id: 0
Stream #0:1[0x2](und): Audio: eac3 (ec-3 / 0x332D6365), 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
Metadata:
handler_name : Bento4 Sound Handler
vendor_id : [0][0][0][0]
Side data:
audio service type: main
Output #0, hevc, to 'pipe:':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: mp42isomiso5
encoder : Lavf59.27.100
Stream #0:0(und): Video: hevc (Main 10) (dvh1 / 0x31687664), yuv420p10le(pc), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 15135 kb/s, 59.94 fps, 59.94 tbr, 59.94 tbn (default)
Metadata:
handler_name : Bento4 Video Handler
vendor_id : [0][0][0][0]
encoder : DOVI Coding
Side data:
DOVI configuration record: version: 1.0, profile: 5, level: 5, rpu flag: 1, el flag: 0, bl flag: 1, compatibility id: 0
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame=10490 fps=597 q=-1.0 Lsize= 323356kB time=00:02:55.00 bitrate=15136.1kbits/s speed=9.96x
video:323356kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
thread 'main' panicked at 'assertion failed: bs.get_n::<u32>(16)? == 0xFFFF', C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\hevc_parser-0.6.1\src\hevc\vps.rs:44:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
PS G:\Downloads\dv_test>
Re: Dolby Vision x265 Encoding, DV Profile Advantages/Caveats?
Are you using PowerShell? If so please avoid using it when piping with FFmpeg and instead try directly using the old cmd.exe command line.SciFinn wrote: ↑Wed Mar 15, 2023 11:05 pmI tried running it again using the Glassblowing demo to rule out a bad file, and I get the exact same error message. After ffmpeg finishes I get a blank space in the console and after about ~50 seconds I get this error message.
I also tried to switch to mode 3 (which I suppose shouldn't make a difference?) with the same result. It does create a .bin file, its just 0KB.
Maybe I have a typo or I installed dovi_tool wrong? I just downloaded dovi from the github (The executable)
This is the whole command line from start to error, the most stuff is just ffmpeg:
Code: Select all
PS G:\Downloads\dv_test> ffmpeg -i clip.mp4 -c:v copy -vbsf hevc_mp4toannexb -f hevc - | dovi_tool -m 2 extract-rpu - -o clip_RPU4.bin
There's a known issue with PowerShell and piping binary data: https://github.com/PowerShell/PowerShell/issues/1908
It wouldn't surprise me if the data was being altered in PowerShell.
Re: Dolby Vision x265 Encoding, DV Profile Advantages/Caveats?
Thank you! This was it. Didn't realize that Powershell could cause problems. I've never had any problem when using ffmpeg in powershell.