Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > (HD) DVD, Blu-ray & (S)VCD > DVD & BD Rebuilder

Reply
 
Thread Tools Search this Thread Display Modes
Old 13th August 2021, 21:21   #1  |  Link
alek2702
Registered User
 
Join Date: Jul 2021
Posts: 3
4K to 1080p compliant BD-25?

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 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!
alek2702 is offline   Reply With Quote
Old 14th August 2021, 13:44   #2  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
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 is offline   Reply With Quote
Old 24th August 2021, 14:34   #3  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
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:

Code:
#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:



Quote:
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

Last edited by FranceBB; 24th August 2021 at 14:37.
FranceBB is offline   Reply With Quote
Old 24th August 2021, 20:27   #4  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,973
Quote:
Originally Posted by alek2702 View Post
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 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".
__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net

Last edited by jdobbs; 29th August 2021 at 13:53.
jdobbs is offline   Reply With Quote
Old 11th September 2021, 08:48   #5  |  Link
alek2702
Registered User
 
Join Date: Jul 2021
Posts: 3
Quote:
Originally Posted by FranceBB View Post
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 is offline   Reply With Quote
Old 11th September 2021, 08:58   #6  |  Link
alek2702
Registered User
 
Join Date: Jul 2021
Posts: 3
Quote:
Originally Posted by jdobbs View Post
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.

Last edited by alek2702; 20th September 2021 at 16:30.
alek2702 is offline   Reply With Quote
Old 28th June 2022, 21:32   #7  |  Link
Rich86
Registered User
 
Rich86's Avatar
 
Join Date: Jun 2005
Location: San Fran Bay Area - Calif. - USA
Posts: 217
4K UHD to 1080P BD

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.
Rich86 is offline   Reply With Quote
Old 29th June 2022, 11:01   #8  |  Link
gonca
Registered User
 
Join Date: Jul 2012
Posts: 1,213
Try better or high quality. You should have enough bitrate
gonca is offline   Reply With Quote
Old 4th August 2022, 23:41   #9  |  Link
Rich86
Registered User
 
Rich86's Avatar
 
Join Date: Jun 2005
Location: San Fran Bay Area - Calif. - USA
Posts: 217
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?
Rich86 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:42.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.