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

--input-terminal=yes doesn't work on Windows via STDIN #5005

Open
garoto opened this issue Oct 17, 2017 · 7 comments
Open

--input-terminal=yes doesn't work on Windows via STDIN #5005

garoto opened this issue Oct 17, 2017 · 7 comments

Comments

@garoto
Copy link
Contributor

garoto commented Oct 17, 2017

mpv version and platform

mpv 0.27.0 (C) 2000-2017 mpv/MPlayer/mplayer2 projects
 built on Wed Sep 13 04:18:08 CEST 2017
ffmpeg library versions:
   libavutil       55.74.100
   libavcodec      57.105.100
   libavformat     57.82.100
   libswscale      4.7.103
   libavfilter     6.105.100
   libswresample   2.8.100
ffmpeg version: N-87286-g6ce4a635ed

Windows 8.1

Reproduction steps

Play a media file via stdin (e.g. 7z.exe e "F:\Path\To\Some\rarfile.rar" -so|mpv.com --no-config --input-terminal=yes --terminal=yes --force-seekable=yes -)

Expected behavior

mpv should accept and respond to keyboard input when the cmd.exe window has focus.

Actual behavior

Keyboard input is ignored.

Log file

http://sprunge.us/gfaZ

@garoto garoto changed the title --input-terminal=yes doesn't work on Windows --input-terminal=yes doesn't work on Windows via STDIN Oct 17, 2017
@garoto
Copy link
Contributor Author

garoto commented Oct 17, 2017

Just remembered that youtube-dl is a more readly accessible way to get mpv to play media from stdin on Windows: youtube-dl -f best -o - <a-youtube-watch-url>|mpv --input-terminal=yes --terminal=yes --force-seekable=yes -

That should work.

@haasn
Copy link
Member

haasn commented Oct 17, 2017

Duplicate of #4622.

Also, mpv has built-in youtube-dl support, so you don't need to pipe it in like that.

EDIT: Actually, never mind; that PR only addresses this issue on linux - unless windows suddenly grows a /dev/tty it still wouldn't work.

@rossy
Copy link
Member

rossy commented Oct 17, 2017

Actually, attached consoles on Windows are surprisingly similar to controlling terminals on Linux. A Windows process can have an attached console, which is used for job control and Ctrl+C/Ctrl+Break handling, even if all the stdio streams are redirected. There's no /dev/tty, but there are similar special "files" CONIN$ and CONOUT$ which will open the current framebuffer on the attached console.

Part of the reason I'm interested in getting #4622 solved is because we could easily port the change to terminal-win.c for equivalent behaviour on Windows.

@garoto
Copy link
Contributor Author

garoto commented Oct 17, 2017

Also, mpv has built-in youtube-dl support, so you don't need to pipe it in like that.

Just to be clear, that was just an(other) example for people interested in trying to reproduce the issue on Windows, since the whole stdin/stdout manipulation arsenal avaiable is much more limited, as you most likely is aware.

I coudn't think of anything else other than the two mentioned examples.

@garoto
Copy link
Contributor Author

garoto commented Oct 23, 2017

So what's happening with PR #4622 and why is @wm4 against it? I can only assume "complicated reasons" would be a mundane explanation for ppl like me, but still...

@haasn
Copy link
Member

haasn commented Oct 23, 2017

It is a mystery

@ksge
Copy link

ksge commented Jan 11, 2019

hello to all,
I need to realize a script who plays some videoclips in a sequence but cannot use a playlist because i need to pipe each time a video is finished wiith a command like this:
../ccrypt/ccrypt -c -K mykey ./myclip.mkv.cpt | mpv -

my problem is that doing in this way player closes and opens after each file finishes creating an annoying flash. does anyone has some tip to do so keeping the player open? thanks in advice

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

No branches or pull requests

5 participants