Opened 4 years ago

Last modified 4 years ago

#8492 new defect

tee muxer silently overwrites output files

Reported by: Carl Eugen Hoyos Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: tee
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

As reported on irc, the tee muxer silently overwrites output files:

$ touch out.avi
$ ffmpeg -f lavfi -i testsrc2=d=1 -map 0 -vcodec mpeg4 -f tee out.avi
ffmpeg version N-96456-g39b60359db Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9 (SUSE Linux)
  configuration: --enable-gpl --enable-gnutls --enable-libx264 --enable-libx265 --enable-libaom
  libavutil      56. 38.100 / 56. 38.100
  libavcodec     58. 66.100 / 58. 66.100
  libavformat    58. 35.104 / 58. 35.104
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 71.100 /  7. 71.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, lavfi, from 'testsrc2=d=1':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
Output #0, tee, to 'out.avi':
  Metadata:
    encoder         : Lavf58.35.104
    Stream #0:0: Video: mpeg4, yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.66.100 mpeg4
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
[Parsed_testsrc2_0] EOF timestamp not reliable
frame=   25 fps=0.0 q=10.1 Lsize=N/A time=00:00:01.00 bitrate=N/A speed=42.2x    
video:82kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Change History (4)

comment:1 by Cigaes, 4 years ago

This is likely true for all muxers with AVFMT_NOFILE that still write output to files. A quick check shows that it applies to image2 as well.

Ans the issue is not in lavf, since the overwrite test is purely a ffmpeg*.c feature.

in reply to:  1 comment:2 by Carl Eugen Hoyos, 4 years ago

Replying to Cigaes:

And the issue is not in lavf, since the overwrite test is purely a ffmpeg*.c feature.

How is that related to this ticket?

comment:3 by Cigaes, 4 years ago

You set “Component: libavformat”.

in reply to:  3 comment:4 by Carl Eugen Hoyos, 4 years ago

Replying to Cigaes:

You set “Component: libavformat”.

What I meant was: How is this ticket about a muxer (implemented in libavformat) that - undocumented afaict - silently overwrites output files related to "purely a ffmpeg*.c feature"?

Note: See TracTickets for help on using tickets.