tag:blogger.com,1999:blog-8126413226926105495.post1655796230216749270..comments2024-03-15T04:36:37.072+03:00Comments on Streaming with nginx-rtmp-module: Native HLS in nginx-rtmpRoman Arutyunyanhttp://www.blogger.com/profile/00172269067283670037noreply@blogger.comBlogger27125tag:blogger.com,1999:blog-8126413226926105495.post-65083178525406554722022-05-06T12:04:40.126+03:002022-05-06T12:04:40.126+03:00Thanks for sharing the useful information. If you ...Thanks for sharing the useful information. If you guys want to finish <a href="https://www.leawo.org/entips/hls-streaming-download-1410.html?blog=1410" rel="nofollow">HLS streaming download</a> task, you should make use of the downloading tools. You can check some of them in the link. Hope it helps.vinho want to be richhttps://www.blogger.com/profile/14169922019548280415noreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-88385505686713049742013-03-12T00:25:43.000+04:002013-03-12T00:25:43.000+04:00Gary has nice point there with <64kbit audio on...Gary has nice point there with <64kbit audio only stream.<br>For example if you have incoming stream with 500kbit video+56kbit aac audio, you could have that split into 2 streams:<br>1. with whole stream (video+audio, 556kbit/sec)<br>2. audio only stream (56kbit, directly stripped from incoming stream)<br><br>And have module to create multistream manifest for those.. I know it is pretty easy to create ffmpeg exec command but that feature could be very handy for IOS deliveries.<br><br>This applies only to HLS streaming, since Apple is requiring HLS streams with one stream less than 64kbit/s for apps if 3G network is used in app. This applies to apps that are playing bigger streams than 50megabytes or longer than 5 minutes.Toninoreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-73010929036100128732013-03-08T03:50:49.000+04:002013-03-08T03:50:49.000+04:00hi arut,sorry for delay but i wanted to make sure ...hi arut,<br><br>sorry for delay but i wanted to make sure that i analyze the ts segments correctly.<br><br>It seems AAC audio looks great in ts, i found some issues in the h.264 AVC. Specially the PTS at 90 khz periods. Here is a screenshot of a analyze, encoded with FME/LE and transmuxed thru your new native mpegts muxer.<br><br>Screenshot is here:<br>https://www.amazon.de/gp/drive/share?ie=UTF8&s=pMtn-MlMR4Ah9aEQgh3j24#<br><br>I really would like to join the project, but i´m a java expert and not c or c++, but hey..why not learn it.<br><br>I know much about HLS. I would like to share some ideas.<br><br>When there is a native ts parser where we can grab the h.264 NAL units, i think its not even hard to add AES encryption. Cause you use C++, i think to include openSSL is the right choice.<br><br>There are 2 encryption method in HLS, one is to encrypt the whole TS which destroys the complete ts container structure. Another way is to add sample-aes. Sample aes only packs NAL units in a rotation of each XX packet. <br><br>Another great idea is to extract the AAC stream to write AAC segments in 64kbit. This is required by the apple store requirements.<br><br>As a programmer, i know that ideas makes no code... I only wanted to share some of my minds.<br><br>Which IDE do you use for nginx module and c++ development? Do you use eclipse under lnx?<br><br>I want to install an developer IDE and hopefully get an debugger for testing, thats why i ask...<br><br>come back soon.<br><br>GaryGarynoreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-1649522137441205942013-05-29T07:40:02.000+04:002013-05-29T07:40:02.000+04:00Yes, it's in master.Yes, it's in master.raruthttp://rarut.wordpress.comnoreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-68973284661786707252013-03-05T19:22:41.000+04:002013-03-05T19:22:41.000+04:00Hello Arut,I'm using nginx-rtmp with hls suppo...Hello Arut,<br>I'm using nginx-rtmp with hls support via ffmpeg libs, it's working fine and stable, however i see two limitations on hls feature:<br>1. hls_path directory is stored for all streams.When an application with many streams and one stream have lot of fragment files then number of file per the directory limited by operating system.<br>2. when stream restart and hls playlist is empty then first fragment will be overwrite.<br>Hope you will overcome this limitation.ThanksTrong Lehttp://www.facebook.com/tronglt85noreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-12481400698739840292013-03-05T19:45:12.000+04:002013-03-05T19:45:12.000+04:00Great! I'll try it.Many thanks Roman.Great! I'll try it.<br>Many thanks Roman.Владимир Желябовский (@spb_vladimir)http://twitter.com/spb_vladimirnoreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-29542201149303652752013-03-05T19:58:37.000+04:002013-03-05T19:58:37.000+04:001. My idea is to create a directory per stream. I ...1. My idea is to create a directory per stream. I will implement that later. Do you have another idea?<br>2. Use "hls_continuous on" (default in native-hls)raruthttp://rarut.wordpress.comnoreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-31468973052541280652013-03-05T20:07:23.000+04:002013-03-05T20:07:23.000+04:002. if playlist is empty then what fragments are ov...2. if playlist is empty then what fragments are overwritten? old or new fragments?raruthttp://rarut.wordpress.comnoreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-18312206093147613072013-03-06T03:04:11.000+04:002013-03-06T03:04:11.000+04:00Hi Arut,thanks that you spend your time with the d...Hi Arut,<br><br>thanks that you spend your time with the development of this great module, i´m impressed.<br><br>I´m new with HLS streaming and got a working version with ffmpeg libs and your module and nginx. Now i saw that you have written an native mpegTS plexer that makes a lot of sense to me. <br><br>I compiled the old version without native HLS with this line:<br>./configure --add-module=/Users/gary/Desktop/ngnix/nginx-rtmp-module --add-module=/Users/gary/Desktop/ngnix/nginx-rtmp-module/hls --with-cc-opt=-I/opt/ffmpeg/include --with-ld-opt=-L/opt/ffmpeg/lib --without-http_rewrite_module<br><br>Can you please tell how to compile the new version, do i have simple to add the .../nginx-rtmp-module without any other flags?<br><br>And in the conf settings how can i enable HLS, like the old one?<br><br>I will download now the new version and try things out. Would be great when you can please document the new HLS implementation. <br><br>Thanks a lot..<br>GaryGaryhttp://nonenoreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-83982032760331257062013-03-06T03:33:11.000+04:002013-03-06T03:33:11.000+04:00your native HLS implementation works out of box on...your native HLS implementation works out of box on OSX...great..will play with it now and tomorrow check the ts with our anaylzers and come back with the result.<br><br>thx<br>garyGaryhttp://nonenoreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-90282274894088756642013-03-06T05:22:59.000+04:002013-03-06T05:22:59.000+04:00Thanks for reply,1. Workaround, I also have to mod...Thanks for reply,<br>1. Workaround, I also have to modified your code to create each stream has a dir.<br>2. hls_continuous enabled, but playlist is empty then there is no way to know the last fragment, there is no way to restore the previous fragment, so odlest fragment (first fragment, i think id is 1) is overwritten.<br>I replaced start_id of fragment each time when stream start or restart by epoch time(same "date +%s" command), for example: mystream_1362532600.tsTrong Lehttp://www.facebook.com/tronglt85noreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-63714104559865760142013-03-06T08:05:02.000+04:002013-03-06T08:05:02.000+04:00In native-hls branch all HLS code in already inclu...In native-hls branch all HLS code in already included in rtmp modulde, you only need to add rtmp module. This is the command for your case:<br><br>./configure –add-module=/Users/gary/Desktop/ngnix/nginx-rtmp-module –without-http_rewrite_module<br><br>Configuration is exactly the same as before (hls, hls_path, hls_fragment etc).raruthttp://rarut.wordpress.comnoreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-6904540369566417732013-03-06T08:07:08.000+04:002013-03-06T08:07:08.000+04:001. great 2. playlist should exist if there was any...1. great 2. playlist should exist if there was any previous hls streaming. If you delete it manually this is exactly what you will have.raruthttp://rarut.wordpress.comnoreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-57922587844988262272013-03-06T08:08:26.000+04:002013-03-06T08:08:26.000+04:00Great, I really need more feedbackGreat, I really need more feedbackraruthttp://rarut.wordpress.comnoreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-15905057215885771372013-03-06T11:05:24.000+04:002013-03-06T11:05:24.000+04:00Ok! I have another question, hls_continuous on vs ...Ok! I have another question, hls_continuous on vs #EXT-X-DISCONTINUITY tag?Trong Lehttp://www.facebook.com/tronglt85noreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-40992743763784012172013-03-06T11:41:52.000+04:002013-03-06T11:41:52.000+04:00The module never sets that tag. hls_continuous is ...The module never sets that tag. <br><br>hls_continuous is the right thing to do, in native-hls it's on by default.raruthttp://rarut.wordpress.comnoreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-49269054171892676122013-03-06T14:04:19.000+04:002013-03-06T14:04:19.000+04:00I recomplied rtmp module with hls-native on my sys...I recomplied rtmp module with hls-native on my system and it works greate.FFmpeg lib's error '[error] : hls: av: muxrate VBR' disappeared in debug log.<br>Many thanks.Trong Lehttp://www.facebook.com/tronglt85noreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-2405623077122740902013-03-08T06:04:59.000+04:002013-03-08T06:04:59.000+04:00I cannot open your link, it says "This link i...I cannot open your link, it says "This link is unavailable" in German. Please give more details about h264 problems. I tested on iPhone & Android and it worked perfect for me, tstools also said it's ok. Make sure you have the latest *native-hls*, I've committed a lot yesterday (March 7). <br><br>OpenSSL is already linked to nginx for RTMP handshake. I can use it here as well, but what's the reason for that? <br><br>Writing audio-only stream is a good idea. But choosing a stream with 64k audio among all other incoming streams is tricky. <br><br>It's not C++, it's plain C. I don't use any IDE, only vim/ctags, bash and gdb. I do some things remotely (via ssh). <br><br>It''s really great if you help the project in *any* way. <br><br>PS: I'm leaving for a week. I'l; probably be able to reply but not write the code. So we can discuss h264/mpegts problems until then.raruthttp://rarut.wordpress.comnoreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-84825424860968934622013-03-08T15:52:07.000+04:002013-03-08T15:52:07.000+04:00hi arut,thanks for your fast replys. sorry for the...hi arut,<br><br>thanks for your fast replys. sorry for the link, it seems to work from here. Is there maybe a better way for communicating? Can you please send me your mail for some disucssions? I have some great ideas that i would like to share.Garynoreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-20176596959805981662013-05-29T07:50:29.000+04:002013-05-29T07:50:29.000+04:00ok, thanks, once again, thumb up (y)ok, thanks, once again, thumb up (y)ducntqhttp://ducntq.wordpress.com/noreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-27167948254270836772013-03-17T20:55:55.000+04:002013-03-17T20:55:55.000+04:00Hello Arut,great job on this module. I'm hopin...Hello Arut,<br><br>great job on this module. I'm hoping to be able to use it on a project i'm working on.<br><br>I'm having a tough time getting hls to work on an iphone4. It plays for several seconds then stops for several seconds. It continues this behavior throughout playback making it unwatchable. <br><br>The HLS stream works fine on android via vplayer. Am I missing something in my encoding process or nginx.conf setup? My videos are encoded in h264 / aac an I'm using ffmpeg to convert the video files prior to streaming to rtmp.<br><br>here is an example of the encoded format i'm using obtained via ffmpeg -i<br>Duration: 00:05:11.33, start: 0.000000, bitrate: 1234 kb/s<br> Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 720x480, 1100 kb/s, 29.97 tbr, 1k tbn, 59.94 tbc<br> Stream #0:1: Audio: aac, 44100 Hz, stereo, fltp, 160 kb/s<br><br>My nginx.conf hls application looks like this:<br><br>application hls {<br> live on;<br><br> interleave on;<br> wait_video on;<br> sync 300ms;<br><br> hls on;<br> hls_path /tmp/streams/live1;<br> hls_fragment 5s;<br><br> }<br><br>I experimented with all types of configuration options adjusting the hls_fragment, sync and toggling interleave & wait_video with no luck. any insight will be appreciated.<br><br><br>thank youmeetrihttp://gravatar.com/meetrinoreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-26257528214878470912013-03-18T06:59:45.000+04:002013-03-18T06:59:45.000+04:00My apologies, it looks like something was going on...My apologies, it looks like something was going on on my on my iphone5. It works great on my iphone4.meetrihttp://gravatar.com/meetrinoreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-60196169940968486862013-03-18T08:17:18.000+04:002013-03-18T08:17:18.000+04:00my e-mail arutyunyan.roman@gmail.comyour link is o...my e-mail arutyunyan.roman@gmail.com<br><br>your link is ok todayraruthttp://rarut.wordpress.comnoreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-7459502547328536922013-03-18T08:23:21.000+04:002013-03-18T08:23:21.000+04:00Could you explain in more detail what these PTS er...Could you explain in more detail what these PTS errors mean? Does your tool give more info when you click on error entry? I use tsreport. It's happy with the stream.raruthttp://rarut.wordpress.comnoreply@blogger.comtag:blogger.com,1999:blog-8126413226926105495.post-17584660792771736232013-03-27T17:11:02.000+04:002013-03-27T17:11:02.000+04:00Hi, RomanJust tested native-hls and there seems to...Hi, Roman<br><br>Just tested native-hls and there seems to be a problem<br>If published stream is h264/mp3 no audio can be heard and VLC says that codec is MPEG AAC<br>However if published stream is h264/aac there's no problem.<br>Is mp3 supported as an audio for hls or transcoding with ffmpeg should be done first ?<br><br>thanks for the great software.vcamnoreply@blogger.com