• AnyStream is having some DRM issues currently, Netflix is not available in HD for the time being.
    Situations like this will always happen with AnyStream: streaming providers are continuously improving their countermeasures while we try to catch up, it's an ongoing cat-and-mouse game. Please be patient and don't flood our support or forum with requests, we are working on it 24/7 to get it resolved. Thank you.

Guide Reencoding videos via free command-line tools and GPU

@cartman0208

I made some further modifications to the script.
Please test it to see if there are any issues.

Key Changes Explained

  1. Aspect Ratio Calculation and Analysis:
    • What's New: The first script only calculates the aspect ratio based on the resolution. The second script extracts the aspect ratio directly from the video file using MediaInfo and then calculates the closest standard aspect ratio (4:3 or 16:9).
    • Script Note: The second script includes a more accurate method for determining the video's aspect ratio, leading to more precise adjustments in resolution and padding.

  2. Automated Resolution and Aspect Ratio Selection:
    • What's New: The first script compares two standard aspect ratios (1080p and 720p) based on the calculated aspect ratio. The second script, however, uses the actual aspect ratio from the video file to decide between two standard aspect ratios (4:3 and 16:9) and sets the target resolution accordingly.
    • Script Note: The second script provides a more sophisticated approach to selecting the target resolution and aspect ratio, ensuring a better match with the original video's properties.

  3. Handling of Smaller Resolutions:
    • What's New: The first script does not explicitly address smaller resolutions. The second script includes logic to handle smaller resolutions more effectively, especially when the aspect ratio is closer to 4:3.
    • Script Note: The second script includes checks for smaller resolutions to avoid unnecessary padding, making it more efficient for a broader range of video sizes.

  4. Simplified and Streamlined Process:
    • What's New: The second script streamlines the process by automating the selection of resolution and aspect ratio based on the video file's properties, whereas the first script relies more on predefined standard resolutions.
    • Script Note: The second script enhances user experience by reducing manual inputs and automating key decisions, making the process more efficient and user-friendly.

  5. Drag-and-Drop Functionality:
    • Both Scripts: Both scripts are designed with a drag-and-drop feature, where you can drag your video file onto the batch file for processing. This functionality remains consistent in both scripts.

  6. Overall Enhancement:
    • What's New: The second script significantly improves the accuracy of determining the input video file's best resolution and aspect ratio. This leads to better output quality and a more reliable video processing experience.
    • Script Note: The enhancements in the second script make it more versatile and suitable for a broader range of video files, especially in handling different aspect ratios and resolutions.


Revised script:

Code:
@echo off
REM Set the paths for MediaInfo and NVEncC
set MEDIAINFO_PATH=E:\rigaya\MediaInfo\MediaInfo.exe
set NVENCC_PATH=E:\rigaya\NVEncC\NVEncC64.exe

REM Use MediaInfo to get the resolution and aspect ratio of the input file and write them to temporary files
"%MEDIAINFO_PATH%" "--Inform=Video;%%Width%%x%%Height%%" %1 > "%~1.resolution.txt"
"%MEDIAINFO_PATH%" "--Inform=Video;%%DisplayAspectRatio/String%%" %1 > "%~1.aspectratio.txt"

REM Read the resolution from the temporary file
for /f "tokens=1,2 delims=x" %%A in ('type "%~1.resolution.txt"') do (
    set Width=%%A
    set Height=%%B
)

REM Read the aspect ratio from the temporary file
set /p AspectRatioString=<"%~1.aspectratio.txt"

REM Split the aspect ratio string into two parts (X and Y)
for /f "tokens=1,2 delims=:" %%A in ("%AspectRatioString%") do (
    set AspectRatioX=%%A
    set AspectRatioY=%%B
)

REM Convert the aspect ratio to a decimal
set /a AspectRatio=10000*%AspectRatioX%/%AspectRatioY%

REM Define standard aspect ratios
set /a AspectRatio4_3=10000*4/3
set /a AspectRatio16_9=10000*16/9

REM Calculate the difference in aspect ratios
set /a Diff4_3=%AspectRatio%-%AspectRatio4_3%
if %Diff4_3% LSS 0 set /a Diff4_3=-%Diff4_3%

set /a Diff16_9=%AspectRatio%-%AspectRatio16_9%
if %Diff16_9% LSS 0 set /a Diff16_9=-%Diff16_9%

