• 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

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

Subtitle Support

MP4
- Subtitles: MP4 typically supports 'Timed Text' and sometimes 'MPEG-4 Timed Text'.
- Limitations: It doesn't support many subtitle formats natively. Advanced subtitle features like styling or positioning are often not supported.

MKV (Matroska)
- Subtitles: MKV supports a wide range of subtitle formats, including SRT (SubRip), SSA/ASS (SubStation Alpha/Advanced SubStation Alpha), VobSub (subtitles from DVD), PGS (Blu-ray subtitles), and others.
- Advantages: It allows for more complex and styled subtitles, including fonts, colors, positioning, and effects.
 
Subtitle Support

MP4
- Subtitles: MP4 typically supports 'Timed Text' and sometimes 'MPEG-4 Timed Text'.
- Limitations: It doesn't support many subtitle formats natively. Advanced subtitle features like styling or positioning are often not supported.

MKV (Matroska)
- Subtitles: MKV supports a wide range of subtitle formats, including SRT (SubRip), SSA/ASS (SubStation Alpha/Advanced SubStation Alpha), VobSub (subtitles from DVD), PGS (Blu-ray subtitles), and others.
- Advantages: It allows for more complex and styled subtitles, including fonts, colors, positioning, and effects.
I have things that I got with AS that are .mp4 but if I try to upscale it and keep it .mp4 the subtitles will not work even though it is already a .mp4.
 
I have things that I got with AS that are .mp4 but if I try to upscale it and keep it .mp4 the subtitles will not work even though it is already a .mp4.
Can you please elaborate?
What subtitles you have with that mp4?
 
Can you please elaborate?
What subtitles you have with that mp4?
Most stuff that I download with any stream I have subtitles embedded but if I try to upscale and keep it mp4 it does not work because of what ever subtitles they use. I was trying Staxrip and it would just keep failing everytime. I thought because it was already mp4 it would work but I guess you are still reencoding the video. I am pretty sure they are srt. Staxrip says they do not have time stamps but when I put them in sub title edit I can see them and they play with vlc.
 
Last edited:
Most stuff that I download with any stream I have subtitles embedded but if I try to upscale and keep it mp4 it does not work because of what ever subtitles they use. I was trying Staxrip and it would just keep failing everytime. I thought because it was already mp4 it would work but I guess you are still reencoding the video. I am pretty sure they are srt. Staxrip says they do not have time stamps but when I put them in sub title edit I can see them and they play with vlc.
Ok . I see. You are using the embedded subtitled.
I'm currently not near my "machine" and would be only able to check on this tomorrow.
 
Ok fine Have a nice day.
I conducted tests on MP4 containers with embedded subtitles created by Anystream, focusing on the --sub-copy feature.

This is the original:

Code:
Text
ID                                       : 3
Format                                   : Timed Text
Muxing mode                              : sbtl
Codec ID                                 : tx3g
Duration                                 : 1 h 35 min
Bit rate mode                            : Variable
Bit rate                                 : 77 b/s
Frame rate                               : 0.487 FPS
Stream size                              : 54.1 KiB (0%)
Title                                    : English [CC] / English [CC]
Language                                 : English
Default                                  : Yes
Forced                                   : No
Alternate group                          : 2
Encoded date                             : 2023-12-16 23:51:43 UTC
Tagged date                              : 2023-12-16 23:51:43 UTC
Count of events                          : 1393


Activating the --sub-copy option in NVENC results in copying the subtitles.

Interestingly, when the container format is MKV, the subtitles are converted into ASS format.

Code:
Text
ID                                       : 3
Format                                   : ASS
Codec ID                                 : S_TEXT/ASS
Codec ID/Info                            : Advanced Sub Station Alpha
Compression mode                         : Lossless
Title                                    : English [CC]
Language                                 : English
Default                                  : Yes
Forced                                   : No



In the case of an MP4 container, the subtitles are directly copied without any format change.

Code:
Text
ID                                       : 3
Format                                   : Timed Text
Muxing mode                              : sbtl
Codec ID                                 : tx3g
Stream size                              : 2.00 Bytes (0%)
Title                                    : English [CC]
Language                                 : English
Default                                  : Yes
Forced                                   : Mixed
Alternate group                          : 3
Count of events                          : 0


Upon reviewing the rigayas' GitHub page information, I noted that the '--sub-copy' function supports various subtitle formats, including PGS, SRT, TXT, and TTXT.


I conducted additional tests on upscaling HD content to 4K to assess any potential issues related to the subtitles.
However, the subtitles were successfully copied into the new MP4 file without issues during upscaling.
The video performed well upon playback, with the subtitles displaying correctly without any problems.

