Reputation: 63
I am trying to build a web app (using Primefaces) that streams real time video on an html page. The video is captured using an HDMI to IP encoder(TBS2603), that outputs the stream to HTTP. The video is show on the page using:
<embed type="application/x-vlc-plugin" name="video" autoplay="yes" width="1024" height="768" target="http://myip:8080/hdmi" />
BUT the video is not show on the page using <video>
tag. As I want to stream on mobile devices and I need to use <video>
stream. Therefore I have to transcode the stream using ffmpeg (not ffserver - as it will be deprecated on future releases), and publishing it on Tomcat on another context allowing listing.
I am creating 3 streams on 3 files (ogg/mp4/webm)
MP4
ffmpeg -i http://ip:8080/hdmi -vcodec libx264 -b:v 8192k -f segment -segment_time 4 -segment_list_size 0 -segment_list test.m3u8 -segment_format mpegts stream%05d.ts
OGG
ffmpeg -i http://ip:8080/hdmi -acodec vorbis -vcodec libtheora test.ogg
WEBM
ffmpeg -i http://ip:8080/hdmi -vcodec libvpx -acodec libvorbis test.webm
The streams are loaded on jsf:
<video width="640" height="480" controls="controls">
<source src="#{testBean.video1}" type="video/mp4"/>
<source src="#{testBean.video2}" type="video/ogg" />
<source src="#{testBean.video3}" type="video/webm" />
Your browser does not support the video tag.
</video>
In this manner I get the output from the encoded files - how can I get the real time stream from the encoder?
Upvotes: 3
Views: 4561
Reputation: 63
I managed to fix the HLS, using the appropriate ffmpeg command:
ffmpeg -y -i http://ip:8080/hdmi -codec copy -map 0 -f segment -segment_time 10 -segment_format mpegts -segment_list_flags +live -segment_list test.m3u8 -segment_list_type m3u8 stream%05d.ts
My question still remains for fixing the ogg & webm.
Upvotes: 1