REM Choose the closest standard aspect ratio
if %Diff4_3% LEQ %Diff16_9% (
    REM For 4:3 aspect ratio
    if %Width% LEQ 960 (
        if %Height% LEQ 720 (
            set TARGET_WIDTH=960
            set TARGET_HEIGHT=720
        ) else (
            set TARGET_WIDTH=1440
            set TARGET_HEIGHT=1080
        )
    ) else (
        set TARGET_WIDTH=1440
        set TARGET_HEIGHT=1080
    )
    set TARGET_ASPECT_RATIO=4:3
) else (
    REM For 16:9 aspect ratio
    if %Width% LEQ 1280 (
        if %Height% LEQ 720 (
            set TARGET_WIDTH=%Width%
            set TARGET_HEIGHT=%Height%
        ) else (
            set TARGET_WIDTH=1920
            set TARGET_HEIGHT=1080
        )
    ) else (
        set TARGET_WIDTH=1920
        set TARGET_HEIGHT=1080
    )
    set TARGET_ASPECT_RATIO=16:9
)

REM Calculate padding needed to adjust the video to the target resolution
set /a Width_ADJUST=(%TARGET_WIDTH%-%Width%)/2
set /a Height_ADJUST=(%TARGET_HEIGHT%-%Height%)/2

REM Delete the temporary files
del "%~1.resolution.txt" > NUL 2>&1
del "%~1.aspectratio.txt" > NUL 2>&1

REM Run NVEncC with the calculated parameters
"%NVENCC_PATH%" -i %1 --option-file "E:\rigaya\BluRay.txt" -o "%~1.out.m2ts" --vpp-pad %Width_ADJUST%,%Height_ADJUST%,%Width_ADJUST%,%Height_ADJUST%

REM Pause the script to view any messages before closing
PAUSE


Disclaimer for Blu-ray Compliance and Playback:
  • Important Note: Users should verify that the processed video's final resolution and aspect ratio comply with Blu-ray standards and are suitable for playback on typical Blu-ray players and displays. While the script adjusts the video to common Blu-ray resolutions, it's crucial to consider how different aspect ratios will be displayed.

  • 4:3 Aspect Ratio on 16:9 Displays: For videos in a 4:3 aspect ratio, Blu-ray players and most modern displays will automatically add black bars (pillarboxing) to the sides of the video when played back on a 16:9 screen. This ensures that the video maintains its original aspect ratio without distortion. The script does not need to add these bars; they are typically added during playback by the player or display device.

  • Ensuring Playback Quality: Testing the processed video on the intended playback device or software is recommended to ensure that it displays correctly, especially for videos with non-standard aspect ratios or resolutions. This testing is crucial to confirm that the video meets Blu-ray standards and provides an optimal viewing experience.
In summary, while the script prepares the video for Blu-ray standards, the playback device (like a Blu-ray player or TV) will handle the aspect ratio adjustments, such as adding black bars for 4:3 content on a 16:9 display. It's always a good practice to test the final video to ensure it plays back correctly and looks as intended.


Example of Enhanced Aspect Ratio Handling:

  1. First Script (Old Method):
    • The first script calculates the aspect ratio solely based on the resolution of the video. It uses the formula: AspectRatioInput = 10000 * Width / Height.
    • This method can be inaccurate for videos with non-square pixels or formatted to fit different aspect ratios. It assumes that the pixel aspect ratio is 1:1, which isn't always true.
  2. Second Script (Improved Method):
    • The second script uses MediaInfo to extract the display aspect ratio from the video file directly. This is done using the command: "%MEDIAINFO_PATH%" "--Inform=Video;%%DisplayAspectRatio/String%%" %1 > "%~1.aspectratio.txt".
    • It then reads this aspect ratio from the temporary file and splits it into two parts (X and Y) using a for loop: for /f "tokens=1,2 delims=:" %%A in ("%AspectRatioString%") do (set AspectRatioX=%%A set AspectRatioY=%%B).
    • The script calculates the aspect ratio as a decimal value for easier comparison: set /a AspectRatio=10000*%AspectRatioX%/%AspectRatioY%.
    • It then compares this extracted aspect ratio with standard aspect ratios (4:3 and 16:9) and selects the closest match. This approach is more accurate as it considers the actual display aspect ratio of the video, which can differ from the aspect ratio derived from resolution alone.
