Opened 17 months ago

Closed 17 months ago

Last modified 17 months ago

#10033 closed defect (duplicate)

"protocol not found" when filename contains a colon

Reported by: slhck Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Summary of the bug: ffmpeg incorrectly detects a different output protocol for a file that contains a colon in its name.

How to reproduce:

➜ ffmpeg -f lavfi -i testsrc -t 1 foo:bar.mkv
ffmpeg version N-63101-gc92edd969a-static  Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
  libavutil      57. 36.101 / 57. 36.101
  libavcodec     59. 42.104 / 59. 42.104
  libavformat    59. 30.101 / 59. 30.101
  libavdevice    59.  8.101 / 59.  8.101
  libavfilter     8. 48.100 /  8. 48.100
  libswscale      6.  8.108 /  6.  8.108
  libswresample   4.  9.100 /  4.  9.100
  libpostproc    56.  7.100 / 56.  7.100
Input #0, lavfi, from 'testsrc':
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: wrapped_avframe, rgb24, 320x240 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 25 tbn
foo:bar.mkv: Protocol not found

This particularly causes confusion when using ISO-8601 dates in the output filename, e.g. "2022-11-14T10:19:28.494Z.mkv".

I can get around it by explicitly specifying the protocol:

➜ ffmpeg -f lavfi -i testsrc -t 1 file:$(pwd)/foo:bar.mkv

I am aware that per RFC 3986, even "foo:bar" is a valid URI, but to end-users the error message may be too confusing.

Would it be possible to apply the file protocol for such output filenames automatically?

Alternatively, the user should be warned that if they specified a filename (i.e. implicitly meant to use the file protocol), they should prefix their output with file:.

Change History (2)

comment:1 by Carl Eugen Hoyos, 17 months ago

Component: ffmpegundetermined
Resolution: duplicate
Status: newclosed

Duplicate of ticket #5384

comment:2 by slhck, 17 months ago

Thanks for the pointer to the other issue, but this is missing the alternative suggestion to show a warning to the user.

Basically: if a protocol error is raised, it could show: "Did you mean to use file:$filename" instead?", where $filename is whatever the user specified originally.

Note: See TracTickets for help on using tickets.