0

I have MPEG-TS H.264 video stream of Live TV Channel, I want to Live Stream it for iPhone but as HLS requires to make segments (e.g.: 10s) segment and send it using M3u8. and for this purpose I am currently using ffmpeg and m3u8-segmenter available on internet. But I do not want to use transcoding using ffmpeg as i have memory + processor limitations on my hardware. Is it possible that i can only make segments of the MPEG-TS video and directly send it to the iPhone.

I have tried many ways but unable to do so. I am using Linux based system.

Please help me, what are the procedures of live streaming to iphone without transcoding the video.

Thanks

Zain Raza
  • 1,299
  • 1
  • 9
  • 17
  • 1
    What are you using ffmpeg for in this case? If it's already coming in as MPEG-TS, you should be able to feed it to m3u8-segmenter directly. Can you post the sample code and invocations you're using for ffmpeg and m3u8-segmenter? – Jeffrey Pfau Nov 15 '14 at 03:15
  • @JeffreyPfau I am using this format:
    ffmpeg -i [link]http://localhost:6954/myvideo.ts -f mpegts - (all other parameters for encoding) | ./m3u8-segmenter -i - -d 10 -p outputdir/prefix -m outputdir/output.m3u8 -u [link]http://domain.com/
    As my video is already in MPEG-TS format, thats why i just want to make slices of that video and send it to my iPhone using m3u8. I am not sure, how to do this.
    – Zain Raza Nov 19 '14 at 10:08
  • I have also tried this: ./m3u8-segmenter -i (URL to MPEG-TS video) -d 10 -p outputdir/prefix -m outputdir/output.m3u8 -u (domain prefix) – Zain Raza Nov 19 '14 at 10:09

1 Answers1

1

The best way to go about this is to cut out FFmpeg entirely. Although you can coerce FFmpeg to not transcode (by using -c copy), since the video is already in MPEG-TS format straight off of the livestream, it's best to use it directly.

Since it looks like the video is coming over HTTP, you can use curl to print it to stdout:

curl http://localhost:6954/myvideo.ts | ./m3u8-segmenter -i - -d 10 -p outputdir/prefix -m outputdir/output.m3u8 -u http://domain.com

Or if you want to use wget instead of curl, it's similar

wget -O - http://localhost:6954/myvideo.ts | ./m3u8-segmenter -i - -d 10 -p outputdir/prefix -m outputdir/output.m3u8 -u http://domain.com

Either wget or curl will likely already be installed on your system.

Jeffrey Pfau
  • 264
  • 2
  • 4
  • Great! Nice idea. I will do it. I hope it will solve my problem. Thanks buddy – Zain Raza Nov 19 '14 at 11:38
  • @Jeffery: That is working fine on VLC. But It is not getting played on ipad. It keeps on loading. I tried it on simulator and device as well. Now the file sizes are big. With transcoding the file sizes are between 1-2mb and now they are quite bigger 3-15mb depending on the original video. – Zain Raza Nov 22 '14 at 11:37
  • Is there any special format which is understood by iOS devices for HLS. because VLC is playing the format but ios does not. – Zain Raza Nov 22 '14 at 15:27
  • @ZainRaza It looks like the MPEG-TS stream may be too high profile or bitrate to play on your device, and you may need to end up transcoding it anyway. For more info, see [this question](http://stackoverflow.com/questions/20446134/why-doesnt-my-mpeg-ts-play-on-ios) for more information. – Jeffrey Pfau Nov 22 '14 at 23:56