View Full Version : 4K to 1080p compliant BD-25?
alek2702
13th August 2021, 21:21
Got some 4K mkvs I'd like to back up to 1080p compliant BD-25s.
While I can import them fine, it seems like it's not scaling them down to 1080p in Movie-only mode.
There's an old thread (https://forum.doom9.org/showthread.php?t=177100) from a couple years ago - jdobbs suggested using Alternate output but these are not BD-compliant (slices, vbv-maxrate, GOP size, not sure what else is out of spec) even with the ALTERNATE_BLURAY=1 line added.
Any other way to get a compliant 1080p stream out of 4k files?
Thanks in advance!
FranceBB
14th August 2021, 13:44
I would almost certainly re-encode them myself with Avisynth and x264, but we need more info.
Can you post here a full MediaInfo of the original file?
FranceBB
24th August 2021, 14:34
Well, it's been 10 days and alek2702 didn't reply with more details, so I'm gonna do some guess work and post a reply that will actually help people.
So, he said a 4K .mkv and he wants to get a FULL HD BD, so let's suppose we have a UHD 3840x2160 23.976fps progressive BT2100 HDR PQ 10bit H.265 file and that we want to go to H.264 FULL HD BT709 SDR for BD-25 compatibility.
Here is the AVS Script:
#Indexing
FFMpegSource2("UHD.mkv", atrack=-1)
#From 10bit planar to 16bit planar
ConvertBits(16)
#From YUV to XYZ with 16bit planar precision
ConvertYUVtoXYZ(Color=0, OutputMode=1, HDRMode=0, fullrange=false)
#From HDR PQ to SDR BT709 100 nits tonemapping with 16bit planar precision
ConvertXYZ_Reinhard_HDRtoSDR(exposure_X=2.5, contrast_X=0.9)
#From XYZ back to YUV with 16bit precision
ConvertXYZtoYUV(pColor=0)
#Downscale from UHD to FULL HD with 16bit precison
Spline64Resize(1920, 1080)
#From 4:4:4 planar 16bit to 4:2:0 planar 16bit
Converttoyuv420(matrix="Rec709", interlaced=false)
#Dithering down to 8bit planar with the Floyd Steinberg Error Diffusion
ConvertBits(bits=8, dither=1)
#Clipping
Limiter(min_luma=16, max_luma=235, min_chroma=16, max_chroma=240)
#Resampling
ResampleAudio(48000)
At this point, we just need x264 to create a BD-25 compatible file, so:
avs4x264mod.exe "I:\AVS Script.avs" --x264-binary "x264.exe" --bitrate 25000 --preset medium --profile High --level 4.1 --keyint 24 --slices 4 --deblock -1:-1 --overscan show --range tv --log-level info --thread-input --opencl --colormatrix bt709 --transfer bt709 --colorprim bt709 --videoformat component --nal-hrd vbr --vbv-maxrate 40000 --vbv-bufsize 30000 --pass 1 --output NUL
avs4x264mod.exe "I:\AVS Script.avs" --x264-binary "x264.exe" --bitrate 25000 --preset medium --profile High --level 4.1 --keyint 24 --slices 4 --deblock -1:-1 --overscan show --range tv --log-level info --thread-input --opencl --colormatrix bt709 --transfer bt709 --colorprim bt709 --videoformat component --nal-hrd vbr --vbv-maxrate 40000 --vbv-bufsize 30000 --pass 2 --output "I:\temp\raw_video.h264"
ffmpeg.exe -i "I:\AVS Script.avs" -vn -sn -af loudnorm=I=-24:LRA=10:tp=-2 -c:a dca -b:a 1536k -ar 48000 -strict -2 "I:\temp\audio.dts"
ffmpeg.exe -i "I:\AVS Script.avs" -vn -sn -af loudnorm=I=-24:LRA=10:tp=-2 -c:a ac3 -b:a 384k -ac 2 -ar 48000 "I:\temp\audio.ac3"
C:/Programmi/MKVToolNix\mkvmerge.exe --output "\\VBOXSVR\Share_Windows_Linux\temp\raw_video.mkv" --language 0:und ^"^(^" \\VBOXSVR\Share_Windows_Linux\temp\raw_video.h264 ^"^)^"
ffmpeg.exe -i "\\VBOXSVR\Share_Windows_Linux\temp\raw_video.mkv" -i "\\VBOXSVR\Share_Windows_Linux\temp\audio.dts" -i "\\VBOXSVR\Share_Windows_Linux\temp\audio.ac3" -map 0:0 -map 1:0 -map 2:0 -c:v copy -c:a copy -c:a copy -metadata provider_name="Avisynth" -metadata service_provider="Avisynth" -metadata service_name="Avisynth" -mpegts_original_network_id 0x1122 -mpegts_transport_stream_id 0x3344 -mpegts_service_id 0x5566 -mpegts_pmt_start_pid 0x1500 -mpegts_start_pid 0x150 -mpegts_service_type "digital_tv" -mpegts_flags "resend_headers" "\\VBOXSVR\Share_Windows_Linux\temp\final.m2ts"
pause
This way we've been encoding the file with two passes in H.264 so that it's BD compliant and we've got the .h264 file. Then, we've encoded the audio in DTS and we've added a second track as AC3 for backward compatibility.
Last but not least we've been creating a temporary mkv file with our newly encoded video and audio which has then been remuxed to .m2ts called "final.m2ts" and it's ready to be burned on a disk or be played by a compatible Bluray player on the fly.
Cheers,
Frank
jdobbs
24th August 2021, 20:27
Got some 4K mkvs I'd like to back up to 1080p compliant BD-25s.
While I can import them fine, it seems like it's not scaling them down to 1080p in Movie-only mode.
There's an old thread (https://forum.doom9.org/showthread.php?t=177100) from a couple years ago - jdobbs suggested using Alternate output but these are not BD-compliant (slices, vbv-maxrate, GOP size, not sure what else is out of spec) even with the ALTERNATE_BLURAY=1 line added.
Any other way to get a compliant 1080p stream out of 4k files?
Thanks in advance!All you have to do is make sure that the hidden option:
ALTERNATE_BLURAY=1
... is enabled. It should be enabled by default. But you can add it just to be sure. (See HIDDENOPTS.TXT for more details)
Remember though... you can't just "import" the files or choose an ALTERNATE output option that keeps the original. They have to be reencoded to ALTERNATE output to get proper settings. Setting #10 in the default ALTERNATE.TXT file might be a good choice: "MKV Container, 1920x1080, 640Kbs DD5.1".
alek2702
11th September 2021, 08:48
Well, it's been 10 days and alek2702 didn't reply with more details, so I'm gonna do some guess work and post a reply that will actually help people.
Apologies, I missed your original reply. And thanks a lot for the script, definitely helpful!
alek2702
11th September 2021, 08:58
All you have to do is make sure that the hidden option:
ALTERNATE_BLURAY=1
... is enabled. It should be enabled by default. But you can add it just to be sure. (See HIDDENOPTS.TXT for more details)
Remember though... you can't just "import" the files or choose an ALTERNATE output option that keeps the original. They have to be reencoded to ALTERNATE output to get proper settings. Setting #10 in the default ALTERNATE.TXT file might be a good choice: "MKV Container, 1920x1080, 640Kbs DD5.1".
Thanks for the reply!
I'm aware 4k to 1080p is going to be a re-encode and I did try using the ALTERNATE_BLURAY=1 line but the resulting BD would not play on my PS4 (did work fine in another standalone though).
Upon further inspection I noticed slices, vbv-maxrate, GOP size were out of spec so I don't think the ALTERNATE_BLURAY=1 line was doing its job.
I have since added this to the INI file:
TWEAK_ALTERNATE= --slices 4 --vbv-maxrate 35000
and to alternate.txt:
vKeyint=24
to keep those in spec but was wondering if there's an easier way to do that. Haven't had the chance to test the resulting files on the PS4 yet.
Rich86
28th June 2022, 21:32
I have a 4K-UHD disc copied onto my hard drive (folders & files mode). I am trying to make a movie only blu-ray from this. It is shown as 51.71gb "HEVC 2160p" in the stream dialog box in BD-RB.
I have mode set as movie-only backup with Output BD checked in "Alternate movie output". Target size is set for BD-25. Quality is set to "highest".
Are these the correct settings to convert this movie file from 4K to 1080p and compress it to fit on a BD-25?
When I tried this, it became apparent that it was going to run for a week . . so maybe my computer simply isn't powerful enough to accomplish this?
Any guidance is greatly appreciated.
gonca
29th June 2022, 11:01
Try better or high quality. You should have enough bitrate
Rich86
4th August 2022, 23:41
I came across a bargain priced used video card (Zotac GeForce GTX760) and snagged it. It uses kepler architecture and supports NVENC. It is now installed in my Windows 10 pro tower & I am experimenting & learning to use it. So far, it seems to be working fine.
I launched bdrb & chose 25gb bd as target, nvenc as decoder & "highest quality". The bdrb program defaulted to "one pass vbr" and I left it that way. I processed a blu-ray movie title to fit onto BD25 media. It completed much faster than before I had nvenc as an option and the output looks fine to me. After doing some reading, it seems like "vbr" is the right choice for creating something intended to be burned to BD media.
Question: why doesn't the program offer a 2 pass option for nvenc encoding using vbr? Is 2 pass vbr not an option using nvenc? Maybe not necessary so not listed?
I also processed a blu-ray movie converting to dvd using the same settings. BDRB made 2 passes during the conversion and I don't think it went much faster than before I had nvenc.
Question: is bdrb actually using nvenc VBR when converting a blu-ray to dvd? if yes - why does it make 2 passes for the dvd?
stonesfan129
18th July 2024, 21:48
I think you have to import it then use something like the MKV, 1920x1080, 640Kbs DD 5.1 option under the alternate output options. I did that, re-encoded at like CRF16, then imported THAT output to compress to a BD-25. The problem is if you import the original 4KBD folder structure and just set BD-25 as the output, it will keep it as 4K but reduce it to fit the disc and that encode takes forever.
SuperFist
2nd September 2024, 07:13
All you have to do is make sure that the hidden option:
ALTERNATE_BLURAY=1
... is enabled. It should be enabled by default. But you can add it just to be sure. (See HIDDENOPTS.TXT for more details)
Remember though... you can't just "import" the files or choose an ALTERNATE output option that keeps the original. They have to be reencoded to ALTERNATE output to get proper settings. Setting #10 in the default ALTERNATE.TXT file might be a good choice: "MKV Container, 1920x1080, 640Kbs DD5.1".
I've been experimenting all day and night with this option as I'm trying to convert True Romance 4K BD folder to a 1080p file.
The result keeps coming out as 4K HDR instead of 1080p sans HDR.
I'm going to attempt what stonesfan129 suggested below...
I think you have to import it then use something like the MKV, 1920x1080, 640Kbs DD 5.1 option under the alternate output options. I did that, re-encoded at like CRF16, then imported THAT output to compress to a BD-25. The problem is if you import the original 4KBD folder structure and just set BD-25 as the output, it will keep it as 4K but reduce it to fit the disc and that encode takes forever.
UPDATE: It doesn't work. The result is still 4K but at least it's not HDR.
jdobbs
2nd September 2024, 15:48
I've been experimenting all day and night with this option as I'm trying to convert True Romance 4K BD folder to a 1080p file.
The result keeps coming out as 4K HDR instead of 1080p sans HDR.
I'm going to attempt what stonesfan129 suggested below...
UPDATE: It doesn't work. The result is still 4K but at least it's not HDR.What I was suggesting was:
1. Import the file.
2. Output to ALTERNATE (MKV) with that hidden option set and the output setting to 1080p.
3. Import the resulting MKV file.
Since that flag is set, the output will be BD compliant and you can use it as-is (but delete the PSEUDO folder).
The tricky part, however, is picking a bitrate or constant quality setting (in step 2) that will fill your output media. If you want to eliminate the guesswork, just set the constant quality to some ridiculously high-quality value (like 16 or less). That will result in a large, but virtually lossless, duplicate. Then you can run that import again to create a BD at 1080p. On the other hand, if the imported (pseudo) folder is small enough for your media -- just use it as-is (the quality isn't going to improve much by trying to make it bigger when you have already used a very HQ value).
jdobbs
3rd September 2024, 15:46
I'll look at how hard it might be to add a switch to output UHD to 1080p in movie-only mode.
stonesfan129
21st September 2024, 18:28
Yup as stated above, when I tried encoding to an alternate .mkv file, it was not retaining the HDR information. I mean technically Blu-ray video does not have HDR, Ultra Blu-ray does.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.