Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Video Streaming with NGINX

The demand for Internet video continues to grow at a fast pace and from all types of devices. In this webinar, you'll learn about the different methods for streaming video and how some of the advanced features of NGINX and NGINX Plus can be used to meet your video streaming needs.

View full webinar on demand at http://nginx.com/resources/webinars/streaming-media-delivery-nginx/

Related Books

Free with a 30 day trial from Scribd

See all
  • Be the first to comment

Video Streaming with NGINX

  1. 1. Video Streaming with NGINX Introduced by Andrew Alexeev Presented by Rick Nelson Nginx Inc May 13, 2014
  2. 2. About this webinar The demand for Internet Video continues to grow at a fast pace and from all types of devices. In this webinar, you'll learn about the different methods for streaming video and how some of the advanced features of NGINX and NGINX Plus can be used to meet your video streaming needs.
  3. 3. Video Streaming Methods File Download Progressive Download Pseudo- Streaming Adaptive Bitrate Streaming RTMP
  4. 4. The Evolution of HTTP Video Streaming Pseudo- Streaming Adaptive Bitrate Streaming File Download Progressive Download
  5. 5. File Download N Internet Video Server Content downloaded to disk • Playback starts after the download completes • Download stored on disk
  6. 6. Progressive Download N Video Server META Progressive Download Content is streamed and played as it is downloaded • Playback starts before download completes • Meta data at the beginning of the file • Download stored on disk • Trick-play and media flow control not easy • Problematic with low bandwidth connections
  7. 7. Pseudo-Streaming Video Server META x Pseudo-streaming x Client can abort stream and request new byte-range N • Adds trick-play to progressive download • Client can request partial content • Content can be buffered by player
  8. 8. Adaptive Bitrate Streaming Video Server MANIFEST Adaptive Streaming Client downloads manifest, then video chunks of appropriate bitrate N • Data is sent as a continuous stream of small chunks • Supports trick-play capabilities • Supports variable bitrates supported • Easily change bitrates while streaming • Less buffering on the client • Better restoration from network interruptions
  9. 9. Adaptive Bitrate Streaming • HTTP Live Streaming (HLS) – From Apple – Package MP4 encoded file to: • Playlist (.m3u8) • Segment files (.ts) • HTTP Dynamic Streaming (HDS) – From Adobe – Package MP4 encoded file to: • Manifest (.f4m) • Index (.f4x) • Fragment(.f4f)
  10. 10. HLS File Structure Master Playlist .mp4.m3u8 Playlist Bitrate 1 .mp4.m3u8 Segment 1 Bitrate 1 .mp4.ts Segment 2 Bitrate 1 .mp4.ts Playlist Bitrate 2 .mp4.m3u8 Segment 1 Bitrate 2 .mp4.ts Segment 2 Bitrate 2 .mp4.ts
  11. 11. HDS File Structure Master Manifest .f4m Manifest Bitrate 1 .f4m Index Bitrate 1 .f4x Fragment Bitrate 1 .f4f Manifest Bitrate 2 .f4m Index Bitrate 2 .f4x Fragment Bitrate 2 .f4f
  12. 12. Real Time Messaging Protocol (RTMP) • TCP-based streaming protocol • Developed by MacroMedia – Now Adobe • Live and VOD streaming • Wide desktop browser support via Flash plugin • Supported by a variety of software
  13. 13. INTRODUCING NGINX…
  14. 14. What is NGINX? Internet Proxy Caching, Load Balancing… HTTP traffic N Web Server Serve content from disk Application Server FastCGI, uWSGI, Passenger… Advanced Features: Bandwidth Management Application Acceleration SSL and SPDY termination Performance Monitoring High Availability Content-based Routing Request Manipulation Response Rewriting Authentication Mail Proxy Geo Location HLS HDS RTMP MP4/FLV MP4 Bandwidth
  15. 15. NGINX Accelerates 146,000,000 Websites
  16. 16. 23% Top 1 million websites 38% Top 1,000 websites
  17. 17. NGINX and NGINX Plus NGINX F/OSS nginx.org 3rd party modules Large community of >100 modules
  18. 18. NGINX and NGINX Plus NGINX F/OSS nginx.org 3rd party modules Large community of >100 modules NGINX Plus Advanced load balancing features Ease-of-management Commercial support
  19. 19. NGINX Plus • NGINX Plus builds: – NGINX Plus – NGINX Plus Lua – NGINX Plus Extras – NGINX Plus Streaming Media Server
  20. 20. VIDEO STREAMING WITH NGINX PLUS
  21. 21. NGINX Plus and HTTP Live Streaming (HLS) • ngx_http_hls_module • NGINX creates playlist and segment files on-the-fly • Allows for existing mp4 files to be served by HLS • No need to re-package content • Save time and storage space location /hls { hls; }
  22. 22. Demo: NGINX HLS
  23. 23. NGINX Plus and HTTP Dynamic Streaming (HDS) • ngx_http_f4f_module • Manifest, index and segment files created by Adobe tools such as f4fpackager location /hds { f4f; }
  24. 24. Demo: NGINX HDS
  25. 25. NGINX and HTTP Pseudo-Streaming • ngx_http_mp4_module • Bandwidth can be controlled (NGINX Plus) location /video { mp4; mp4_limit_rate 1.2; mp4_limit_rate_after 15s; }
  26. 26. Demo: NGINX Pseudo-Streaming
  27. 27. NGINX Plus and RTMP Streaming • nginx-rtmp-module • RTMP live and VOD streaming • Stream transcoding with external software (ffmpeg, avconv) • HTTP callbacks on streaming events • Stream relay: push and pull
  28. 28. All (or some) Of The Above • Many types of clients • Many formats (Flash=HDS/RTMP, iPhone=HLS, etc.) • You will want to support multiple delivery methods root /tmp/mp4; location ~ .mp4$ { mp4; } location ~ .mp4.(m3u8|ts)$ { hls; }
  29. 29. Session Log Aggregation • ngx_http_session_log_module • Normal logging: One entry per segment request – High disk space usage – Excessive disk operations – Difficult to use for billing • Aggregation: Aggregates multiple requests
  30. 30. Session Log Aggregation Example: Log sessions based on client IP and user agent. Sessions expires after in 30 seconds. session_log_zone /var/log/nginx/sessions.log format=combined zone=one:1m timeout=30s md5=$binary_remote_addr$http_user_agent; server { [..] location /hds/ { session_log one; f4f; } }
  31. 31. Demo: NGINX Log Aggregation
  32. 32. Demo: Show configuration file
  33. 33. Review • There are multiple ways to deliver video – HLS, HDS, pseudo-streaming, progressive download, RTMP • You will probably need to support multiple methods • NGINX Plus makes it easy
  34. 34. Questions and Answers
  35. 35. Closing thoughts • 38% of the busiest websites use NGINX • Check out the video streaming articles on nginx.com • Future webinars: nginx.com/webinars Try NGINX F/OSS (nginx.org) or NGINX Plus (nginx.com)

    Be the first to comment

    Login to see the comments

  • angaur

    Nov. 25, 2016
  • jagdeeshkumar

    Dec. 27, 2016
  • fatemehseif1

    Jan. 16, 2017
  • blade74

    Mar. 28, 2017
  • drakunov

    Apr. 2, 2017
  • metavige

    May. 4, 2017
  • Dovezar

    May. 26, 2017
  • systemsmgmtzen

    Jul. 2, 2017
  • MahmudulHasanRubel2

    Aug. 21, 2017
  • NghiNGUYENVAN1

    Sep. 27, 2017
  • ssuser59044a

    Oct. 5, 2017
  • VasilyBezruchkin

    Nov. 5, 2017
  • wiliwe

    Nov. 30, 2017
  • liuorangle

    Dec. 24, 2017
  • michaelagustin

    Apr. 10, 2018
  • TrnVKiu1

    Apr. 23, 2018
  • sanmathigb

    Jun. 13, 2018
  • flicker1985

    Jun. 13, 2018
  • PayamMohammadi3

    Feb. 27, 2019
  • NothingCtrl

    Jan. 28, 2020

The demand for Internet video continues to grow at a fast pace and from all types of devices. In this webinar, you'll learn about the different methods for streaming video and how some of the advanced features of NGINX and NGINX Plus can be used to meet your video streaming needs. View full webinar on demand at http://nginx.com/resources/webinars/streaming-media-delivery-nginx/

Views

Total views

41,519

On Slideshare

0

From embeds

0

Number of embeds

653

Actions

Downloads

645

Shares

0

Comments

0

Likes

83

×