Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
IPTVSimple & Wallop
#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.
Reply
#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:

#EXTM3U
#EXTINF:-1 tvg-id="I802.66534.schedulesdirect.org" tvg-name="802" group-title="News" ,CNN
http://192.168.1.1:8888/channelsdirect/802.m3u8
#EXTINF:-1 tvg-id="I803.43559.schedulesdirect.org" tvg-name="803" group-title="News" ,FOX
http://192.168.1.1:8888/channelsdirect/803.m3u8

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

Here is the ruby function:

Code:
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.cleanup_channel(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}
      end

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

      sleep(3)
    
      session = Wallop.sessions[params[:channel]]
      halt 404 if !session

      JSON.dump(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"))

    end
Reply
#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!
Reply

Logout Mark Read Team Forum Stats Members Help
IPTVSimple & Wallop0