| itag Code | Container | Content | Resolution | Bitrate | Range | VR / 3D |
|---|---|---|---|---|---|---|
| 5 | flv | audio/video | 240p | - | - | - |
| 6 | flv | audio/video | 270p | - | - | - |
| 17 | 3gp | audio/video | 144p | - | - | - |
| 18 | mp4 | audio/video | 360p | - | - | - |
| 22 | mp4 | audio/video | 720p | - | - | - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Compare two arrays and return a list of items only in array1 (deletions) and only in array2 (insertions) | |
| * | |
| * @param array $array1 The 'original' array, for comparison. Items that exist here only are considered to be deleted (deletions). | |
| * @param array $array2 The 'new' array. Items that exist here only are considered to be new items (insertions). | |
| * @param array $keysToCompare A list of array key names that should be used for comparison of arrays (ignore all other keys) | |
| * @return array[] array with keys 'insertions' and 'deletions' | |
| */ | |
| public static function arrayDifference(array $array1, array $array2, array $keysToCompare = null) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # ================================================================== | |
| # This script will compile and install a static ffmpeg build with | |
| # support for NVENC in Ubuntu. Developed in Ubuntu 22.04 LTS, | |
| # with NVIDIA Drivers v510.73 and CUDA v11.6 | |
| # It assumes NVIDA drivers are installed and that you have a | |
| # CUDA-compatible GPU. You can check installed drivers with: | |
| # $ apt list *nvidia-driver-* | grep installed | |
| # $ nvidia-smi | |
| # ================================================================== |
Streaming your Linux desktop to Youtube and Twitch via Nvidia's NVENC and VAAPI:
Considerations to take when live streaming:
The following best practice observations apply when using a hardware-based encoder for live streaming to any platform:
-
Set the buffer size (
-bufsize:v) equal to the target bitrate (-b:v). You want to ensure that you're encoding in CBR mode. -
Set up the encoders as shown:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ffmpeg -f video4linux2 -thread_queue_size 512 -input_format mjpeg -video_size hd720 -i /dev/video0 \ | |
| -f alsa -thread_queue_size 512 -i hw:1,0,0 \ | |
| -acodec mp3 -async 1 -vcodec libx264 -preset veryfast output.mp4 \ | |
| -acodec mp3 -ar 44100 -vcodec libx264 -preset ultrafast -maxrate 1984k -bufsize 3968k -g 60 -f flv rtmp://x.rtmp.youtube.com/live2/yourid |