Windows named pipe reopen

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
pivoo
New Cone
New Cone
Posts: 9
Joined: 29 Jul 2011 08:50

Windows named pipe reopen

Postby pivoo » 19 Oct 2011 16:24

Hi everyone,

I have program which writes mpeg ts stream to windows named pipe.

I can render this stream with VLC:

Code: Select all

vlc.exe stream://\\.\pipe\RavisPlayer1239
Everything works OK.
Than in VLC I do "stop" and than "play", and it show me error, that it "can't open MRL"

If I try to open VLC again, it says me the same. So I need to reopen my application that writes to named pipe.

Is this behaviour normal?

This is log, when I try to re-play:
main debug: processing request item \\.\pipe\RavisPlayer1239 node Плейлист skip 0
main debug: resyncing on \\.\pipe\RavisPlayer1239
main debug: \\.\pipe\RavisPlayer1239 is at 1
main debug: starting new item
main debug: creating new input thread
main debug: Creating an input for '\\.\pipe\RavisPlayer1239'
main debug: thread (input) created at priority 1 (../.././src/input/input.c:220)
main debug: thread started
main debug: using timeshift granularity of 50 MiB
main debug: using timeshift path 'C:\Users\IE326~1.PAV\AppData\Local\Temp'
main debug: `stream://\\.\pipe\RavisPlayer1239' gives access `stream' demux `' path `\\.\pipe\RavisPlayer1239'
main debug: creating demux: access='stream' demux='' path='\\.\pipe\RavisPlayer1239'
main debug: looking for access_demux module: 0 candidates
main debug: no access_demux module matched "stream"
main debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
main debug: creating access 'stream' path='\\.\pipe\RavisPlayer1239'
main debug: looking for access module: 1 candidate
filesystem debug: opening file `\\.\pipe\RavisPlayer1239'
filesystem error: cannot open file \\.\pipe\RavisPlayer1239 (Invalid argument)
main debug: no access module matching "stream" could be loaded
main debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
main error: open of `stream://\\.\pipe\RavisPlayer1239' failed: (null)
main debug: finished input
main debug: thread ended
main debug: dead input
main debug: thread times: real 0m0.002000s, kernel 0m0.000000s, user 0m0.000000s
main debug: TIMER input launching for '\\.\pipe\RavisPlayer1239' : 2.000 ms - Total 2.000 ms / 1 intvls (Avg 2.000 ms)
main debug: changing item without a request (current 1/2)
main debug: nothing to play

This is log when I press "stop" on VLC:
main debug: incoming request - stopping current input
main debug: dying input
main warning: resampling stopped after 1223000 usec (drift: 24428)
main debug: control type=0
main debug: control: stopping input
main debug: dying input
main warning: can't get output picture
avcodec warning: disabling direct rendering
avcodec warning: cannot decode one frame (1268 bytes)
main debug: thread times: real 0m25.179440s, kernel 0m0.015600s, user 0m0.608403s
avcodec debug: ffmpeg codec (H264 - MPEG-4 AVC (part 10)) stopped
main debug: removing module "avcodec"
main debug: killing decoder fourcc `h264', 13 PES in FIFO
main debug: [0] 2 0
main debug: [1] 2 0
main debug: [2] 4 0
main debug: [3] 2 0
main debug: [4] 2 0
main debug: [5] 2 0
main debug: [6] 2 0
main debug: [7] 4 0
main debug: [8] 2 0
main debug: [9] 2 0
main debug: [10] 2 0
main debug: [11] 2 0
main debug: [12] 4 0
main debug: [13] 2 0
main debug: [14] 2 0
main debug: [15] 2 0
main debug: [16] 2 0
main debug: [17] 2 0
main debug: [18] 2 0
main debug: [19] 2 0
main debug: [20] 2 0
main debug: [21] 2 0
main debug: [22] 2 0
main debug: [23] 2 0
main debug: saving a free vout
main debug: removing module "packetizer_h264"
main warning: received buffer in the future
main debug: thread times: real 0m25.180440s, kernel 0m0.000000s, user 0m0.109200s
main debug: removing module "faad"
main debug: killing decoder fourcc `mp4a', 22 PES in FIFO
main debug: removing module "scaletempo"
main debug: removing module "ugly_resampler"
main debug: thread ended
main debug: thread times: real 0m24.922425s, kernel 0m0.000000s, user 0m0.000000s
main debug: removing module "waveout"
main debug: removing module "float32_mixer"
main debug: releasing aout
main debug: removing module "packetizer_mpeg4audio"
ts debug: pid list:
ts debug: - pid[0] seen
ts debug: - pid[66] seen
ts debug: - pid[768] seen
ts debug: - pid[773] seen
main debug: Program doesn't contain anymore ES
ts debug: - pid[784] seen
ts debug: - pid[8191] seen
main debug: removing module "ts"
main debug: removing module "stream_filter_record"
main debug: removing module "filesystem"
main debug: thread ended
main debug: dead input
main debug: thread times: real 0m25.874479s, kernel 0m0.046800s, user 0m0.000000s
main debug: destroying useless vout
direct3d debug: Direct3D scene released successfully
direct3d debug: DirectXEventThread terminating
direct3d debug: DirectXCloseWindow
direct3d debug: WinProc WM_DESTROY
qt4 debug: releasing video...
qt4 debug: IM: Deleting the input
main debug: TIMER input launching for '\\.\pipe\RavisPlayer1239' : 685.000 ms - Total 685.000 ms / 1 intvls (Avg 685.000 ms)
qt4 debug: Video is not needed anymore
main debug: removing module "qt4"
main debug: removing module "direct3d"
main debug: removing module "vout_wrapper"
main debug: removing module "blend"
main debug: removing module "freetype"
main debug: removing module "yuvp"
main debug: removing module "swscale"
To be more clear, this is log while first (successful) play:
main debug: processing request item \\.\pipe\RavisPlayer1239 node Плейлист skip 0
main debug: resyncing on \\.\pipe\RavisPlayer1239
main debug: \\.\pipe\RavisPlayer1239 is at 2
main debug: starting new item
main debug: creating new input thread
main debug: Creating an input for '\\.\pipe\RavisPlayer1239'
main debug: thread (input) created at priority 1 (../.././src/input/input.c:220)
main debug: thread started
main debug: using timeshift granularity of 50 MiB
main debug: using timeshift path 'C:\Users\IE326~1.PAV\AppData\Local\Temp'
main debug: `stream://\\.\pipe\RavisPlayer1239' gives access `stream' demux `' path `\\.\pipe\RavisPlayer1239'
main debug: creating demux: access='stream' demux='' path='\\.\pipe\RavisPlayer1239'
main debug: looking for access_demux module: 0 candidates
main debug: no access_demux module matched "stream"
main debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
main debug: creating access 'stream' path='\\.\pipe\RavisPlayer1239'
main debug: looking for access module: 1 candidate
filesystem debug: opening file `\\.\pipe\RavisPlayer1239'
main debug: using access module "filesystem"
main debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
main debug: Using AStream*Stream
main debug: pre buffering
qt4 debug: IM: Setting an input
main debug: received first data after 43 ms
main debug: pre-buffering done 1024 bytes in 0s - 23 KiB/s
main debug: looking for stream_filter module: 2 candidates
main debug: no stream_filter module matching "any" could be loaded
main debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
main debug: looking for stream_filter module: 1 candidate
main debug: using stream_filter module "stream_filter_record"
main debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
main debug: creating demux: access='stream' demux='' path='\\.\pipe\RavisPlayer1239'
main debug: looking for demux module: 52 candidates
so the error is here:
filesystem debug: opening file `\\.\pipe\RavisPlayer1239'
filesystem error: cannot open file \\.\pipe\RavisPlayer1239 (Invalid argument)
Why?

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Windows named pipe reopen

Postby VLC_help » 20 Oct 2011 16:07

There are some limitations/bugs in the filesystem open. One that we are aware of is that the timestamp might cause issues in case it something like 1.1.1970 (at least it does on NAS drive).

pivoo
New Cone
New Cone
Posts: 9
Joined: 29 Jul 2011 08:50

Re: Windows named pipe reopen

Postby pivoo » 21 Oct 2011 12:01

The error was not in VLC.
I still didn't fix my problem completly, but it was error in sending application which writes to named pipe.
This article helped me do more correct writing to pipe:
http://msdn.microsoft.com/en-us/library ... s.85).aspx

pivoo
New Cone
New Cone
Posts: 9
Joined: 29 Jul 2011 08:50

Re: Windows named pipe reopen

Postby pivoo » 24 Oct 2011 13:57

I used article http://msdn.microsoft.com/en-us/library ... S.85).aspx to make named pipe sending side better. And now it works fine.
But I still have problems, when embeded VLC can not open named pipe. I use it from python script. And I couldn't find VLC log files, so I can just guess..

I call stop() for MediaPlayer instance and than immediately I call play(). Sometimes it is not playing.

After some experiments I suppose that the reason why it happens sometimes - is that previous stop() operation wasn't complete and didn't release named pipe handle.
I wrote simple class which can read from named pipe and log all events. I placed it instead of VLC. So I had same behavior - sometimes it couldn't open pipe, because previous stop() operation was not complete, when I added waiting for stop() operation complete, and start() only after that - all become good.