What's New:
  • The new method is more reliable for videos where the pixel aspect ratio is not 1:1, or the video has been formatted to fit a specific display aspect ratio.
  • This improvement ensures that the script can handle a broader range of videos more accurately, especially those with non-standard aspect ratios or those that have been edited for specific display formats.
In summary, the second script's method of directly extracting and using the display aspect ratio from the video file results in more accurate and appropriate processing for various video formats, leading to better alignment with standard aspect ratios and improved playback quality.
 
INFO:
I have been informed about a potential issue affecting the BluRay encoding process.
The problem appears not directly related to the AC3 or EAC3 audio formats but rather to specific characteristics of the audio tracks provided by certain sources.
These characteristics may lead to compatibility issues, mainly when using the '--audio-copy' feature.

To ensure a smooth BluRay encoding process, which includes converting video to BluRay-compliant formats, please consider the following steps:

  1. Examine the Audio Track: Use MediaInfo to determine the bitrate and codec of the audio track.
  2. Re-encoding Guidelines:
    • If the audio is in AC3 format with a bitrate of 384kbps, re-encode using these parameters:
      Code:
       --audio-codec AC3 --audio-bitrate 384

    • If the audio is in EAC3 format with a bitrate of 640kbps, use the following settings:
      Code:
       --audio-codec EAC3 --audio-bitrate 640
  3. Conversion to DTS:
    To convert the audio to DTS, please note that the minimum bitrate for DTS is 768kbps, to my knowledge.
    For DTS conversion, use:
    Code:
     --audio-codec dca --audio-bitrate 768


    It is recommended that you conduct a compatibility check with your equipment for the encoded file before proceeding with the encoding of multiple videos.
    This precautionary step ensures that the files work seamlessly with your setup.

    Additionally, for creating the BluRay structure, please utilize 'tsMuxeR'.
    For multi-episodes, you might want to consider trying MultiAVCHD.
 
I wanted to share some settings I've been experimenting with for video denoising using TemporalDegrain, FFT3DGPU, and KNLMeansCL with AviSynth+ 64bit.
All filters use GPU, or GPU usage is enabled to enhance the speed.

  1. TemporalDegrain:
    • Setting: TemporalDegrain(GPU=true,sigma=32,degrain=2,ov=4,blksize=32)
    • Effect: This configuration aims for quality grain removal.
      It's pretty resource-intensive but delivers relatively the best result with less noise and acceptable speed.
  2. FFT3DGPU:
    • Setting: FFT3DGPU(sigma=4.0, bw=32, bh=32, bt=3, plane=0, mode=1)
    • Effect: This setting is faster than TemporalDegrain but might introduce artefacts in specific scenarios.
      It's slightly less effective in noise reduction in specific scenarios.
  3. KNLMeansCL:
    • Setting: KNLCmeansCL(d=2, a=2, s=8, h=4)
    • Effect: This setting offers a balance between speed and quality.
      However, I encountered some issues during batch encoding, which I'm still trying to pinpoint.

Please test these settings and adjust them according to your source.
Remember, there's no one-size-fits-all setting in video processing.


More information and download for the filters below:

Code:
Temporal_Degrain
Info and Download: http://avisynth.nl/index.php/Temporal_Degrain

FFT3DGPU
Info: http://avisynth.nl/index.php/FFT3DGPU
Download: https://github.com/pinterf/FFT3dGPU/releases

KNLMeansCL
Info: http://avisynth.nl/index.php/KNLMeansCL
Download: https://github.com/Khanattila/KNLMeansCL/releases


Please ensure all additional filters are downloaded and put into the relevant folder.
 
I remembered to go into the control panel, file explorer options to show the extensions. They were in the last screenshot. I linked the files and got it working. Thank you very much! I even made some 4K encodes with Dolby Atmos! The picture looks really awesome. If you have any more example .txt I could use them! Have a Merry Christmas and a Happy New Year!
Thank you, same to you too.
If you do 4k a lot I will post some settings later to include in the option file to keep the colour information.
 
Copy colorinformation from original video.

Please add the additional info to your existing option file

Code:
--colorrange auto
--colormatrix auto
--colorprim auto
--transfer auto
--chromaloc auto
--max-cll copy
--master-display copy
--atc-sei auto
--dhdr10-info copy

Here is an explanation of what each command does:
  1. --colorrange auto: This command sets the colour range of the output video. Using auto means it will copy the colour range characteristic from the input file, ensuring consistency in color representation.
  2. --colormatrix auto: This sets the colour matrix used in the video. The auto option copies the colour matrix from the input file. The colour matrix defines how colour elements are mixed and can affect the overall hue and tone.
  3. --colorprim auto: This command sets the colour primaries for the video. Using auto copies the colour primaries from the input file. Colour primaries define the specific range of colours used in the video.
  4. --transfer auto: This sets the transfer characteristics of the video. Using auto will copy these characteristics from the input file. Transfer characteristics determine how the luminance (brightness) levels are handled in the video.
  5. --chromaloc auto: This sets the chroma subsampling location. auto will copy the chroma location flag from the input file. Chroma subsampling is a method that compresses color information to reduce video size.
  6. --max-cll copy: This command sets the Maximum Content Light Level (MaxCLL) and Maximum Frame-Average Light Level (MaxFALL). Using copy will copy these values from the input file. These values are used in HDR content to define the brightest and average brightness levels.
  7. --master-display copy: This sets the Mastering Display Color Volume metadata. Using copy will replicate this metadata from the input file. This metadata provides information about the colour space, brightness, and other characteristics of the display used to master the content.
  8. --atc-sei auto: This sets the Alternative Transfer Characteristics SEI (Supplemental Enhancement Information). Using auto will choose the appropriate characteristics based on the input file. This is important for compatibility with different display technologies, especially HDR content.
  9. --dhdr10-info copy: This applies or copies HDR10+ dynamic metadata. Using copy will replicate this metadata from the input file. HDR10+ is an advanced HDR format that uses dynamic metadata to optimize colour and brightness on a scene-by-scene or even frame-by-frame basis.
 
Copy colorinformation from original video.

Please add the additional info to your existing option file

Code:
--colorrange auto
--colormatrix auto
--colorprim auto
--transfer auto
--chromaloc auto
--max-cll copy
--master-display copy
--atc-sei auto
--dhdr10-info copy

Here is an explanation of what each command does:
  1. --colorrange auto: This command sets the colour range of the output video. Using auto means it will copy the colour range characteristic from the input file, ensuring consistency in color representation.
  2. --colormatrix auto: This sets the colour matrix used in the video. The auto option copies the colour matrix from the input file. The colour matrix defines how colour elements are mixed and can affect the overall hue and tone.
  3. --colorprim auto: This command sets the colour primaries for the video. Using auto copies the colour primaries from the input file. Colour primaries define the specific range of colours used in the video.
  4. --transfer auto: This sets the transfer characteristics of the video. Using auto will copy these characteristics from the input file. Transfer characteristics determine how the luminance (brightness) levels are handled in the video.
  5. --chromaloc auto: This sets the chroma subsampling location. auto will copy the chroma location flag from the input file. Chroma subsampling is a method that compresses color information to reduce video size.
  6. --max-cll copy: This command sets the Maximum Content Light Level (MaxCLL) and Maximum Frame-Average Light Level (MaxFALL). Using copy will copy these values from the input file. These values are used in HDR content to define the brightest and average brightness levels.
  7. --master-display copy: This sets the Mastering Display Color Volume metadata. Using copy will replicate this metadata from the input file. This metadata provides information about the colour space, brightness, and other characteristics of the display used to master the content.
  8. --atc-sei auto: This sets the Alternative Transfer Characteristics SEI (Supplemental Enhancement Information). Using auto will choose the appropriate characteristics based on the input file. This is important for compatibility with different display technologies, especially HDR content.
  9. --dhdr10-info copy: This applies or copies HDR10+ dynamic metadata. Using copy will replicate this metadata from the input file. HDR10+ is an advanced HDR format that uses dynamic metadata to optimize colour and brightness on a scene-by-scene or even frame-by-frame basis.
Should I add this information at the beginning of the file or the end, or it does not matter?
 
Should I add this information at the beginning of the file or the end, or it does not matter?

Example:

Code:
--avhw
--codec hevc
--preset quality
--profile main10
--qp-init 20:23:25
--qp-min 18:21:23
--qp-max 22:25:27
--output-depth 10
--lookahead 32
--bframes 5
--ref 8
--multiref-l0 3
--multiref-l1 3
--bref-mode each
--mv-precision Q-pel
--pic-struct
--split-enc auto
--vpp-deband
--audio-copy
--chapter-copy
--colorrange auto
--colormatrix auto
--colorprim auto
--transfer auto
--chromaloc auto
--max-cll copy
--master-display copy
--atc-sei auto
--dhdr10-info copy

