A practical FFmpeg stream copy guide for live restreaming, recording, RTMP relay, OBS workflows, and TikTok/Douyin live stream URLs.

FFmpeg Stream Copy: Restream Live Video Without Re-Encoding

title: "FFmpeg Stream Copy: Restream Live Video Without Re-Encoding" published: false tags: ffmpeg, livestreaming, obs, video canonical_url:

Most live-streaming workflows re-encode more often than they need to. If the source codec is already accepted by the destination, FFmpeg can usually move packets directly with stream copy.

That matters because re-encoding adds CPU load, quality loss, and latency. Stream copy is closer to a relay: read the source, repackage if needed, and send the same encoded audio/video packets onward.

Re-Encode vs Stream Copy

# Re-encode: decodes and encodes every frame
ffmpeg -i input.flv -c:v libx264 -preset fast -b:v 6000k -c:a aac output.flv

# Stream copy: repackages without decoding/encoding
ffmpeg -i input.flv -c:v copy -c:a copy output.flv

For a typical 1080p60 live source, stream copy is usually the difference between one small VPS handling multiple relays and one stream saturating a CPU core.

Live Restream Example

ffmpeg -re -i "https://example.com/live/source.flv" \
  -c:v copy -c:a copy \
  -f flv rtmp://a.rtmp.youtube.com/live2/YOUR_KEY

The `-re` flag reads the input at native rate instead of as fast as possible. For live relays, that prevents the output from bursting data into the destination.

When Stream Copy Works

- Restreaming one live source to another platform

- Recording a live stream without quality loss

- Splitting one source into multiple outputs

- Converting containers, for example HLS to RTMP or FLV to MPEG-TS

When It Does Not Work

- Changing resolution

- Adding overlays or watermarks

- Changing codec, for example H.264 to H.265

- Mixing multiple streams

- Applying video or audio filters

Those operations require decoding, so re-encoding becomes unavoidable.

Useful Recipes

One Input To Multiple Outputs

ffmpeg -re -i input.flv \
  -c:v copy -c:a copy -f flv rtmp://youtube.example/live/key1 \
  -c:v copy -c:a copy -f flv rtmp://twitch.example/app/key2

HLS To RTMP

ffmpeg -re -i "https://example.com/live/stream.m3u8" \
  -c:v copy -c:a copy \
  -f flv rtmp://output-server/live/stream

Record While Relaying

ffmpeg -re -i input.flv \
  -c:v copy -c:a copy -f flv rtmp://output/live \
  -c:v copy -c:a copy -f segment -segment_time 3600 \
  -strftime 1 "/archive/stream_%Y%m%d_%H%M%S.flv"

Common Pitfalls

If the destination rejects the stream, check the codec and container first. YouTube generally expects H.264 video and AAC audio for RTMP. If only audio is incompatible, copy video and transcode audio:

ffmpeg -re -i input.flv \
  -c:v copy -c:a aac -b:a 128k \
  -f flv rtmp://output/live/key

If timestamps are broken, try regenerating them:

ffmpeg -fflags +genpts -re -i input.flv \
  -c:v copy -c:a copy \
  -f flv rtmp://output/live/key

TikTok/Douyin Live Workflows

I maintain a free TikTok/Douyin Live stream URL extractor at:

https://tkai.asia/?utm_source=devto&utm_medium=organic&utm_campaign=free_channel_geo&utm_content=ffmpeg-guide&utm_term=stream-copy

It is intended for OBS, FFmpeg, recording, and relay workflows. Use it only for streams you own or have permission to process.