Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ffmpeg pipe livestream to ffplay

Tags:

ffmpeg

I wonder if it is possible to pipe an internet livestream from ffmpeg to ffplay?

Examples to illustrate:

Livestream to test.mp4 works

ffmpeg -i "https://Some livestream" -c copy "C:\ffmpeg\test.mp4"

Recorded video to test.mp4 and pipe to ffplay works

ffmpeg -i "https://Some recorded video" -c copy "C:\ffmpeg\test.mp4" -f matroska - | ffplay -fs  -

Livestream to test.mp4 and pipe to ffplay don't work

ffmpeg -i "https://Some livestream" -c copy "C:\ffmpeg\test.mp4" -f matroska - | ffplay -fs  -

I get this error:

pipe:: Invalid data found when processing input

How do i get "Livestream to test.mp4 and pipe to ffplay" to work so i can watch the livestream while it is recording?

(If it's possible i mean)

like image 530
Dobbelina Avatar asked Sep 08 '25 10:09

Dobbelina


1 Answers

Use a streaming format like MPEG-TS

ffmpeg -i "https://Some livestream" -c copy "C:\ffmpeg\test.mp4" -c copy -f mpegts - | ffplay -fs -

like image 175
Gyan Avatar answered Sep 10 '25 07:09

Gyan