HTTP Live Streaming, FFMPEG & FFSERVER, and iPhone OS 3

后端 未结 4 794
迷失自我
迷失自我 2020-12-04 05:20

In iPhone OS 3, Apple has introduced HTTP Live Streaming which should allow live streaming of video from the internet. I am currently operating a webcam, which feeds into m

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-04 06:07

    You'll need to build a copy of ffmpeg with a version >= e109a29d6ddb02b2dd58c6c385ebec27f2d23b58 (git) or 18793 (svn). Make sure you also specify the --enable-libx264 flag when you're building. Once you've got that up and running, you can do roughly the following:

    ffmpeg -i  -acodec libmp3lame -ac 1 -vcodec libx264 -s 320x240 \
           -level 30 -f mpegts - | \
    segmenter - 10 test test.m3u8 http://example.com/path/to/your/files/
    

    i.e. Bring an input file or stream into ffmpeg and pipe an H.264 video with MP3 audio into Apple's segmenter. The segmenter spits out segmented video files and M3U playlists pointing to the segmented files. You'd serve the segmented files and playlists via a web server like Apache.

    Obviously you'll want to tweak the ffmpeg and segmenter options substantially to get the results you're after.

提交回复
热议问题