[FFmpeg-user] HTML5 live streaming

Ricardo Kleemann ricardo at americasnet.com
Wed Apr 24 17:54:38 CEST 2013


On Tue, Apr 23, 2013 at 6:56 AM, Jonathan Isom <jeisom at gmail.com> wrote:

> On Tuesday, April 23, 2013, Jonathan Isom wrote:
>
> >
> >
> > On Monday, April 22, 2013, Ricardo Kleemann wrote:
> >
> >> Hi Jonathan,
> >>
> >> This is awesome! It worked! :-)
> >>
> >> so my next step... how do I do adaptive bitrate? For example, I want to
> >> have a stream for iPad, a stream for iPhone, Android...
> >
> >
> > From what I was able to find, something like this should work:
> >
> > ------>8-----
> >
> >
> >
> >    #EXTM3U
> >
> > #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1280000
> >
> >  <1280000>http://example.com/low.m3u8
> >
> >  <http://example.com/low.m3u8
> >#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2560000
> >
> >  <2560000>http://example.com/mid.m3u8
> >
> > #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=7680000
> >
> >  <7680000>http://example.com/hi.m3u8
> >
> >  <http://example.com/hi.m3u8
> >#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=65000,CODECS="mp4a.40.5"
> >
> > http://example.com/audio-only.m3u8
> >
> > ------>8-----
> >
> > Found this info at <
> http://tools.ietf.org/html/draft-pantos-http-live-streaming-04>. Haven't
> tested this yet & not sure howto from home.
> >
> >
> Sorry for the quick double post. Also found this:
> <http://wiki.whatwg.org/wiki/Adaptive_Streaming>
>
> Later
>
> Jonathan
>
> >
> >> Another question... does m3u8 work for a desktop browser? I do I need an
> >> embedded player like JWPlayer for desktop?
> >
> > I believe that  Safari is the only desktop browser that currently
> supports
> > HLS. Apple has proposed it for being a standard I believe, however that
> has
> > not occur yet. Btw, many find it bad manners to top post.
> >
> > Hope this helps.
> >
> > Jonathan
> >
> >
> >> Thanks so much!
> >> Ricardo
> >>
> >> On Sun, Apr 21, 2013 at 9:30 PM, Jonathan Isom <jeisom at gmail.com>
> wrote:
> >>
> >> > On Sun, Apr 21, 2013 at 7:43 PM, Ricardo Kleemann
> >> > <ricardo at americasnet.com> wrote:
> >> > > That's great, I didn't realize it.
> >> > >
> >> > > I'm trying to convert the input to h.264 + AAC and output to the
> >> > segmenter
> >> > > but it's not working. Can you help me find the error in the command?
> >> > >
> >> > > ffmpeg -loglevel debug -threads 4 -i
> "rtmp://server1/live/livestream1"
> >> > > -i_qfactor 0.71 -qcomp 0.6 -qmin 10 -qmax 63 -qdiff 4 -trellis 0
> >> -vcodec
> >> > > libx264 -s 480x270 -b:v 512k -b:a 56k -ar 22050 -map 0 -f segment
> >> > > -segment_time 10 -segment_list live.m3u8 -segment_list_flags +live
> >> > > live_%05d.ts
> >> > >
> >> >
> >> > Here is the command I use which works with my iPad 3rd Gen. I cd into
> >> > the directory that I want the files to load from on the server. My
> >> > case is "/var/www/localhost/htdocs/stream/" which is
> >> > "http://domain/stream/". You probably should lose all the extra
> >> > options. for realtime encoding add "-re" to the command. You will want
> >> > to change RESOLUTION BITRATE & VIDSOURCE to what you need. Also below
> >> > is an example html file.
> >> > This is with ffmpeg git from a week ago. notice the "-hls*" options
> >> > instead of -segment.* options.
> >> >
> >> > ffmpeg  -i VIDSOURCE -y  -c:v libx264 -b:v BITRATE -vprofile baseline
> >> > -preset medium -x264opts level=41 -threads 4 -s RESOLUTION -map 0:v
> >> > -map 0:a:0  -c:a libfaac -b:a 160000 -ac 2   -hls_time 10
> >> > -hls_list_size 6 -hls_wrap 18 -start_number 1 stream.m3u8
> >> >
> >> > index.htm:
> >> > <html>
> >> > <body>
> >> >    <video  height="531"  width="945" autoplay="autoplay"
> >> > controls="controls">
> >> >     <source src="stream.m3u8" />
> >> >    </video>
> >> > </body>
> >> > </html>
> >> >
> >> > Hope this is helpful.
> >> >
> >> > Jonathan
>

I appreciate your help, Jonathan. Thank you

Would you know where I can find the optimal ffmpeg transcoder settings for
each of iPad, iPhone, Android Phone and Android Tablet?

Ricardo


More information about the ffmpeg-user mailing list