after a lot of googling and after I've read tons of forums, I'm still not able to do a live stream using my cam to another device. My system is made up by a server ( a windows laptop ), that capture the scene and stream the acquired video, untill now I tried to use ffmpeg, MP4Box and DashCast obviously without results, and by a client ( some device ) that should be able to read the video flow by using a simple html5 page equipped with dash.js.
At the very beginning, in order to understand how dash works, I tried to stream some "static" video and all work perfectly thanks to this tutorial. The issues arise when I tried to stream live video and I followed this tutorial, because ffmpeg failed when it was trying to create .mpd file, but it can be divide in two sub-problem:
When I try to handle audio and video together the system say that audio channel doesn't contain any stream. Following I list the inserted command:
ffmpeg -f dshow -i video="USB2.0 VGA UVC WebCam":audio="Microfono / (Realtek High Definition Audio)" -map 0:0 -pix_fmt yuv420p / -c:v libvpx -b:v 3000k -keyint_min 30 -g 30 -speed 6 / -tile-columns 4 -frame-parallel 1 -threads 8 -static-thresh 0 / -max-intra-rate 300 -deadline realtime -lag-in-frames 0 / -error-resilient 1 -f webm_chunk -header live.hdr / -chunk_start_index 1 live_%d.chk -map 0:1 -c:a libvorbis -b:a 128k / -ar 44100 -f webm_chunk -audio_chunk_duration 2000 -header / live_audio.hdr -chunk_start_index 1 live_audio_%d.chk
The above rows call audio and video hardware and save the multimedia streams in chunks.
ffmpeg -f webm_dash_manifest -live 1 -i live.hdr -f webm_dash_manifest / -live 1 live_audio.hdr -c copy -map 0 -map 1 -f webm_dash_manifest / -live 1 -adaptation_sets "id=0,streams=0 id=1,streams=1" / -chunk_start_index 1 -chunk_duration_ms 2000 / -time_shift_buffer_depth 7200 -minimum_update_period 7200 manifest.mpd
This last command failed to attach audio stream in the .mpd file and in console appeared "Output file #0 does not contain any stream" as error.
So I try only with video using essentially the same options, but when I tried to create the manifest an error of this type "Could not write header for output file #0 (incorrect codec parameters ?): Invalid data found when processing input" arise, so I'm curious to know what kind of parameters are wrong.
At this point I change completely my strategy, so I create a fragmeted version of the live stream and I tried to use MP4Box to create .mpd file, but seem that MP4Box works only with finite time video, or at least I can't to use it in live.
And finally I used Dashcast and I able to see some frame from my client page, but simply it doesn't work. The last command I inserted is the following:
DashCast -vf dshow -vfr 15 -v video="USB2.0 VGA UVC WebCam" /
-live -seg-dur 500 -frag-dur 100 -time-shift 10
Actually I played a little with the parameters etc... but the result is still the same, simply I not able to see my face in the browser. In this case the error is "real-time buffer 101% full! frame dropped!" or "real-time buffer 80% full! frame dropped!".
So my question is what's wrong with my FFmpeg commands?
How I can use MP4Box for live purpose( with examples because I don't find a sigle example in the whole net)?
And finally, why DashCast is so slow?
Obviously every suggestions about alternative methods to perform a live stream with some other tool are accepted.