So I tried to do the same with VLC.

I tried to use VLC MediaPlayer->is_playing() (or libvlc_media_player_is_playing) to find out when stop() operation complete, and use code like this (python):

Code: Select all

self.MediaPlayer.stop() while self.MediaPlayer.is_playing() == 1: print "Still playing" self.StartVLC() #function where call to self.MediaPlayer.play()
But I never got printed "Still playing".

And now I can't understand is_playing() returns 0 when stop() just called, but not after stop() procedure complete and handle to pipe released?

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Windows named pipe reopen

Postby VLC_help » 24 Oct 2011 18:04

Bindings or core might have a bug in that case.

beyond005
New Cone
New Cone
Posts: 1
Joined: 08 Nov 2011 09:58

Re: Windows named pipe reopen

Postby beyond005 » 08 Nov 2011 10:02

Hello pivoo,

I am trying the same thing as you but cannot receive data from pipe through VLC.

The log just like this:
main debug: `file://\\.\pipe\mynamedpipe' gives access `file' demux `' path `\\\\.\pipe\mynamedpipe'
main debug: creating demux: access='file' demux='' path='\\\\.\pipe\mynamedpipe'
main debug: looking for access_demux module: 2 candidates
dvdnav warning: cannot open DVD (\\\\.\pipe\mynamedpipe)
main debug: no access_demux module matching "file" could be loaded
main debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
main debug: creating access 'file' path='\\\\.\pipe\mynamedpipe'
main debug: Creating an input for '\\.\pipe\mynamedpipe'
main debug: looking for access module: 2 candidates
filesystem debug: opening file `\\\\.\pipe\mynamedpipe'
filesystem error: cannot open file \\\\.\pipe\mynamedpipe (No such file or directory)
main debug: no access module matching "file" could be loaded
main debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
main error: open of `file://\\.\pipe\mynamedpipe' failed: (null)
main debug: finished input
main debug: thread ended
main debug: dead input
main debug: thread times: real 0m0.002000s, kernel 0m0.000000s, user 0m0.000000s
main debug: TIMER input launching for '\\.\pipe\mynamedpipe' : 2.000 ms - Total 2.000

Could you help to send a work copy of your test code to help me in this issue?

Thanks.
Beyond005

pivoo
New Cone
New Cone
Posts: 9
Joined: 29 Jul 2011 08:50

Re: Windows named pipe reopen

Postby pivoo » 22 Mar 2012 12:28

Hello Beyond005,

sorry, didn't see your question. If you still need help please send me message.

Concepting
New Cone
New Cone
Posts: 4
Joined: 26 Mar 2012 18:15
VLC version: 2.0.0 / 2.0.1
Operating System: Win7 / Ubuntu / iOS

Re: Windows named pipe reopen

Postby Concepting » 26 Mar 2012 18:25

Hello,

I have the same error when trying to open a pipe. Does anyone have a working code as an example?

Best.


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: BrainDamage and 36 guests