GithubHelp home page GithubHelp logo

CLI not working on Windows? about go2tv HOT 12 CLOSED

alexballas avatar alexballas commented on July 20, 2024
CLI not working on Windows?

from go2tv.

Comments (12)

EZTechhelp avatar EZTechhelp commented on July 20, 2024 1

Thank you so much for including an updated build!

from go2tv.

alexballas avatar alexballas commented on July 20, 2024

Hello! Thanks for taking the time to raise it. This looks like a windows specific error. I'll try to replicate and let you know

from go2tv.

alexballas avatar alexballas commented on July 20, 2024

Could please omit the -t option and just run go2tv.exe -v c:\TheHobbit.mp4. Do you still get the same error?

from go2tv.

EZTechhelp avatar EZTechhelp commented on July 20, 2024

Thanks for the reply

I just tried it without -t but unfortunately the same error occurs

Results

Encountered error(s): interactive screen error: The handle is invalid

Something else that I'm not sure if it could be related or not but wanted to mention. I'm unable to execute go2tv directly from cmd or Powershell and get any output. In order to see any output, I have to use the following syntax (here in Powershell)

go2tv -v c:\TheHobbit.mp4 | out-string

If I dont add the out-string pipe, nothing ever outputs to console. Must have something to do with how it writes to stnd output?

Alternatively this also works in powershell to get output written to a file (though doesn't output to console)

Start-process 'go2tv.exe' -ArgumentList '-v c:\TheHobbit.mp4' -RedirectStandardOutput "c:\logs\go2tv_standard.log"  -RedirectStandardError "c:\logs\go2tv_error.log"

Here is another example using .NET directly in PS. This will output standard and errors to console. So it appears to only work if using output redirection. I dont know anything about go so not sure if any of this information is helpful but sharing it all the same

$process = [System.Diagnostics.Process]::new()
$process.StartInfo.FileName = 'go2tv.exe'
$process.StartInfo.Arguments = '-v c:\TheHobbit.mp4'
$process.StartInfo.UseShellExecute = $false
$process.StartInfo.RedirectStandardOutput = $true
$process.StartInfo.RedirectStandardError = $true
$process.Start()
[console]::WriteLine($process.StandardOutput.ReadToEnd())
[console]::WriteLine($process.StandardError.ReadToEnd())
$process.WaitForExit()

Unfortunately any of these methods results in the same original error. I just had to get a bit creative to finally get any output to know what was going on

from go2tv.

alexballas avatar alexballas commented on July 20, 2024

I have the feeling that the reason you can't get any media playback is the fact that there is no attached console to the application. When I first built the application for Windows, there was a command prompt appearing when I double clicked the app. The solution to that was to use the "windowsgui" flag during compilation. I didn't realize that this flag would cause issues with ability to pass arguments from cmd. I’m a Linux user myself and nobody raised it until now.
There is no clean way to both get a “prompt-less” GUI and a fully working command line. I did find some workarounds online, but I need to invest some more time into it.

I compiled the latest stable version without this flag just to confirm if this is what is causing the "The handle is invalid" error. Could you please test it and let me know if that fixes it?
go2tv.zip

from go2tv.

EZTechhelp avatar EZTechhelp commented on July 20, 2024

Ah ok that makes sense. I had wondered if there were little to few Windows users. Honesty, for my needs I don't really need any gui at all since I want to incorporate it into automation script/app. So if I can use it 100% command-line, that is perfect for me!

I just tested the upload you provided and I'm happy to say it now works as expected! I tested quickly with go2tv -v c:\TheHobbit.mp4 and casting started and worked first attempt. This is great!

I was also able to still use the GUI without any issue as well

I'll do some more extensive testing in a day or so (such as casting URLs and trying transcoding with -tc..etc) but otherwise this version looks like it will solve my issue. Can't thank you enough!

from go2tv.

alexballas avatar alexballas commented on July 20, 2024

No worries, glad this fixed the issue. I also have https://github.com/alexballas/go2tv/tree/main/cmd/go2tv-lite which is an ever lighter version. No gui and no ability to use hot keys in the CLI. Just raw streaming. Also pasting it here in case you want to use that instead.
go2tv-lite.zip

from go2tv.

EZTechhelp avatar EZTechhelp commented on July 20, 2024

Oh wow, now I feel kind of silly for not seeing that! That is actually exactly what I was looking for! Thank you!

One last question and this is a bit off topic but, is there a way to transcode with ffmpeg and pass parameters to it through go2tv when casting from URLs? Such as if I want to change the encoding format or other parameters?. I'm doing some streaming through libvlc and I'm having a lot of trouble with its transcoding while also streaming via HTTP. If I can bypass transcoding at all with libvlc and instead do so while casting through go2tv, that would simplify my life significantly!

from go2tv.

alexballas avatar alexballas commented on July 20, 2024

Transcoding in Go2TV with URLs works by passing the http stream through pipes to the ffmpeg command as seen here https://github.com/alexballas/go2tv/blob/main/utils/transcode_windows.go#L24-L45. It's all hard coded as the goal of the app is to provide an easy way for everyone to stream stuff. If you have some specific ffmpeg parametres in mind you can change the code in that part and recompile.

from go2tv.

EZTechhelp avatar EZTechhelp commented on July 20, 2024

Ah ok understood and makes sense. I haven't ever compiled with go before so it will be a good learning exercise at least.

Thanks again!

from go2tv.

alexballas avatar alexballas commented on July 20, 2024

Nothing further to do in this issue. Resolving.

from go2tv.

alexballas avatar alexballas commented on July 20, 2024

go2tv_1.15.zip

from go2tv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.