Menu

One live event, two recordings: stitching dropped streams with FFmpeg, and when to stop
πŸ“°

One live event, two recordings: stitching dropped streams with FFmpeg, and when to stop

DEV Community: apiΒ·Mason KΒ·about 9 hours ago
#jjtFwEEJ
#devtoapi#devto#dev#ffmpeg#streaming
Reading 0:00
15s threshold

πŸ“¦ Code: github.com/USER/live-gap-stitch (replace before publishing)

TL;DR

A brief disconnect during a live event leaves you with two recordings and a gap that no file admits to. We'll join the pieces with FFmpeg's concat demuxer, insert a labelled gap card so the jump cut isn't a lie, and then look at what changes when the platform handles reconnects for you. Needs FFmpeg 6+ and bash.

🎯 What happened

Host's laptop switches wifi mid-event. The encoder loses the ingest connection. The host reconnects and carries on. Server side, the disconnect looked like "broadcaster hung up", so the recorder closed one file and opened another. Now your "recording" is two files and the viewers saw a stalled player.

We'll fix the artifact first (the recording), then talk about the cause (session identity).

1. Reproduce it with two test segments πŸ› οΈ

No live encoder needed.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.