If there should be an error message concerning HDR10+, please ensure to remove the line --dhdr10-info copy to address this issue.
 
Example:

Code:
--avhw
--codec hevc
--preset quality
--profile main10
--qp-init 20:23:25
--qp-min 18:21:23
--qp-max 22:25:27
--output-depth 10
--lookahead 32
--bframes 5
--ref 8
--multiref-l0 3
--multiref-l1 3
--bref-mode each
--mv-precision Q-pel
--pic-struct
--split-enc auto
--vpp-deband
--audio-copy
--chapter-copy
--colorrange auto
--colormatrix auto
--colorprim auto
--transfer auto
--chromaloc auto
--max-cll copy
--master-display copy
--atc-sei auto
--dhdr10-info copy

If there should be an error message concerning HDR10+, please ensure to remove the line --dhdr10-info copy to address this issue.
I already put your extra information at the beginning of the other file. It is running now. This one is totally different then the other one. Which one should I use or should I combine all 3 into 1 text file? This is the one that is running now. Should I put all that into one file? Reencode script is running now. What is the difference between those files?
 

Attachments

  • Reencode Script.jpg
    Reencode Script.jpg
    93.3 KB · Views: 6
  • Script 2.jpg
    Script 2.jpg
    83.4 KB · Views: 6
  • script 3.jpg
    script 3.jpg
    78.5 KB · Views: 6
  • additional information.jpg
    additional information.jpg
    66.9 KB · Views: 6
Last edited:
I already put your extra information at the beginning of the other file. It is running now. This one is totally different then the other one. Which one should I use or should I combine all 3 into 1 text file? This is the one that is running now.
This one is an example.

If you provide the other(s) here, I'll explain the difference.
 
Ok I put them on the other post I was editing.
Ok let's break down what each of these settings does:

Common Settings in All Three Options​

  1. -avhw: Enables hardware acceleration for video processing.
  2. -codec hevc: Specifies the use of the HEVC (H.265) codec for encoding.
  3. -preset quality: Chooses the 'quality' preset for the encoder, balancing quality and encoding speed.
  4. -profile main10: Sets the encoder profile to 'main10', which is typically used for 10-bit color depth.
  5. -qp-init 20:23:25 / -qp-min 18:21:23 / -qp-max 22:25:27: Sets initial, minimum, and maximum quantization parameters for different frame types (I, P, B).
  6. -output-depth 10: Sets the output bit depth to 10 bits, allowing for more color information.
  7. -lookahead 32: Enables 32 frames of lookahead for rate control and scene change detection.
  8. -bframes 5: Sets the number of B-frames (bi-directional predicted frames) to 5.
  9. -ref 8: Sets the number of reference frames to 8.
  10. -multiref-l0 3 / -multiref-l1 3: Sets the number of multiple references for list0 and list1.
  11. -bref-mode each: Uses B-frames as references for other frames.
  12. -mv-precision Q-pel: Sets motion vector precision to quarter-pixel.
  13. -pic-struct: Preserves picture timing structure.
  14. -split-enc auto: Automatically decides on splitting the encoding process (useful for parallel processing).
  15. -audio-copy: Copies the audio stream without re-encoding.
  16. -chapter-copy: Copies chapter information.

Unique Settings in Option ONE​

  • -colorrange auto / -colormatrix auto / -colorprim auto / -transfer auto / -chromaloc auto: Automatically sets colour range, matrix, primaries, transfer characteristics, and chroma location.
  • -max-cll copy / -master-display copy: Copies Max CLL (Content Light Level) and master display colour volume information.
  • -atc-sei auto / -dhdr10-info copy: Automatically sets ATC SEI and copies dynamic HDR10 information.
  • -output-res -4x2160: Sets the output resolution.
  • -vpp-resize lanczos4 / -vpp-deband / -vpp-edgelevel / -vpp-warpsharp: Applies various video post-processing filters like resizing, debanding, edge enhancement, and warp sharp.

Unique Settings in Option TWO​

  • Similar to Option ONE but without the colour and HDR-related settings and without specifying output resolution.

Unique Settings in Option THREE​

  • Similar to Option TWO but includes the colour range setting -colorrange auto.

Additional Settings​

  • These are the colour and HDR-related settings included in Option ONE, which are used to automatically set colour parameters and copy HDR information.
 
Ok let's break down what each of these settings does:

Common Settings in All Three Options​

  1. -avhw: Enables hardware acceleration for video processing.
  2. -codec hevc: Specifies the use of the HEVC (H.265) codec for encoding.
  3. -preset quality: Chooses the 'quality' preset for the encoder, balancing quality and encoding speed.
  4. -profile main10: Sets the encoder profile to 'main10', which is typically used for 10-bit color depth.
  5. -qp-init 20:23:25 / -qp-min 18:21:23 / -qp-max 22:25:27: Sets initial, minimum, and maximum quantization parameters for different frame types (I, P, B).
  6. -output-depth 10: Sets the output bit depth to 10 bits, allowing for more color information.
  7. -lookahead 32: Enables 32 frames of lookahead for rate control and scene change detection.
  8. -bframes 5: Sets the number of B-frames (bi-directional predicted frames) to 5.
  9. -ref 8: Sets the number of reference frames to 8.
  10. -multiref-l0 3 / -multiref-l1 3: Sets the number of multiple references for list0 and list1.
  11. -bref-mode each: Uses B-frames as references for other frames.
  12. -mv-precision Q-pel: Sets motion vector precision to quarter-pixel.
  13. -pic-struct: Preserves picture timing structure.
  14. -split-enc auto: Automatically decides on splitting the encoding process (useful for parallel processing).
  15. -audio-copy: Copies the audio stream without re-encoding.
  16. -chapter-copy: Copies chapter information.

Unique Settings in Option ONE​

  • -colorrange auto / -colormatrix auto / -colorprim auto / -transfer auto / -chromaloc auto: Automatically sets colour range, matrix, primaries, transfer characteristics, and chroma location.
  • -max-cll copy / -master-display copy: Copies Max CLL (Content Light Level) and master display colour volume information.
  • -atc-sei auto / -dhdr10-info copy: Automatically sets ATC SEI and copies dynamic HDR10 information.
  • -output-res -4x2160: Sets the output resolution.
  • -vpp-resize lanczos4 / -vpp-deband / -vpp-edgelevel / -vpp-warpsharp: Applies various video post-processing filters like resizing, debanding, edge enhancement, and warp sharp.

Unique Settings in Option TWO​

  • Similar to Option ONE but without the colour and HDR-related settings and without specifying output resolution.

Unique Settings in Option THREE​

  • Similar to Option TWO but includes the colour range setting -colorrange auto.

Additional Settings​

  • These are the colour and HDR-related settings included in Option ONE, which are used to automatically set colour parameters and copy HDR information.
Thank You very much!!! That is some excellent information and you are a video genius. Let me try a couple and I will respond back again. Have a great day.
 
Tectpro adding those extra options really made a big difference in the color and detail of the reencoded video. I really looks much better then the first copy I made.
 

Attachments

  • Get Back 1.jpg
    Get Back 1.jpg
    194.9 KB · Views: 8
  • Get Back 15.jpg
    Get Back 15.jpg
    108.3 KB · Views: 7
  • vlcsnap-2023-12-15-09h45m03s825.png
    vlcsnap-2023-12-15-09h45m03s825.png
    1.4 MB · Views: 7
  • vlcsnap-2023-12-15-09h45m41s408.png
    vlcsnap-2023-12-15-09h45m41s408.png
    1.2 MB · Views: 7
  • vlcsnap-2023-12-15-09h57m28s997.png
    vlcsnap-2023-12-15-09h57m28s997.png
    1.1 MB · Views: 7
  • vlcsnap-2023-12-15-10h03m21s730.png
    vlcsnap-2023-12-15-10h03m21s730.png
    962.8 KB · Views: 8
  • vlcsnap-2023-12-15-10h03m34s494.png
    vlcsnap-2023-12-15-10h03m34s494.png
    951.8 KB · Views: 7
  • vlcsnap-2023-12-15-10h04m08s719.png
    vlcsnap-2023-12-15-10h04m08s719.png
    1.3 MB · Views: 7
  • vlcsnap-2023-12-15-09h56m05s184.png
    vlcsnap-2023-12-15-09h56m05s184.png
    1.3 MB · Views: 7
Tectpro adding those extra options really made a big difference in the color and detail of the reencoded video. I really looks much better then the first copy I made.

