First time poster here, so go easy on me.
I'm working on a fun little project for myself and friends, basically I want to be able to stream and recieve video using ffmpeg, as a sort of screen sharing application. I'm a complete python noob and im just going off of the documentation for each.
Heres what I have for sending:
import ffmpeg
stream = ffmpeg.input("video.mp4")
stream = ffmpeg.output(stream, "tcp://127.0.0.1:1234", format="mpegts")
ffmpeg.run(stream)
It's simple but it works, when I run ffplay.exe -i tcp://127.0.0.1:1234?listen -hide_banner
in a command prompt and run the code to send the video, it works perfectly, but when I try and use my code to recieve a video, all I get is audio, no video, and after the video has finished the last second of the audio is repeated.
Heres the recieving code:
from ffpyplayer.player import MediaPlayer
test = MediaPlayer("tcp://127.0.0.1:1234?listen")
while True:
test.get_frame()
if test == "eof":
break
Thanks for any help and sorry if im just being oblivious to something :P
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…