Opened 4 months ago

Last modified 4 months ago

#6435 new enhancement

don't give file exists error if the output is dev/null is specified as output file.

Reported by: compn Owned by:
Priority: wish Component: ffmpeg
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


F:\>ffmpeg -i traintobusan.mp4 -c copy -f ipod NUL
ffmpeg version N-83243-g2080bc3 Copyright (c) 2000-2017 the FFmpeg developers

built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx

--enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-l
ibass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libi
lbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enab
le-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --e
nable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-
libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink

libavutil 55. 45.100 / 55. 45.100
libavcodec 57. 75.100 / 57. 75.100
libavformat 57. 63.100 / 57. 63.100
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 70.100 / 6. 70.100
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'traintobusan.mp4':


major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.4.101

Duration: 01:58:00.90, start: 0.000000, bitrate: 688 kb/s

Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc), 676x360 [SAR 675:676 DAR 15:8], 599 kb/s, 25 fps,

25 tbr, 12800 tbn, 50 tbc (default)


handler_name : VideoHandler?

Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 80 kb/s (default)

handler_name : SoundHandler?

File 'NUL' already exists. Overwrite ? [y/N]

NUL is aka windows /dev/null , same thing applies on linux.

Change History (6)

comment:1 Changed 4 months ago by compn

  • Summary changed from don't give overwriting error if the output is dev/null or pass 1 is specified. to don't give file exists error if the output is dev/null is specified as output file.

comment:2 Changed 4 months ago by fabienst

Have you heard about -y option ? ffmpeg will then assume you want to overwrite the file if it already exsists

comment:3 Changed 4 months ago by kiroma

Well... yeah. But why not?
The change would be pretty simple, and it's a small enchancement, that doesn't harm anyone I think.
It would be as simple as adding if(filename != "/dev/null") to the beggining of function that detects wether the output file already exists.

comment:4 Changed 4 months ago by heleppkes

This ticket already deals with two different ways to express null output, and i'm sure there is a bunch more on other systems. Such platform specific special behavior doesn't feel like a great idea to handle.

If you don't want any output, why don't you use "-f null"?

comment:5 Changed 4 months ago by bubbleguuum


Sometimes you want to output to /dev/null or NUL but with a format to test if the command would work with that specific format. Or to benchmark.

comment:6 Changed 4 months ago by kiroma

Most of the time I use it for 1st pass in 2-pass encoding.
What if we tested if the output file exists and isn't empty? This way you could also output to a file that has been touched by ffmpeg but doesn't have any data because of misused parameters?

Note: See TracTickets for help on using tickets.