Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Instructions for combining twitch vod+chat into single 1440p video, using ffmpeg and hardware acceleration.
- Example of how what it looks like: https://youtu.be/05THM5wwXMU
- 1) Get a custom ffmpeg with cuda modules and a launcher:
- https://drive.google.com/u/0/uc?id=19IIgUz8iyCj1j4i-IwbGxz-XjCPdo5eE&export=download
- OPTIONAL: In case you REALLY want to, the instructions for building ffmpeg yourself are at the end.
- 2) Download vod, render chat.
- Get TwitchDownloader: https://github.com/lay295/TwitchDownloader/releases
- Run TwitchDownloader.exe, download a VOD (.mp4) and it's chat (.json). Make sure they're of same length/duration.
- Render chat using following settings: https://imgur.com/a/BW21Nln
- 3) Combine vod+chat using custom ffmpeg. Have x4 disk space of original vod's size.
- Either use the launcher from step #1, or run ffmpeg manually (commands listed at the end as well).
- 4) Upload the 1440p video.
- It should get encoded in VP9 regardless of view count.
- You're good to go here.
- --------------------------------------------------------------------------
- OPTIONAL: Building a beefy ffmpeg for yourself.
- Necessary functionality requires proprietary modules, which is why distributed pre-built ffmpeg builds don't include them. We'll make them.
- Prerequisites:
- - CUDA Toolkit: https://developer.nvidia.com/Cuda-toolkit
- - Media-autobuild_suite: https://github.com/m-ab-s/media-autobuild_suite
- - Have at least 12 Gb available, the final build will be around 700 Mb. Building itself will take several hours.
- - With CUDA installed, run media-autobuild_suite.bat
- - Follow instructions, generally self explanatory. Important choices: select "non-free", select "yes, custom ffmpeg options".
- - If you get errors during "/making" of ffmpeg, visit ...\build\ffmpeg_options.txt and comment out sketchy modules.
- My options, for example: https://pastebin.com/zGhA8CJG
- Once building has finished (suite should autoclose itself), copy following files into your directory of choice:
- - All files from ...\media-autobuild_suite\local64\bin-video\
- - C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin\nppc64_11.dll
- - C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin\nppicc64_11.dll
- - C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin\nppidei64_11.dll
- - C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin\nppig64_11.dll
- Now that ffmpeg is ready, you can uninstall CUDA and remove all MAS files. The copied over files SHOULD get the job done.
- --------------------------------------------------------------------------
- OPTIONAL: Run ffmpeg manually (without launcher).
- Open CMD in ffmpeg's folder and run following command:
- ffmpeg.exe -hwaccel cuda -hwaccel_output_format cuda -vsync 1 -i Vod_864p.mp4
- -hwaccel cuda -hwaccel_output_format cuda -i Chat.mp4
- -c:a copy -map 0:a -c:v hevc_nvenc -preset p7 -tune hq -tier high
- -b:v 26M -minrate 24M -r 60 -refs:v 16 -rc-lookahead 32
- -temporal-aq 1 -i_qfactor 0.75 -b_qfactor 1.1
- -bf 3 -b_ref_mode middle -filter_complex "
- [0:v]scale_npp=2106:-1:interp_algo=cubic:format=yuv420p, setsar=1/1, hwdownload,
- pad=w=2560:h=1440:x=0:y=-1, hwupload_cuda, scale_npp=format=nv12[base];
- [1]scale_npp=format=nv12[overlay];
- [base][overlay]overlay_cuda=x=main_w-overlay_w:y=-1" Final_1440p.mp4
- --------------------------------------------------------------------------
- BONUS: Overlaying transparent chat over vod.
- 1. Generating chat+mask: https://youtu.be/D-_TD1-w3fY
- 2. FFmpeg instructions and gallery: https://imgur.com/a/F8yDN6v
Advertisement
Add Comment
Please, Sign In to add comment