A while ago I had to create web app providing simple interface to start youtube video streams from network devices (linux notebook descktop screens, webcams, network cameras) in several auditoriums. At that moment I couldn't find any application could fit my needs.
For work with audio and video stream I used ffmpeg library. For web interface and I used python Flask microframework and wsgi. To start and stop translations I used Bash scripts.
For now this application can successfully start and stop streams from:
- Network cameras
- Linux desktop screens
- Webcams on linux
After some time I found that network cameras provide distorted sound. I solved this problem by getting sound from router(TP-Link 1043nd) and usb audio card. I used pulseaudio to get sound from router and send it to server. Ffmpeg combine audio and video streams to provide stream for youtube.
I spend some time debugging unstable sound noise from router. In the end I found that while using usb cards there should be set big buffer by setting default-fragment-size-msec to some big value. In my case 1024 was sufficient to get stable pure sound.
Source codes are available on Github https://github.com/litvinovg/videoapp