IPTVSimple & Wallop

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
dan120db Offline
Junior Member
Posts: 1
Joined: Jul 2014
Reputation: 0
Post: #1
Anyone else out there have this working? I've got Wallop working on a server on my LAN. I'm able to watch the streams on my Apple devices. It works fantastically well, and even passes the fiance test. I'd like to move this into the XBMC domain.

I'm able to watch a stream by linking IPTV Simple directly to the m3u8 playlist generated by Wallop, as long as the channel is already tuned by another device. This is encouraging, but I don't know how to take the next step. I'm assuming that I need some sort of curl or php script to tell Wallop to tune the channel and return the m3u8 playlist, but I don't know how to make that happen. Any advice? It seems like a simple scripting question for someone with a bit more coding knowledge.
find quote
doogagoodooga Offline
Junior Member
Posts: 1
Joined: Jun 2015
Reputation: 0
Post: #2
Yes. Open ~/wallop/app/app.rb in some editor. Paste this function above the third 'end' from the bottom. In your m3u file, call this function instead of the '/channels/' one and it will tune the channel and return the m3u8 automatically. The call in the m3u file for channels 802 and 803 would look like:

#EXTINF:-1 tvg-id="I802.66534.schedulesdirect.org" tvg-name="802" group-title="News" ,CNN
#EXTINF:-1 tvg-id="I803.43559.schedulesdirect.org" tvg-name="803" group-title="News" ,FOX

Replace the server address with the address of your wallop server. Follow these examples for each channel.

Here is the ruby function:

get '/channelsdirect/:channel.m3u8' do
   ## validate input
      resolution = params[:resolution] =~ /\A\d+x\d+\z/ ? params[:resolution] : '1280x720'
      bitrate = params[:bitrate] =~ /\A\d+k\z/ ? params[:bitrate] : '3000k'
      channel = params[:channel] =~ /\A\d+(.\d+)?\z/ ? params[:channel] : '3'

      if !Wallop.sessions.has_key?(channel)
        Wallop.logger.info "Tuning channel #{channel} with quality settings of #{resolution} @ #{bitrate}"
        pid  = POSIX::Spawn::spawn(Wallop.ffmpeg_command(channel, resolution, bitrate))
        Process::waitpid(pid, Process::WNOHANG)
        Wallop.logger.info "Creating session for channel #{channel}"
        Wallop.sessions[params[:channel]] = {:channel => channel, :pid => pid, :ready => false, :last_read => Time.now}

      JSON.dump({:status => 200, :message => 'ok'})

      session = Wallop.sessions[params[:channel]]
      halt 404 if !session


      content_type :m3u8

      session = Wallop.sessions[params[:channel]]
      halt 404 if !session

      halt 420 if !session[:ready]

      session[:last_read] = Time.now

      send_file(File.join(Wallop.transcoding_path, "#{session[:channel]}.m3u8"))

find quote
UofM_Matt Offline
Junior Member
Posts: 5
Joined: Oct 2004
Reputation: 0
Post: #3
Doogagoodooga -

I'm going to bump this up because this is so darn useful. I've been trying to stream from within Kodi, over the internet, without having to log into the remote box and start the ffmpeg stream by hand. This actually does it perfectly. Is it a little slow? Sure, but this will now pass the WAF test no problem. I think you should submit this to the wallop GIT as a patch. Everyone should be able to use this. Now if I could only convince the MythTV app to tune channels via this instead of built in tuning, I would be golden. Mythtv and automatic FFMPEG live TV streaming? Yes please.

Thanks again!
find quote