one of our partner is exposing a live HLS stream. I want to know if there is any tool that can take hls live stream as input and convert it to rtmp live stream and ideally push that output to some other server.

Basically we are using wowza server to serve live channels to our clients. As per my knowledge wowza is not taking video stream as input using http protocol. Thats why i am looking for a tool to convert hls stream to rtmp stream.

We are trying to do the following, but it fails:

ffmpeg -i http://bgsf.hls.iptvdc.com/islambox/732/play.m3u8 -re -acodec copy -vcodec copy rtmp://ib12.islambox.tv/live/najam83

C:\>ffmpeg -i http://bgsf.hls.iptvdc.com/islambox/709/play.m
3u8 -re -acodec copy -vcodec copy rtmp://ib12.islambox.tv/live/najam83

ffmpeg version N-76023-g0131636 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 5.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --ena
ble-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
 --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl
e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --ena
ble-decklink --enable-zlib
  libavutil      55.  4.100 / 55.  4.100
  libavcodec     57.  6.100 / 57.  6.100
  libavformat    57.  4.100 / 57.  4.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 11.100 /  6. 11.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
[aac @ 000000bd32533720] element type mismatch 1 != 0
[aac @ 000000bd325fe4e0] element type mismatch 1 != 0
Input #0, hls,applehttp, from 'http://bgsf.hls.iptvdc.com/islambox/709/play.m3u8
  Duration: N/A, start: 54791.428622, bitrate: N/A
  Program 0
      variant_bitrate : 0
    Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 720x576 [
SAR 12:11 DAR 15:11], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1: Audio: aac (HE-AAC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo,
 fltp, 46 kb/s
Option re (read input at native frame rate) cannot be applied to output file rtm
p://ib12.islambox.tv/live/najam83 -- you are trying to apply an input option to
an output file or vice versa. Move this option before the file it belongs to.
Error parsing options for output file rtmp://ib12.islambox.tv/live/najam83.
Error opening output files: Invalid argument
  • ffmpeg -i http://example.com/test.m3u8 -re -acodec copy -vcodec copy rtmp://example.com/app/stream
    – SlimSCSI
    Oct 14 '15 at 17:11
  • @SlimSCSI please check my answer it gives error.
    – najam
    Oct 15 '15 at 7:23
  • first, please don't use answers for comments. Second, put -re as the first option, before -i that was my mistake.
    – SlimSCSI
    Oct 15 '15 at 8:19

Because -rf is a output option, I guess, you should put -re ahead like that:

ffmpeg -re -i http://example.com/test.m3u8 -acodec copy -vcodec copy rtmp://example.com/app/stream

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.