Opened 6 years ago

Last modified 6 years ago

#7316 new defect

Windows named pipe output prompts to overwrite

Reported by: James Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: win32
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug: Using Named Pipe syntax on Windows results in an interactive prompt to overwrite the target file. Named pipes aren't really files, they're more like a listening server socket, so this prompt makes no sense.

How to reproduce: First, listen to a new named pipe. This is outside the scope of this issue, but this StackOverflow answer shows how to listen via NodeJS, for example. Say your pipe is \\.\pipe\SomePipeName, the relevant command would be

% ffmpeg -i infile.ts -codec copy -f data "\\.\pipe\SomePipeName"
ffmpeg version 3.4 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 7.2.0 (GCC)
...
File '\\.\pipe\SomePipeName' already exists. Overwrite ? [y/N]

This isn't an error condition and shouldn't result in any kind of prompt. If nobody is listening on that pipe name, which is in fact an error, the message is instead "no such file or directory". This sort of makes sense but it would be more accurate to say that the pipe couldn't connect.

Change History (2)

comment:1 by Carl Eugen Hoyos, 6 years ago

Keywords: win32 added; named-pipe Windows removed
Version: 3.4unspecified

Please test current FFmpeg git head and provide the command line you tested together with the complete, uncut console output to make this a valid ticket.
If you know how to distinguish between file and pipe on Windows please consider sending a patch - made with git format-patch - to the development mailing list.

comment:2 by James, 6 years ago

OK, I grabbed the nightly build from here, below is the uncut console output -- until the prompt is answered, which does result in the output being piped successfully.

> ffmpeg.exe -i "sample.ts" -map 0:1 -codec copy -f data "\\.\pipe\klvin"
ffmpeg version N-91473-gc5329d64b1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7.3.1 (GCC) 20180710
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 18.102 / 56. 18.102
  libavcodec     58. 21.105 / 58. 21.105
  libavformat    58. 17.101 / 58. 17.101
  libavdevice    58.  4.101 / 58.  4.101
  libavfilter     7. 25.100 /  7. 25.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
[mpegts @ 0000024c14d3a200] start time for stream 1 is not set in estimate_timings_from_pts
Input #0, mpegts, from 'sample.ts':
  Duration: 00:03:14.88, start: 10.000000, bitrate: 4187 kb/s
  Program 1
    Stream #0:0[0x1e1]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1280x720, 60 fps, 60 tbr, 90k tbn, 180k tbc
    Stream #0:1[0x1f1]: Data: klv (KLVA / 0x41564C4B)
File '\\.\pipe\klvin' already exists. Overwrite ? [y/N]
Note: See TracTickets for help on using tickets.