Log in

View Full Version : Realtime 2-pass encoding - "GPUCPU 1+2pass"


zub35
20th September 2017, 14:59
https://i.imgur.com/3UcTOtV.png

full manual (russian) https://goodgame.ru/topic/102016/

Need:
nginx: https://github.com/illuspas/nginx-rtmp-win32/archive/nms.zip
ffmpeg: https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-latest-win64-static.7z
RAMDisk: http://memory.dataram.com/__downloads/memory/ramdisk/Dataram_RAMDisk_4_4_0_RC36.msi
start-2pass.bat v1.4: https://yadi.sk/d/8KvDnztR3N5Spk

nvenc (key-1s) -> nginx -> ffmpeg create segments (3s) - 1-2pass - ffmpeg add in ts file - stream flv(rtmp)

The problem is that some web players don't understand this picture.
https://i.imgur.com/pin7Qkp.png

1 pass no segments - good, 1 pass segments - good
2 pass no segments - good, 2 pass segments - bad :( (twitch and youtube - good)

How to properly glue the segments so that all web-players reproduce the picture without problems?

zub35
21st September 2017, 18:23
UPD script to v1.5 https://yadi.sk/d/MqqEoXHh3N7o4y
delete keyint option (auto = time segment), and made vbr-segments in cbr-stream for even better quality ;-)

https://i.imgur.com/oML3rqa.png

Smaller segment -- less quality and more CBR
1s segment = full CBR, quality = 1pass on the stream (useless mode)

Larger segment -- better quality and less CBR
10s segment = full VBR, quality = 2pass on the file (mode where CBR and waiting time is not important)

UPD v1.8 : https://yadi.sk/d/z_xeKEir3NBezX

zub35
26th September 2017, 03:33
UPD v2.0 https://yadi.sk/d/OUXVwcs73NDgQy
Added flag "stitchable" in script for correct build stream. Now, all web-players launch the video.
To start 1: RAMdisk (create disk), 2: nginx (start server), 3: This script, and wait for message, 4: Stream-capture (NVENC or other GPU-encode)

zub35
27th September 2017, 15:32
Two recipes of "happiness" ^_^"

1. Use segments of 2s or 3s, keyint is calculated relative to their length.
2. Use segments of 4s and manually calculated keyint=2*fps,
insert "-g <value>" in "settings="

In the second case the segment will be divided into 2 parts keyint intervals, allowing at the same time kept within acceptable norms, but also win with relative 2s and 3s segments with auto-keyint. But it's a little (2-3sec) will add delay to the existing 8-10sec delay, and increase vbr.

http://s018.radikal.ru/i516/1709/f2/d4064939f55b.png