That's great to hear just something to look out for, for each of these settings, --vpp-resize lanczos4 / --vpp-deband / --vpp-edgelevel / --vpp-warpsharp, along with their pros and cons and points to consider:

1. --vpp-resize lanczos4​

  • Description: This setting uses the Lanczos resampling algorithm for resizing, specifically the 8x8 Lanczos resampling (lanczos4).
  • Pros:
    • High-quality resampling, especially effective for downscaling.
    • Preserves more detail compared to simpler algorithms like bilinear or bicubic.
  • Cons:
    • It is more computationally intensive and can be slower.
    • May introduce ringing artefacts around sharp edges.
  • Points to Consider:
    • It is ideal for high-quality scaling where detail preservation is crucial.
    • Should compare results with other algorithms for their specific use case.

2. --vpp-deband​

  • Description: This setting reduces banding artefacts in videos by blurring and adding dither.
  • Pros:
    • Effective in reducing visible banding in gradients.
    • Customizable parameters to balance between debanding strength and preserving details.
  • Cons:
    • It can blur fine details if set too aggressively.
    • It might introduce noise in the form of dithering.
  • Points to Consider:
    • It is useful for videos with noticeable banding, especially in dark scenes.
    • Should adjust parameters carefully to avoid losing important details.

3. --vpp-edgelevel​

  • Description: An edge level adjustment filter that sharpens edges in the video.
  • Pros:
    • Enhances perceived video sharpness.
    • Adjustable strength and noise threshold for flexibility.
  • Cons:
    • Overuse can lead to unnatural-looking edges and amplify noise.
    • It might make compression artefacts more noticeable.
  • Points to Consider:
    • It is best used moderately to avoid over-sharpening.
    • It is ideal for videos that appear soft or lack fine detail.

4. --vpp-warpsharp​

  • Description: An edge warping (sharpening) filter that sharpens by warping edges.
  • Pros:
    • It can produce a more pronounced sharpening effect than traditional sharpening filters.
    • Adjustable parameters for depth and blur to control the strength.
  • Cons:
    • It can create artefacts if used excessively.
    • It is more complex and might be slower than simple sharpening filters.
  • Points to Consider:
    • Suitable for content where aggressive sharpening is desired.
    • You should experiment with settings to avoid unnatural results.

General Advice:​

  • Always Check Encodes: Always check the encodes to ensure you are satisfied with the results. Different content may react differently to these filters.
  • Balance is Key: It's essential to find a balance between improving video quality and preserving naturalness.
  • Test Different Settings: Test different settings and compare results to find the optimal configuration for their needs.

You can see all the available settings here
Code:
 https://github.com/rigaya/NVEnc/blob/master/NVEncC_Options.en.md#
 
That's great to hear just something to look out for, for each of these settings, --vpp-resize lanczos4 / --vpp-deband / --vpp-edgelevel / --vpp-warpsharp, along with their pros and cons and points to consider:

1. --vpp-resize lanczos4​

  • Description: This setting uses the Lanczos resampling algorithm for resizing, specifically the 8x8 Lanczos resampling (lanczos4).
  • Pros:
    • High-quality resampling, especially effective for downscaling.
    • Preserves more detail compared to simpler algorithms like bilinear or bicubic.
  • Cons:
    • It is more computationally intensive and can be slower.
    • May introduce ringing artefacts around sharp edges.
  • Points to Consider:
    • It is ideal for high-quality scaling where detail preservation is crucial.
    • Should compare results with other algorithms for their specific use case.

2. --vpp-deband​

  • Description: This setting reduces banding artefacts in videos by blurring and adding dither.
  • Pros:
    • Effective in reducing visible banding in gradients.
    • Customizable parameters to balance between debanding strength and preserving details.
  • Cons:
    • It can blur fine details if set too aggressively.
    • It might introduce noise in the form of dithering.
  • Points to Consider:
    • It is useful for videos with noticeable banding, especially in dark scenes.
    • Should adjust parameters carefully to avoid losing important details.

3. --vpp-edgelevel​

  • Description: An edge level adjustment filter that sharpens edges in the video.
  • Pros:
    • Enhances perceived video sharpness.
    • Adjustable strength and noise threshold for flexibility.
  • Cons:
    • Overuse can lead to unnatural-looking edges and amplify noise.
    • It might make compression artefacts more noticeable.
  • Points to Consider:
    • It is best used moderately to avoid over-sharpening.
    • It is ideal for videos that appear soft or lack fine detail.

