Y = a * R + b * G + c * B
Cb = (B - Y) / d
Cr = (R - Y) / e
BT.601 | BT.709 | BT.2020 | |
---|---|---|---|
a | 0.299 | 0.2126 | 0.2627 |
b | 0.587 | 0.7152 | 0.6780 |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>videojs-contrib-hls embed</title> | |
<link href="https://vjs.zencdn.net/8.0.4/video-js.css" rel="stylesheet"> | |
<script src="https://vjs.zencdn.net/8.0.4/video.min.js"></script> | |
<script src="https://unpkg.com/@videojs/[email protected]/dist/videojs-http-streaming.min.js"></script> |
#Display Custom Message on STMPE Bars and Server's Local Time | |
ffmpeg -re -f lavfi -i "smptehdbars=rate=30:size=1920x1080" \ | |
-f lavfi -i "sine=frequency=1000:sample_rate=48000" \ | |
-vf drawtext="text='YOUR MESSAGE %{localtime\:%X}':rate=30:x=(w-tw)/2:y=(h-lh)/2:fontsize=48:fontcolor=white:box=1:boxcolor=black" \ | |
-f flv -c:v h264 -profile:v baseline -pix_fmt yuv420p -preset ultrafast -tune zerolatency -crf 28 -g 60 -c:a aac \ | |
"rtmp://your_server_address/stream_key" | |
#Display Custom Message on STMPE Bars and Time (HH:MM:MS) | |
'use static' | |
// noinspection JSUnusedLocalSymbols,JSUnusedGlobalSymbols | |
/** | |
* Tools for handling H.264 bitstream issues. | |
*/ | |
/** | |
* Handle the parsing and creation of "avcC" atoms. | |
*/ |
Y = a * R + b * G + c * B
Cb = (B - Y) / d
Cr = (R - Y) / e
BT.601 | BT.709 | BT.2020 | |
---|---|---|---|
a | 0.299 | 0.2126 | 0.2627 |
b | 0.587 | 0.7152 | 0.6780 |
/** | |
* Convert a hex color string to RGB array | |
* @param {String} hex Hex color string | |
*/ | |
function hexToRgb(hex) { | |
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); | |
return result ? [ | |
parseInt(result[1], 16), | |
parseInt(result[2], 16), | |
parseInt(result[3], 16) |
licence: mit |
AnnexB format:
([start code] NALU) | ( [start code] NALU) |
AVCC format:
([extradata]) | ([length] NALU) | ([length] NALU) |
package com.priologic.easyrtcMedia; | |
import android.opengl.GLES11Ext; | |
import android.opengl.GLES20; | |
import java.nio.ByteBuffer; | |
import java.nio.FloatBuffer; | |
import org.webrtc.*; | |
/** | |
* Class for converting OES textures RGBA. It should be constructed on a thread with | |
* an active EGL context, and only be used from that thread. It is used by the EasyrtcSingleFrameCapturer. |
const WIDTH = 176 | |
const HEIGHT = 144 | |
const progRGB = yuv420ProgPlanarToRgb(base64ToArrayBuffer(yuv420ProgPlanarImage()), WIDTH, HEIGHT) | |
const canvas = document.createElement("canvas") | |
document.body.appendChild(canvas) | |
const ctx = canvas.getContext("2d") | |
const imageData = ctx.createImageData(WIDTH, HEIGHT) | |
putRGBToRGBA(imageData.data, progRGB, WIDTH, HEIGHT) | |
ctx.putImageData(imageData, 0, 0) |