send-h264

command
v1.8.26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

send-h264

send-h264 shows how to packetize H264 and send across the network via RTP

Instructions

Create H264 Annex-B file named output.h264
ffmpeg -f lavfi -i testsrc=duration=30:size=1280x720:rate=30 -c:v libx264 -bsf:v h264_mp4toannexb -b:v 2M -max_delay 0 -bf 0 -pix_fmt yuv420p output.h264
Run send-h264

Make sure your output.h264 is in the send-h264 directory. Then run the example.

go run .

This results in output like

Received seq_num 31478 from 127.0.0.1:61169
Received seq_num 31479 from 127.0.0.1:61169
Received seq_num 31480 from 127.0.0.1:61169
Received seq_num 31481 from 127.0.0.1:61169
Received seq_num 31482 from 127.0.0.1:61169
Received seq_num 31483 from 127.0.0.1:61169

The receiver will print metadata about the RTP packets. We send a RTP packet every 100 milliseconds, this is an arbitrary time. A real application would pace them correctly.

Documentation

Overview

send-h264 demonstrates how to send and receieve RTP packets over the network.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL