Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Req] Port to Linux/Windows #16

Closed
dvdgorila opened this issue Oct 16, 2013 · 22 comments
Closed

[Req] Port to Linux/Windows #16

dvdgorila opened this issue Oct 16, 2013 · 22 comments

Comments

@dvdgorila
Copy link

Can someone port this to linux/windows w/ instructions?

@tmm1
Copy link
Collaborator

tmm1 commented Oct 16, 2013

Should run on linux just fine. Windows too, but you'll need to use something like http://rubyinstaller.org/ and find a copy of ffmpeg.

@maddox maddox closed this as completed Oct 16, 2013
@tinycg
Copy link

tinycg commented Oct 17, 2013

Having tried to work this out in Windows after having a Mac install, the issue I ran into was actually related to the setup sh scripts which even something like rubyinstaller aren't really supported on the Windows side so I scrapped it not knowing where to go next.

@tmm1
Copy link
Collaborator

tmm1 commented Oct 17, 2013

You can install something like cygwin and run the scripts, or simply run the commands in the scripts themselves.

I don't use windows so I can't really help.

@tinycg
Copy link

tinycg commented Oct 17, 2013

I have cygwin and was still unable to run the .sh scripts from there, my understanding is it was a pathing issue, I wasn't able to get it figured out even by changing the paths. It wasn't clear to me what the proper startup steps are, however I was able to execute the setup steps to install the ruby dependencies, I figured that out.. just not the rest.

@tmm1
Copy link
Collaborator

tmm1 commented Oct 17, 2013

Something like this should work:

gem install bundler
bundle install --standalone --binstubs --local --path vendor/gems --quiet
bin/rake wallop:install
export RACK_ENV=production
bundle exec ruby app/app.rb

Good luck.

@maddox
Copy link
Owner

maddox commented Oct 17, 2013

bin/rake wallop:install

can be skipped since all it does is write out a launchd plist and start it up. This is def OS X specific.

We could optionally set up in init.d when running this on a linux derivative, but I have no clue how to start things on boot in Windows.

@antch
Copy link

antch commented Dec 20, 2013