4. --vpp-warpsharp​

  • Description: An edge warping (sharpening) filter that sharpens by warping edges.
  • Pros:
    • It can produce a more pronounced sharpening effect than traditional sharpening filters.
    • Adjustable parameters for depth and blur to control the strength.
  • Cons:
    • It can create artefacts if used excessively.
    • It is more complex and might be slower than simple sharpening filters.
  • Points to Consider:
    • Suitable for content where aggressive sharpening is desired.
    • You should experiment with settings to avoid unnatural results.

General Advice:​

  • Always Check Encodes: Always check the encodes to ensure you are satisfied with the results. Different content may react differently to these filters.
  • Balance is Key: It's essential to find a balance between improving video quality and preserving naturalness.
  • Test Different Settings: Test different settings and compare results to find the optimal configuration for their needs.

You can see all the available settings here
Code:
 https://github.com/rigaya/NVEnc/blob/master/NVEncC_Options.en.md#
So you can set different values for some of these settings? In order to use that link you have to sign in to github. I am not a member. Can anybody make an account or only certain people who have credentials?
 
So you can set different values for some of these settings? In order to use that link you have to sign in to github. I am not a member. Can anybody make an account or only certain people who have credentials?
You can use different values if you want. If you don't set any, it'll just use the standard ones.
However, remember that some settings require you to input specific values.

Also, you don't need to sign up for GitHub to get the necessary information. You can see it without an account.
 
You can use different values if you want. If you don't set any, it'll just use the standard ones.
However, remember that some settings require you to input specific values.

Also, you don't need to sign up for GitHub to get the necessary information. You can see it without an account.
It must of been my internet ; at first I could not go to the link. If you want something to be sharper would you use a higher number right and is it the same for all of the options. The higher the number more and lower less ? Would this one copy the embedded subtitles from the original file??? Your batch script has to have subtitles doesn't it? Do you have a batch file that would just copy the file and audio to MKV without adding the subtitles??? That option would copy the embedded subtitles right??? If I take this part out of the script would it work without subtitles?? "%%i" --sub-source "%%~dpni.en-us.srt"

--sub-copy​

 
Last edited:
It must of been my internet ; at first I could not go to the link. If you want something to be sharper would you use a higher number right and is it the same for all of the options. The higher the number more and lower less ? Would this one copy the embedded subtitles from the original file??? Your batch script has to have subtitles doesn't it? Do you have a batch file that would just copy the file and audio to MKV without adding the subtitles??? That option would copy the embedded subtitles right??? If I take this part out of the script would it work without subtitles?? "%%i" --sub-source "%%~dpni.en-us.srt"

--sub-copy​

Correct. The --sub-copy option is used to copy the subtitle. If you wish to use it, you can replace --sub-source "%%~dpni.en-us.srt". However, please ensure that the %%i part remains unchanged at the beginning.

If you prefer not to include subtitles in your output at all, you can simply omit the --sub-source "%%~dpni.en-us.srt" from your command. For convenience, you might consider creating a new batch file without this line.

As a general rule, the higher the numerical value in these settings, the more pronounced the effect will be. This applies to various parameters where increasing the value intensifies the impact of the applied effect.


Example

Code:
@echo off
cd %~dp0
for %%i in (*.mp4) do (
    "E:\rigaya\NVEncC\NVEncC64.exe" -i "%%i" --sub-copy --option-file "E:\rigaya\NVEncC\example.txt" -o "F:\REencode\%%~ni.mkv"
)
pause
 
Correct. The --sub-copy option is used to copy the subtitle. If you wish to use it, you can replace --sub-source "%%~dpni.en-us.srt". However, please ensure that the %%i part remains unchanged at the beginning.

If you prefer not to include subtitles in your output at all, you can simply omit the --sub-source "%%~dpni.en-us.srt" from your command. For convenience, you might consider creating a new batch file without this line.

As a general rule, the higher the numerical value in these settings, the more pronounced the effect will be. This applies to various parameters where increasing the value intensifies the impact of the applied effect.
 
I did create a new file because I have movies with embedded subtitles that I want to convert. I added the line --sub-copy to the text and it copied them. Now the subtitles even work with windows movies and tv when before they did not. Can you change the output to .mp4 or does it have to be .mkv
 
Back
Top