Code:
Text
ID                                       : 3
Format                                   : Timed Text
Muxing mode                              : sbtl
Codec ID                                 : tx3g
Duration                                 : 4 min 37 s
Bit rate mode                            : Variable
Bit rate                                 : 21 b/s
Frame rate                               : 0.170 FPS
Stream size                              : 716 Bytes (0%)
Title                                    : English [CC]
Language                                 : English
Default                                  : Yes
Forced                                   : Mixed
Alternate group                          : 3
Count of events                          : 23
 
I conducted tests on MP4 containers with embedded subtitles created by Anystream, focusing on the --sub-copy feature.

This is the original:

Code:
Text
ID                                       : 3
Format                                   : Timed Text
Muxing mode                              : sbtl
Codec ID                                 : tx3g
Duration                                 : 1 h 35 min
Bit rate mode                            : Variable
Bit rate                                 : 77 b/s
Frame rate                               : 0.487 FPS
Stream size                              : 54.1 KiB (0%)
Title                                    : English [CC] / English [CC]
Language                                 : English
Default                                  : Yes
Forced                                   : No
Alternate group                          : 2
Encoded date                             : 2023-12-16 23:51:43 UTC
Tagged date                              : 2023-12-16 23:51:43 UTC
Count of events                          : 1393


Activating the --sub-copy option in NVENC results in copying the subtitles.

Interestingly, when the container format is MKV, the subtitles are converted into ASS format.

Code:
Text
ID                                       : 3
Format                                   : ASS
Codec ID                                 : S_TEXT/ASS
Codec ID/Info                            : Advanced Sub Station Alpha
Compression mode                         : Lossless
Title                                    : English [CC]
Language                                 : English
Default                                  : Yes
Forced                                   : No



In the case of an MP4 container, the subtitles are directly copied without any format change.

Code:
Text
ID                                       : 3
Format                                   : Timed Text
Muxing mode                              : sbtl
Codec ID                                 : tx3g
Stream size                              : 2.00 Bytes (0%)
Title                                    : English [CC]
Language                                 : English
Default                                  : Yes
Forced                                   : Mixed
Alternate group                          : 3
Count of events                          : 0


Upon reviewing the rigayas' GitHub page information, I noted that the '--sub-copy' function supports various subtitle formats, including PGS, SRT, TXT, and TTXT.


I conducted additional tests on upscaling HD content to 4K to assess any potential issues related to the subtitles.
However, the subtitles were successfully copied into the new MP4 file without issues during upscaling.
The video performed well upon playback, with the subtitles displaying correctly without any problems.

Code:
Text
ID                                       : 3
Format                                   : Timed Text
Muxing mode                              : sbtl
Codec ID                                 : tx3g
Duration                                 : 4 min 37 s
Bit rate mode                            : Variable
Bit rate                                 : 21 b/s
Frame rate                               : 0.170 FPS
Stream size                              : 716 Bytes (0%)
Title                                    : English [CC]
Language                                 : English
Default                                  : Yes
Forced                                   : Mixed
Alternate group                          : 3
Count of events                          : 23
So you can change the output format to mp4 and it will work properly? If that is the case that is the only method I have found that works and keeps the subtitles intact in a .mp4 container. So on the batch file you just change the output format to .mp4 from .mkv? Do they play on windows movies and tv?
 
Last edited:
So you can change the output format to mp4 and it will work properly? If that is the case that is the only method I have found that works and keeps the subtitles intact. So on the batch file you just change the output format to .mp4 from .mkv?
Indeed, I encountered no issues during the process.
As long as the subtitles are in Timed Text format, they are copied when you change the output format to MP4.
 
I got some questions regarding CQP encoding.