@tmm1 Your commands work for running Wallop on Windows (I omitted the rake command). The only thing that I had to do w.r.t. Wallop was to remove the exec from the ffmpeg command (wallop.rb#L29). Of course, this is after all of the gymnastics involved in getting Ruby setup with the Devkit and compiling ffmpeg from source with the non-free libs enabled...

@antch
Copy link

antch commented Dec 20, 2013

I guess there are other issues on Windows. Just ran into an error that killed the process. Are you at all interested in these errors? I can continue to post stacktraces that I run into if it'd be helpful.

F:/wallop/lib/wallop.rb:79:in `kill': unsupported name `SIGQUIT' (ArgumentError)
        from F:/wallop/lib/wallop.rb:79:in `block in sweep_sessions'
        from F:/wallop/lib/wallop.rb:63:in `each'
        from F:/wallop/lib/wallop.rb:63:in `sweep_sessions'
        from app/app.rb:142:in `block (2 levels) in <main>'
        from F:/wallop/vendor/gems/ruby/1.9.1/gems/eventmachine-1.0.3/lib/em/tim
ers.rb:56:in `call'
        from F:/wallop/vendor/gems/ruby/1.9.1/gems/eventmachine-1.0.3/lib/em/tim
ers.rb:56:in `fire'
        from F:/wallop/vendor/gems/ruby/1.9.1/gems/eventmachine-1.0.3/lib/eventm
achine.rb:187:in `call'
        from F:/wallop/vendor/gems/ruby/1.9.1/gems/eventmachine-1.0.3/lib/eventm
achine.rb:187:in `run_machine'
        from F:/wallop/vendor/gems/ruby/1.9.1/gems/eventmachine-1.0.3/lib/eventm
achine.rb:187:in `run'
        from F:/wallop/vendor/gems/ruby/1.9.1/gems/thin-1.5.1/lib/thin/backends/
base.rb:63:in `start'
        from F:/wallop/vendor/gems/ruby/1.9.1/gems/thin-1.5.1/lib/thin/server.rb
:159:in `start'
        from F:/wallop/vendor/gems/ruby/1.9.1/gems/rack-1.5.2/lib/rack/handler/t
hin.rb:16:in `run'
        from F:/wallop/vendor/gems/ruby/1.9.1/gems/sinatra-1.4.3/lib/sinatra/bas
e.rb:1408:in `run!'
        from app/app.rb:145:in `<main>'

@tmm1
Copy link
Collaborator

tmm1 commented Dec 20, 2013

Cool. You can try changing that SIGQUIT to SIGKILL instead.

@antch
Copy link

antch commented Dec 21, 2013

That worked, thanks. I'm now having another issue with file permissions. When it goes to clean up the files it fails with a "Permission Denied" and then exits. Research on what it could be is coming up empty for me. I've tried running Wallop from an elevated command prompt but it makes no difference -- I also set the tmp folder to "Full Control: Everyone". Any ideas?

F:/Dev/Ruby193/lib/ruby/1.9.1/fileutils.rb:1406:in `unlink': Permission denied -
 F:/wallop/tmp/39223.ts (Errno::EACCES)
    from F:/Dev/Ruby193/lib/ruby/1.9.1/fileutils.rb:1406:in `block in remove
    _file'

Is it alright if I continue to work through all of the Windows problems in this issue?

@tmm1
Copy link
Collaborator

tmm1 commented Dec 21, 2013

Weird. Try this:

-    rm(Dir.glob("#{transcoding_path}/#{channel}*.ts"))
+    rm(Dir.glob("#{transcoding_path}/#{channel}*.ts"), true)

@antch
Copy link

antch commented Dec 21, 2013

I spent a bit more time trying to work out some of the Windows compatibility issues.

With the ffmpeg command the way it is, executing it will cause the PID of the shell to be returned instead of the ffmpeg process (because of the output redirection). So ffmpeg was never getting killed. By moving that to the call to spawn the cleanup now works.

def self.ffmpeg_command(channel, resolution='1280x720', bitrate='3000k')
  %{#{config['ffmpeg_path']} -threads 4 -f mpegts -analyzeduration 2000000 -i #{raw_stream_url_for_channel(channel)} -bufsize 100Mi -loglevel warning -async 1 -ac 2 -acodec libfdk_aac -b:v #{bitrate} -minrate #{bitrate.gsub(/\d+/){ |o| (o.to_i * 0.80).to_i }} -maxrate #{bitrate} -vcodec libx264 -preset superfast -tune zerolatency -s #{resolution} -flags -global_header -fflags +genpts -map 0:0 -map 0:1 -hls_time 2 -hls_wrap 40 #{transcoding_path}/#{channel}.m3u8}
end

And then (in app.rb):

pid  = POSIX::Spawn::spawn(Wallop.ffmpeg_command(channel, resolution, bitrate), [:out, :err] => ['log/ffmpeg.log', 'w'])

This change has the side effect of allowing the rm to work, even without the :force => true!

I'm not really a Ruby guy so I'm really just hacking away at this.

@antch
Copy link

antch commented Dec 23, 2013

I forked off for Windows compatibility -- I'll submit a pull request at some point in the near future. I do have two questions:

  • Is the exec before the ffmpeg command strictly required on MacOS?
  • What is Wallop's license? I don't see it anywhere in the readme or in the code.

@maddox
Copy link
Owner

maddox commented Dec 23, 2013

What is Wallop's license? I don't see it anywhere in the readme or in the code.

MIT. sorry, I should put it in there.

On Dec 23, 2013, at 11:00 AM, magnafides notifications@github.com wrote:

What is Wallop's license? I don't see it anywhere in the readme or in the code.

@eagledawg
Copy link

antch - any progress on your Windows port? Extremely interested in your outcome...

@antch
Copy link

antch commented Jan 22, 2014

I haven't had time to work on it (though I still plan on doing it), but for
now you should be able to follow the discussion here and get it working.

On Tue, Jan 21, 2014 at 5:20 PM, eagledawg notifications@github.com wrote:

antch - any progress on your Windows port? Extremely interested in your
outcome...


Reply to this email directly or view it on GitHubhttps://github.com//issues/16#issuecomment-32970591
.

@Mibix
Copy link

Mibix commented Jun 5, 2014

Any update on this? Wallop seems like it has advantages to HDHRFling.

@CORRUPT27
Copy link

https://forums.plex.tv/index.php/topic/83233-hdsurfer-plug-in-for-hdhomerun/

On Thu, Jun 5, 2014 at 10:07 AM, Mibix notifications@github.com wrote:

Any update on this? Wallop seems like it has advantages to HDHRFling.


Reply to this email directly or view it on GitHub
#16 (comment).

@maddox
Copy link
Owner

maddox commented Jun 5, 2014

It's not really a matter of needing to port to windows or linux.

It works on linux right now, and I'm sure it works on Windows. You just need to set it up. I know nothing about getting Ruby things working on Windows, or anything for that matter.

Pull requests welcome for Windows instructions.

@Mibix
Copy link

Mibix commented Jun 5, 2014

@CORRUPT27 I have HDSurfer, it doesnt work very good.

@maddox Yeah neither do I :p maybe I was really directing this towards @antch

@musiclandUSA
Copy link

Going to revive this after 4 years because I'm attempting this on a Win 10 machine this week.

@musiclandUSA
Copy link

I'm stuck at those script commands above, the "bundle install" command results in "could not locate gemfile"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants