ffmpeg将直播流传输到ffplay

时间:2019-09-17 08:58:38

标签: ffmpeg

我想知道是否可以将ffmpeg的互联网直播流传输到ffplay吗?

示例说明:

test.mp4的直播工作

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

将视频录制到test.mp4并通过管道传输到ffplay作品

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

用于test.mp4的直播流和用于ffplay的管道不起作用

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

我收到此错误:

  

pipe ::处理输入时发现无效数据

我如何使“ Livestream到test.mp4并通过管道传输到ffplay”工作,以便我可以观看直播 在录音的时候?

(如果可能,我是说)

2 个答案:

答案 0 :(得分:0)

使用MPEG-TS之类的流格式

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

答案 1 :(得分:0)

以下代码让 ffplay 侦听本地主机端口 7000。 ffmpeg 将网络摄像头视图和麦克风音频发送到该端口。 因此,您可以获得网络摄像头的某种监控视图。延迟现在约为一秒。任何人都知道一种使其实时化的方法吗?

我一直梦想使用这些脚本进行视频通话。

start "%windowtitle%" /high ^
ffplay.exe -window_title "%windowtitle%" ^
-f rtsp ^
-rtsp_transport tcp ^
-rtsp_flags listen ^
-indexmem 250M ^
-rtbufsize 1G ^
-probesize 150k ^
-strict strict ^
-i rtsp://localhost:7000


start "%windowtitle%" /high /wait /b ^
ffmpeg.exe -y ^
-vsync vfr ^
-f dshow ^
-indexmem 300M ^
-rtbufsize 1G ^
-probesize 150k ^
-max_probe_packets 50k ^
-framerate 15 ^
-c:v mjpeg ^
-strict normal ^
-thread_queue_size 50k ^
-r 15 ^
-i "video=Trust Webcam" ^
-f dshow ^
-channel_layout stereo ^
-thread_queue_size 50k ^
-strict normal ^
-i "audio=Microfoon (Thronmax MDrill Dome)" ^
-map 0:v ^
-max_muxing_queue_size 50k ^
-f rtsp ^
-rtsp_transport tcp ^
-buffer_size 50M ^
-max_interleave_delta 0 ^
-c:v libx264 ^
-r 15 ^
-preset ultrafast ^
-tune zerolatency ^
-strict strict ^
-crf 28 ^
-pix_fmt yuv422p ^
-map 1:a ^
-max_muxing_queue_size 50k ^
-max_interleave_delta 0 ^
-c:a aac ^
-strict strict ^
-ac 2 ^
rtsp://localhost:7000