목차
비디오 스트리밍 프로토콜 종류
(참고) https://www.wowza.com/blog/streaming-protocols
HTTP 기반 ( HLS / DASH )
HLS ( HTTP Live Streaming )
MPEG-DASH ( Dynamic Adaptive Streaming over HTTP )
5~10초 분량의 짧은 비디오 파일을 연이어 다운로드 하면서 재생하는 방식
별도의 미디어 스트리머 서버 필요 X
웹서버에 조각조각난 비디오 파일들과, 이 파일의 목록을 기술한 메타데이터 파일( 재생목록 파일)을 올려두면 됨
각 비디오 파일을 각기 다른 해상도(품질)로 인코딩 하면
클라이언트는 망 상황에 따라 자신에게 맞는 수준의 비디오 조각을 다운로드 해서 재생
VOD, CDN 에 적합
(참고)
https://meetup.toast.com/posts/131
https://idlecomputer.tistory.com/93
https://developer.mozilla.org/en-US/docs/Web/Guide/Audio_and_video_delivery/Setting_up_adaptive_streaming_media_sources
HLS 구축
ffmpeg 으로 영상을 여러 조각으로 쪼개고 m3u8 재생목록 만들기
아파치 웹서버에 상기 파일 올리기
VLC 로 재생
https://www.bogotobogo.com/VideoStreaming/ffmpeg_http_live_streaming_hls.php
위와 동일하지만 다른 방법
https://blog.kyri0s.org/post/271121944/deploying-apples-http-live-streaming-in-a-gnu-linux
라이브 방송을 HLS 로 송출하려면 Encoder + Segmenter 필요
VOD 면 Segmenter 만 필요
YouTube 스트리밍 설명
What Actually Happens When You Watch A YouTube Video? - Youtube
https://www.netmanias.com/ko/post/blog/5819/google-http-adaptive-streaming-http-progressive-download-ott-video-streaming-youtube/youtube-switched-to-chunking-and-adaptive-streaming
VJ 가 Youtube 로 라이브 스트리밍을 하는 경우
VJ → Youtube : WebRTC
Youtube → 불특정 다수 : 유튜브 distribution 네트워크
https://webrtchacks.com/youtube-does-webrtc-heres-how/
WebRTC
WebRTC streaming of raspicam
https://www.raspberrypi.org/forums/viewtopic.php?t=186271
https://github.com/mpromonet/webrtc-streamer
리모트몬스터 방송 서버
WebRTC 기반
512MB 램, single core 1Ghz CPU 에서도 동작하는 초경량 서버
https://blog.remotemonster.com/리모트몬스터의-방송서버의-내부-구조-19551617f85f
https://www.rocketpunch.com/companies/remotemonster
ESP32 WebCam
아두이노 기반
WebCam 에서 비압축 이미지 받아서 JPG로 압축하고 HTML 5 캔버스에 10초마다 draw 하는게 가능함
https://hackaday.com/2019/02/02/cheap-esp32-webcam/
https://github.com/espressif/arduino-esp32/blob/master/libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp
https://github.com/espressif/esp32-camera/blob/master/conversions/to_jpg.cpp