Skip to content

Instantly share code, notes, and snippets.

View DipandaAser's full-sized avatar
😁
Compile...

Dipanda Aser DipandaAser

😁
Compile...
View GitHub Profile
@s4y
s4y / capture_hls.md
Last active July 23, 2024 22:02
Capture an HLS stream from the beginning with ffmpeg
ffmpeg -live_start_index -99999 -i 'https://….m3u8' -c copy something.ts

Direct copy of pre-encoded file:

$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8

@xlab
xlab / bytes_split.go
Last active April 4, 2022 17:21
Golang split byte slice in chunks sized by limit
func split(buf []byte, lim int) [][]byte {
var chunk []byte
chunks := make([][]byte, 0, len(buf)/lim+1)
for len(buf) >= lim {
chunk, buf = buf[:lim], buf[lim:]
chunks = append(chunks, chunk)
}
if len(buf) > 0 {
chunks = append(chunks, buf[:len(buf)])
}
@sighmin
sighmin / Go multiple http handlers example
Created April 14, 2015 06:25
Go multiple http handlers example
package main
import (
"fmt"
"log"
"net/http"
)
type String string
type Struct struct {
@lukehedger
lukehedger / ffmpeg-compress-mp4
Last active July 16, 2026 05:18
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4