Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Video Streaming: от идеи до нагруженной системы

Video Streaming: от идеи до нагруженной системы

Eugene Oskin

January 20, 2018
Tweet

More Decks by Eugene Oskin

Other Decks in Programming

Transcript

  1. Требования • Live видео с низкой задержкой • В штатном

    режиме 100 параллельных стримов • Горизонтальное масштабирование
  2. Требования • Live видео с низкой задержкой • В штатном

    режиме 100 параллельных стримов • Горизонтальное масштабирование • Основная платформа – iOS
  3. Что мы ожидали • Мы будем использовать 3rd party сервис

    для стриминга • Работать с HLS будет легко
  4. Что мы ожидали • Мы будем использовать 3rd party сервис

    для стриминга • Работать с HLS будет легко • На backend нужно будет реализовать REST API и клиент для 3rd party сервиса
  5. Поиск сервисов • DaCast – большая задержка • Wowza Streaming

    Cloud – большая задержка • Zencoder – большая задержка • LiveStream.com – большая задержка
  6. Какая проблема с Live HLS? • Адаптивный стриминг live видео

    • Стриминг видео с фиксированным bitrate
  7. Какую боль мы испытали • Отсутствует сервис, который нас устраивает

    • Live HLS • Отсутствует готовое руководство по созданию платформы для стриминга
  8. • DASH – HTTP-based • RTMP, RTSP – Real Time

    Protocol Что если не HLS?
  9. • DASH – HTTP-based • RTMP, RTSP – Real Time

    Protocol Что если не HLS?
  10. • Docker у разработчика и на AWS • Deploy в

    две команды • Запуск тестов в одну команду Deployment
  11. • Сложно воспроизводить bug’и руками • Сложно iOS разработчикам работать

    с нестабильным backend’ом • Страшно изменять архитектуру Flow разработки
  12. BDD

  13. BDD Feature: Sending feedback after watching a stream. Scenario: A

    user watches and shares the record. Given we have a Recorder user And we have a Viewer user When the Viewer asks the Publisher And the Recorder responds with a new stream And the Viewer gets “stream notification” and records Then the Recorder ends publishing in 25 seconds And the Viewer shares the stream And an Anonymous user opens the shared link and plays a video
  14. BDD Feature: Sending feedback after watching a stream. Scenario: A

    user watches and shares the record. Given we have a Recorder user And we have a Viewer user When the Viewer asks the Recorder And the Recorder responds with a new stream And the Viewer gets “stream notification” and plays the stream Then the Recorder ends publishing in 25 seconds And the Viewer shares the stream And an Anonymous user opens the shared link and plays a video
  15. BDD Feature: Sending feedback after watching a stream. Scenario: A

    user watches and shares the record. Given we have a Recorder user And we have a Viewer user When the Viewer asks the Recorder And the Recorder responds with a new stream And the Viewer gets “stream notification” and plays the stream Then the Recorder ends publishing in 25 seconds And the Viewer shares the stream And an Anonymous user opens the shared link and plays a video
  16. BDD Feature: Sending feedback after watching a stream. Scenario: A

    user watches and shares the record. Given we have a Recorder user And we have a Viewer user When the Viewer asks the Recorder And the Recorder responds with a new stream And the Viewer gets “stream notification” and plays the stream Then the Recorder ends publishing in 25 seconds And the Viewer shares the stream And an Anonymous user opens the shared link and plays a video
  17. - А что если будет 1000 параллельных стримов? - Не

    понятно. Надо проверить. Вопрос
  18. • Locust • Переиспользование кода от behaviour тестов • Специфика

    сбора метрик • Отдельное окружение Performance тесты
  19. Итог • Законченный продукт • Архитектура, BDD и Docker –

    лучшие друзья • Nginx-RTMP и FFmpeg Streaming Guide – хорошие ресурсы для старта