Skip to content

Instantly share code, notes, and snippets.

View XueshiQiao's full-sized avatar
🕶️
WebRTC

xueshi XueshiQiao

🕶️
WebRTC
View GitHub Profile
From 88287f270df660645b3f6c813ab3fd7ad522e64c Mon Sep 17 00:00:00 2001
From: KSC-VBU-SR <[email protected]>
Date: Wed, 14 Jun 2017 21:33:54 +0800
Subject: [PATCH] The RTMP protocol extensions for H.265/HEVC
---
libavformat/flv.h | 1 +
libavformat/flvdec.c | 16 +++++++++++++---
libavformat/flvenc.c | 29 ++++++++++++++++++++---------
3 files changed, 34 insertions(+), 12 deletions(-)
@XueshiQiao
XueshiQiao / transcode_live_stream.md
Last active May 23, 2018 12:21
拉流+转码+转推一路直播流到另外一个地址
ffmpeg -re -i "源流地址" -vcodec libx264 -acodec copy -vf scale=360:640 -b:v 1.5M -f flv "目标流地址"
  • -re 表示按帧率发送(保持视频按照时间戳发送,否则视频文件将很快传输完毕)  ref:https://trac.ffmpeg.org/wiki/StreamingGuide ref:https://blog.csdn.net/youhongaa/article/details/55004547
  • -i 指定输入源
  • -vcodec libx264 指定编解码器,即便一样这里也不能使用copy,因为下面有 -vf 改变分辨率以及 -b:v 改变码率,都决定了需要重新解码再编码,所以需要指定编解码器
  • -vf scale=360:640 修改分辨率为 360*640 (宽 * 高)
@XueshiQiao
XueshiQiao / local_http_server.md
Last active May 23, 2018 12:21
Create a simple local http server on Mac OS

In terminal, navigate to the directory you want to run and type the following command:

python -m SimpleHTTPServer 8000

The 8000 is the port, it could be any open port like 3000, 4567, 8000

@XueshiQiao
XueshiQiao / h264format.md
Last active February 5, 2025 06:22
H.264 Annex B format and AVCC format

AnnexB format:

([start code] NALU) | ( [start code] NALU) |

AVCC format:

([extradata]) | ([length] NALU) | ([length] NALU) |
@XueshiQiao
XueshiQiao / AVCDecoderConfigurationRecord.md
Created May 22, 2017 13:09 — forked from uupaa/AVCDecoderConfigurationRecord.md
parse AVCDecoderConfigurationRecord example

以下は、AVCDecoderConfigurationRecord のバイトデータです。

ADDR    0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
------ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
000000 00 00 00 2e 61 76 63 43 01 42 c0 1e ff e1 00 16
000010 67 42 c0 1e d9 02 04 68 40 00 00 03 01 40 00 00
000020 03 00 83 c5 8b 92 01 00 05 68 cb 83 cb 20
@XueshiQiao
XueshiQiao / git_reset2head_recursive
Created March 4, 2016 11:54 — forked from codeswimmer/git_reset2head_recursive
git: recursively reset a git submodule hierarchy to HEAD
git submodule foreach git submodule init && git submodule update --recursive
@XueshiQiao
XueshiQiao / surge.conf
Created February 17, 2016 03:46 — forked from soffchen/surge.conf
surge.conf
[General]
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local
bypass-tun = 0.0.0.0/8, 1.0.0.0/9, 1.160.0.0/11, 1.192.0.0/11, 10.0.0.0/8, 14.0.0.0/11, 14.96.0.0/11, 14.128.0.0/11, 14.192.0.0/11, 27.0.0.0/10, 27.96.0.0/11, 27.128.0.0/9, 36.0.0.0/10, 36.96.0.0/11, 36.128.0.0/9, 39.0.0.0/11, 39.64.0.0/10, 39.128.0.0/10, 42.0.0.0/8, 43.224.0.0/11, 45.64.0.0/10, 47.64.0.0/10, 49.0.0.0/9, 49.128.0.0/11, 49.192.0.0/10, 54.192.0.0/11, 58.0.0.0/9, 58.128.0.0/11, 58.192.0.0/10, 59.32.0.0/11, 59.64.0.0/10, 59.128.0.0/9, 60.0.0.0/10, 60.160.0.0/11, 60.192.0.0/10, 61.0.0.0/10, 61.64.0.0/11, 61.128.0.0/10, 61.224.0.0/11, 100.64.0.0/10, 101.0.0.0/9, 101.128.0.0/11, 101.192.0.0/10, 103.0.0.0/10, 103.192.0.0/10, 106.0.0.0/9, 106.224.0.0/11, 110.0.0.0/7, 112.0.0.0/9, 112.128.0.0/11, 112.192.0.0/10, 113.0.0.0/9, 113.128.0.0/11, 113.192.0.0/10, 114.0.0.0/9, 114.128.0.0/11, 114.192.0.0/10, 115.0.0.0/8, 116.0.0.0/8, 117.0.0.0/9, 117.128.0.0/10, 118.0.0.0/11, 118.64.0.0/10, 118.128.0.0/9, 119.0.
@XueshiQiao
XueshiQiao / Tweak.xm
Created February 16, 2016 07:31 — forked from goodbest/Tweak.xm
iOS 9 Enable Splitscreen Jailbreak Tweak (Theos)
/* How to Hook with Logos
Hooks are written with syntax similar to that of an Objective-C @implementation.
You don't need to #include <substrate.h>, it will be done automatically, as will
the generation of a class list and an automatic constructor.
%hook ClassName
// Hooking a class method
+ (id)sharedInstance {
@XueshiQiao
XueshiQiao / README.md
Created January 30, 2016 02:16 — forked from janlay/README.md
Yet another config for Surge.app

Install

  1. Modify index.txt with your output path and proxy info
  2. Use Text Builder to build configuration for Surge: $ text-builder -index /path/to/index.txt
  3. Import configuration via AirDrop/iTunes/Dropbox/iCloud

本人不提供任何保证和技术支持,使用者自负风险。
There are no guarantees, no any support. Use it at your own risk.

@XueshiQiao
XueshiQiao / mongo_backup.sh
Created January 17, 2016 04:12 — forked from sheharyarn/mongo_backup.sh
Mongodump Shell Script for Cronjob
#!/bin/bash
MONGO_DATABASE="your_db_name"
APP_NAME="your_app_name"
MONGO_HOST="127.0.0.1"
MONGO_PORT="27017"
TIMESTAMP=`date +%F-%H%M`
MONGODUMP_PATH="/usr/bin/mongodump"
BACKUPS_DIR="/home/username/backups/$APP_NAME"