Exchange data between ffmpeg and video player

有些话、适合烂在心里 提交于 2019-12-11 19:00:21

问题


I'm using ffmpeg as a proxy for playing RTSP streams in VLC (because it seems that VLC doesn't work too well with TCP-based RTSP streams). While in Linux I'm doing this by creating a FIFO file and using it as output for ffmpeg, in Windows I can't do this because os.mkfifo() doesn't work under this OS. So I have to find a way to start ffmpeg with subprocess.Popen() and sending it's converted data to VLC in real time (I'm using the VLC bindings for Python).

I tried to set ffmpeg's output to stdout (ffmpeg.exe -y -i rtsp://fms30.mediadirect.ro/live/utv/utv?tcp -acodec libmp3lame -ar 44100 -vodec copy -f flv -), catching that output and sending it to a SimpleHTTPServer class using sockets (well, I'm not sure that this approach was a good idea). I also tried by using pipes (with win32pipe.CreateNamedPipe) but I was still out of luck.

How I could do this? Or why VLC doesn't want to play this stream (rtsp://fms30.mediadirect.ro/live/utv/utv) while ffmpeg will can? This is the actual code used in Linux, which doesn't works on Windows: http://pastebin.com/vqX1Edwg

来源:https://stackoverflow.com/questions/9663772/exchange-data-between-ffmpeg-and-video-player

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!