2017년 8월 9일 수요일

Play http video stream in VideoPlayer component without waiting the end of download


I use MIT App Inventor 2 / Windows 7 / Chrome version Version 31.0.1650.63 m.
I'm trying to play http h264 video stream in VideoPlayer component. Ultimate goal : Remotely control from Android my raspberry pi robot mounted on RC car. (Gyro for direction / "Live" video stream from Raspicam.
1) Video is streamed from raspberry pi :
pi@raspy01 ~ $ raspivid -o - -t 0 -hf -w 320 -h 240 -fps 15|cvlc -vvv stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:8090}' :demux=h264
2) I try to play the video stream in my Android App :
Set VideoPlayer1.Source to "http://1192.168.1.25:8080"
call VideoPlayer1.Start
Result : My App stops responding until... the end of streaming ! In fact, if I stop the streaming process on the raspberry, I can play the previously downloaded stream part in the VideoPlayer component !
So, I think, I hope, that if there's a way to start the player before waiting the end of file download, it will be a success !

--
Ooopsss... correction :
2) I try to play the video stream in my Android App :
Set VideoPlayer1.Source to "http://1192.168.1.25:8090"
call VideoPlayer1.Start


--
Try this. Put the play command in a clock Timer block set to 0 ms and initially disabled.
Then when ready to play the stream, enable the timer.
The first block in the timer should be to disable the timer.
the second block should set the source, the third to start the player.
May or may not work, but something to try anyway.

--

댓글 없음:

댓글 쓰기