0
votes

I want to produce a Live audio/video stream from local file.

I tried the following:

ffmpeg -re -thread_queue_size 4 -i source_video_file.ts -strict -2 -vcodec copy -an -f rtp rtp://localhost:10000 -acodec copy -vn -sdp_file saved_sdp_file -f rtp rtp://localhost:20000

and then:

ffplay saved_sdp_file

It seems to work fine, but it looks like a Video on Demand, cause I can replay this file with ffplay whenever I want.

But I need ffplay to show video/audio only during ffmpeg streaming instance is running (the first command above).

How do I achieve this?

Thanks!

1

1 Answers

0
votes

This code works for live video streaming :

proc liveStreaming {} {

	
	#ffmpeg command to capture live streaming in background
	exec ffplay -f dshow -i video="Integrated Webcam" >& $logFile &
  
}
liveStreaming

Make use of fmmpeg using following code, this also works :

proc liveStreaming {} {

	
	#ffmpeg command to capture live streaming
	exec ffmpeg -f dshow -i video="Integrated Webcam" -f sdl2 -
  
}
liveStreaming

You can also make use of "sdl" if sdl2 doesn't work.