[FFmpeg-user] HTML5 live streaming

Vlad Kroutik vkroutik at gmail.com
Mon Apr 22 02:00:19 CEST 2013


You do not need m3u8-segmenter as ffmpeg support segmented output and its
built it. Look at the ffmpeg docs or example:
/usr/local/bin/ffmpeg -i hi.ts -loglevel debug
-analyzeduration 6M  -map 0 -c copy -f segment -segment_time 10
-segment_list hi.m3u8 hi_%05d.ts



On Sun, Apr 21, 2013 at 2:53 PM, Ricardo Kleemann
<ricardo at americasnet.com>wrote:

> On Sat, Apr 20, 2013 at 10:21 PM, JoelB <onephatcat at earthlink.net> wrote:
>
> > Should work for Roku and anything that supports HLS, I think android
> does,
> > various flash players, QuickTime 7 for Mac, safari(?) supposedly supports
> > it as well. Generally, you want to encode h.264 video with AAC audio.
> >
> > Joel
> >
> > Sent from my iPhone
> >
>
> So that's what I'm doing... I'm encoding to 264 and AAC, and piping to the
> segmenter.
>
> I see the m3u8 file being written as well as all the other ts files.
>
> But if I try to access from an iPad it gives me different errors, sometimes
> it says "cannot decode", sometimes it says cannot find the file.
>
> I'm assuming that the m3u8 file is supposed to be served up by a standard
> web server (apache). Do I need any special configuration in apache for
> this?
>
> Here's my ffmpeg command:
>
> ffmpeg -threads 4 -i "rtmp://server1/live/livestream1" -f mpegts -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 - | m3u8-segmenter -i - -d 10 -p
> cidadeviva/live -m /shared/media/videos/cidadeviva/live.m3u8 -u
> http://web1.americasnet.com/videos/
>
> It succeeds in reading the rtpm stream and does pipe the output to the
> segmenter since I see all of the m3u8 and ts files being written.
>
> I'm able to access the m3u8 file via http, although I see apache often
> complains that it can't find the file. Could that be because the file is
> constantly being written?
>
> Ricardo
>
>
> > On Apr 20, 2013, at 8:56 PM, Ricardo Kleemann <ricardo at americasnet.com>
> > wrote:
> >
> > > Hi Joel,
> > >
> > > Thanks, I'll play around with that.
> > >
> > > Another question... is the segmenter only for iOS? Would other devices
> > also
> > > work with this?
> > >
> > > Ricardo
> > >
> > > On Sat, Apr 20, 2013 at 8:45 PM, JoelB <onephatcat at earthlink.net>
> wrote:
> > >
> > >> Usually a segmented stream URL ends with .m3u8 so for ios, you just
> give
> > >> the user a link to that m3u8 playlist URL and if you have a valid
> > stream,
> > >> the phone will just play it.
> > >>
> > >> http://inodes.org/bigbuck/big_buck.m3u8
> > >>
> > >> Would probably be the res
> > >>
> > >>
> > >> Joel
> > >> Sent from my iPhone
> > >>
> > >> On Apr 20, 2013, at 5:35 PM, Ricardo Kleemann <
> ricardo at americasnet.com>
> > >> wrote:
> > >>
> > >>> Hi,
> > >>>
> > >>> I've been searching around for solutions to use ffmpeg to do live
> > >> streaming
> > >>> to html5.
> > >>>
> > >>> I understand that for iOS I need a segmenter?
> > >>>
> > >>> I've installed the latest ffmpeg and also m3u8-segmenter from git,
> but
> > >> I'm
> > >>> not really sure how to use it. The m3u8-segmenter site has an example
> > >> like
> > >>> this:
> > >>>
> > >>> ffmpeg -loglevel quiet  -i big_buck_bunny.ogv -f mpegts - | \
> > >>> m3u8-segmenter -i - -d 10 -p tmp/big_buck_bunny -m tmp/big_buck.m3u8
> > >>> -u http://inodes.org/bigbuck/
> > >>>
> > >>> But in terms of an HTML5 page source, how would I access the stream
> > that
> > >> is
> > >>> being generated by the segmenter?
> > >>>
> > >>> Is there a simpler way to use ffmpeg for live streaming?
> > >>>
> > >>> thanks
> > >>> Ricardo
> > >>> _______________________________________________
> > >>> ffmpeg-user mailing list
> > >>> ffmpeg-user at ffmpeg.org
> > >>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> > >> _______________________________________________
> > >> ffmpeg-user mailing list
> > >> ffmpeg-user at ffmpeg.org
> > >> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> > >>
> > >>
> > >> ------------------------------------------------------
> > >> Powered by Xeams. Visit xeams.com for more information
> > >> ------------------------------------------------------
> > > _______________________________________________
> > > ffmpeg-user mailing list
> > > ffmpeg-user at ffmpeg.org
> > > http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> > _______________________________________________
> > ffmpeg-user mailing list
> > ffmpeg-user at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> >
> >
> > ------------------------------------------------------
> > Powered by Xeams. Visit xeams.com for more information
> > ------------------------------------------------------
> >
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>


More information about the ffmpeg-user mailing list