CQP stands for Constant Quantization Parameter encoding. It's a rate control mode used in video encoding processes, particularly in hardware-accelerated encoders like QSV (Intel Quick Sync Video), NVENC (NVIDIA's Encoder), and VCE/VCN (AMD's Video Coding Engine/Video Core Next). Here's a breakdown of your questions:


1. What is CQP Encoding?


- In CQP encoding, a constant quantization parameter is used throughout the entire video. The quantization parameter (QP) determines the level of compression for each frame. A lower QP means higher quality and larger file size, while a higher QP results in lower quality and smaller file size.


- Unlike other rate control modes that aim for a consistent bitrate, CQP focuses on maintaining a consistent level of quality throughout the video.

Quality Focus: In CQP, the encoder adjusts the compression level based on the content of each frame to maintain a consistent quality. This means that complex scenes with lots of details might be less compressed (to preserve quality), while simpler scenes might be more compressed.

Bitrate Variability: Because the focus is on quality rather than bitrate, the bitrate can vary significantly throughout the video. In scenes with high complexity or motion, the bitrate might be higher, and in simpler scenes, it might be lower.


2. Why is Clean Video Compressed Better with CQP than Grainy Video?


- Grainy or noisy videos have a lot of small details. To preserve these details and maintain a consistent quality level (as CQP aims to do), the encoder needs to use a lower quantization parameter (i.e., less compression). This results in a larger file size because more data is required to accurately represent all the fine details and variations in the video.


- Clean video, on the other hand, has less random variation and is more predictable. It compresses better because the encoder can more efficiently predict and represent the video content without losing significant detail, even at higher compression levels.



3. Impact of GPU Not Supporting B-Frames in CQP Encoding:


- B-frames (bi-directional frames) are an efficient type of video frame that can reference both previous and future frames for data. They are used to improve compression efficiency.


- If a GPU doesn't support B-frames and only supports I-frames (intra-coded frames) and P-frames (predictive frames), the efficiency of the compression might be reduced. This is because the encoder can't use the more advanced prediction techniques that B-frames allow.


- In CQP encoding, this might mean that to maintain the same level of perceived quality, the file sizes could be larger compared to a scenario where B-frames are used. The impact on quality and file size will vary depending on the content of the video and the specific encoding settings used.


In summary, CQP encoding is about maintaining consistent quality, which can be more challenging with grainy footage due to its inherent complexity. The lack of B-frame support in a GPU can lead to less efficient compression, potentially resulting in larger file sizes for the same quality level.
 
Tectpro I am trying to upscale a DVD I ripped to MKV. It is 720x480 in 4:3. Is there a way to make it 16:9 and full screen??? When I tried, it made it 2880x2160 but still 4:3 with black bars all the way around it. Is there a way to make it full screen in 16:9 and still make it high resolution????
 
If you do not want the picture to be anamorphic (squished to fit the 16:9 aspect ratio) you need to add black bars left and right (padding)
 
If you do not want the picture to be anamorphic (squished to fit the 16:9 aspect ratio) you need to add black bars left and right
But I have bars on top and bottom to. I cropped the original file and made it 1280x720 but it doesn't look squished.
 
Last edited:
Ahhh, now I get the picture, sorry, I did not read correctly.
Then you need to crop the original video, removing the black bars on top and bottom. Hopefully then you get to 16:9 Format. I don't know if there is an easy way with commandline Tools, better wait for Tectpro
 
Tectpro I am trying to upscale a DVD I ripped to MKV. It is 720x480 in 4:3. Is there a way to make it 16:9 and full screen??? When I tried, it made it 2880x2160 but still 4:3 with black bars all the way around it. Is there a way to make it full screen in 16:9 and still make it high resolution????
Generally speaking, upscaling DVD content using NVENC is achievable. However, the process can be more intricate compared to handling progressive video.

Given the resolution details, it appears that this is an NTSC DVD.

There are several important factors to take into account. One key question is whether the DVD material is interlaced or has undergone telecine processing. To determine this, I typically recommend utilizing dgmpgdec, which is available at the following link:
Code:
 https://www.rationalqm.us/dgmpgdec/dgmpgdec.html
Several additional steps are necessary to effectively upscale DVD material, mainly when dealing with interlaced content.

Firstly, it's crucial to address the interlacing issue. For this, you can modify the option file to include specific lines:

  1. --interlace auto: This option automatically detects whether the material is Top Field First (TFF) or Bottom Field First (BFF).
  2. --vpp-deinterlace: This activates the hardware deinterlacer. The settings available are:
    • none: No deinterlacing (default).
    • normal: Standard conversion from 60i to 30p, canceling interleave.
    • adaptive: Similar to normal.
    • bob: Converts 60i to 60p by interleaving.
Alternatively, you can use --vpp-afs instead of --vpp-deinterlace.
This option has presets like default, triple, double, anime, cinema, min_afterimg, 24fps, and 30fps.
For instance, --vpp-afs preset=cinema can be used for cinema-like material. More details can be found here:
Code:
 https://github.com/rigaya/NVEnc/blob/master/NVEncC_Options.en.md#--vpp-afs-param1value1param2value2

Regarding the removal of black bars, this process is not straightforward. To eliminate them, you need to know the exact height of each bar in pixels. This can be done manually, as I usually prefer since automatic detection tools are not always reliable. The command for this would be --crop <left>,<top>,<right>,<bottom>, for example, --crop 0,50,0,50 to crop 50 pixels from the top and bottom.

Lastly, when upscaling DVD content to 4K resolution (3840x2160 pixels), remember that this involves a significant increase from the original 480p resolution to 2160p.
Such a substantial upscale requires generating many new pixel data, sometimes resulting in a less sharp or somewhat artificial-looking image. It's a delicate balance to maintain the integrity of the original while enhancing its resolution.
 
Generally speaking, upscaling DVD content using NVENC is achievable. However, the process can be more intricate compared to handling progressive video.

Given the resolution details, it appears that this is an NTSC DVD.

There are several important factors to take into account. One key question is whether the DVD material is interlaced or has undergone telecine processing. To determine this, I typically recommend utilizing dgmpgdec, which is available at the following link:
Code:
https://www.rationalqm.us/dgmpgdec/dgmpgdec.html
Several additional steps are necessary to effectively upscale DVD material, mainly when dealing with interlaced content.

Firstly, it's crucial to address the interlacing issue. For this, you can modify the option file to include specific lines:

  1. --interlace auto: This option automatically detects whether the material is Top Field First (TFF) or Bottom Field First (BFF).
  2. --vpp-deinterlace: This activates the hardware deinterlacer. The settings available are:
    • none: No deinterlacing (default).
    • normal: Standard conversion from 60i to 30p, canceling interleave.
    • adaptive: Similar to normal.
    • bob: Converts 60i to 60p by interleaving.
Alternatively, you can use --vpp-afs instead of --vpp-deinterlace.
This option has presets like default, triple, double, anime, cinema, min_afterimg, 24fps, and 30fps.
For instance, --vpp-afs preset=cinema can be used for cinema-like material. More details can be found here:
Code:
https://github.com/rigaya/NVEnc/blob/master/NVEncC_Options.en.md#--vpp-afs-param1value1param2value2

Regarding the removal of black bars, this process is not straightforward. To eliminate them, you need to know the exact height of each bar in pixels. This can be done manually, as I usually prefer since automatic detection tools are not always reliable. The command for this would be --crop <left>,<top>,<right>,<bottom>, for example, --crop 0,50,0,50 to crop 50 pixels from the top and bottom.

Lastly, when upscaling DVD content to 4K resolution (3840x2160 pixels), remember that this involves a significant increase from the original 480p resolution to 2160p.
Such a substantial upscale requires generating many new pixel data, sometimes resulting in a less sharp or somewhat artificial-looking image. It's a delicate balance to maintain the integrity of the original while enhancing its resolution.
Here is what I did. It is a old DVD concert called "Rust Never Sleeps" that you can not buy in Blu Ray; they were supposed to release it on Blu Ray but still haven't. It also was in 3D, people in the audience are wearing 3D glasses so that makes it worse.( 1) First I ripped it to MKV with MakeMKV (2) Then I used mkvtoolnix to extract the audio. (3) Then I used a program called Uniconverter to crop it and convert just the video to 1280x720. (4) then I used mkvtoolnix to mux the video and audio back together. (5) then I used NVenc to upscale it. Considering how bad the original looks on a 4K tv screen I use for a monitor it looks pretty good. It has 3 different audios on it including Digital Theater Systems (DTS). It is still blurry in parts of the video though.
 

Attachments

  • Rust Never Sleeps.jpg
    Rust Never Sleeps.jpg
    136.4 KB · Views: 4
  • Rust Never Sleeps 2.jpg
    Rust Never Sleeps 2.jpg
    95.8 KB · Views: 4
  • vlcsnap-2023-12-20-12h05m58s189.png
    vlcsnap-2023-12-20-12h05m58s189.png
    1,014.3 KB · Views: 4
  • vlcsnap-2023-12-20-12h06m18s909.png
    vlcsnap-2023-12-20-12h06m18s909.png
    470.1 KB · Views: 4
  • vlcsnap-2023-12-20-12h08m57s557.png
    vlcsnap-2023-12-20-12h08m57s557.png
    1.1 MB · Views: 4
  • vlcsnap-2023-12-20-12h12m32s440.png
    vlcsnap-2023-12-20-12h12m32s440.png
    778.6 KB · Views: 4
  • vlcsnap-2023-12-20-12h14m21s940.png
    vlcsnap-2023-12-20-12h14m21s940.png
    1.2 MB · Views: 4
  • vlcsnap-2023-12-20-12h15m03s978.png
    vlcsnap-2023-12-20-12h15m03s978.png
    1.2 MB · Views: 5
  • vlcsnap-2023-12-20-12h15m30s854.png
    vlcsnap-2023-12-20-12h15m30s854.png
    1 MB · Views: 5
  • vlcsnap-2023-12-20-12h17m22s544.png
    vlcsnap-2023-12-20-12h17m22s544.png
    1.1 MB · Views: 5
  • Rust Never Sleeps 3.jpg
    Rust Never Sleeps 3.jpg
    137.1 KB · Views: 5
Do you happen to have a short sample video of this?
The original that has not been processed? A few seconds like 10 maybe should be enough to have a look.
 
Do you happen to have a short sample video of this?
The original that has not been processed? A few seconds like 10 maybe should be enough to have a look.
A clip of the original Dvd , the rip with make MKV or right before I ran it through NVenc??
 
Back
Top