Opened 3 months ago

Closed 2 months ago

#8813 closed defect (fixed)

ffmpeg can't concat file with '..' in the filename

Reported by: nemya9066 Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: concat
Cc: liuqi05@kuaishou.com, sean.gugler@gmail.com, cus Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

I was trying to concatenate a bunch of video I downloaded from the web when I discovered than ffmpeg can't read file name such as 'input..file.mp4' from a file.
It gives the error 'Impossible to open 'input..file.mp4' no such file or directory'

How to reproduce:

create a file containing two video filename such as this:

file 'video.mp4'
file 'video..copy.mp4'

try to concatenate them with this command:
ffmpeg -f concat -safe 0 -i file -c copy output.mp4

ffmpeg should give an error that the file 'video..copy.mp4' couldn't be found
But ffmpeg can work with the file 'video..copy.mp4' if we give it as a command line argument this command should work:
ffmpeg -i video..copy.mp4 output.mp3

Change History (7)

comment:1 Changed 3 months ago by Cigaes

Works for me. Complete console output missing.

comment:2 Changed 3 months ago by artem

I have a similar problem in Windows with .. being ignored by the concat demuxer.

Source video file: c:\tmp\ffmpeg_bug_8813\GOPR0083.MP4

c:\tmp\ffmpeg_bug_8813\subdir\myconcatlist.txt contains:

file '../GOPR0083.MP4'

Executed in c:\tmp\ffmpeg_bug_8813\subdir

ffmpeg -f concat -safe 0 -i myconcatlist.txt -c:v copy -c:a copy concat_result.mp4
ffmpeg version git-2020-07-21-b5f1e05 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200621
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --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-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 55.100 / 56. 55.100
  libavcodec     58. 97.100 / 58. 97.100
  libavformat    58. 49.100 / 58. 49.100
  libavdevice    58. 11.101 / 58. 11.101
  libavfilter     7. 87.100 /  7. 87.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
[concat @ 0000025afd52d240] Impossible to open 'GOPR0083.MP4'
myconcatlist.txt: No such file or directory

If I move the source file from c:\tmp\ffmpeg_bug_8813\ to c:\tmp\ffmpeg_bug_8813\subdir then the same command executed in subdir works fine even without changing myconcatlist.txt (i.e. "../" prefix is still there):

ffmpeg -f concat -safe 0 -i myconcatlist.txt -c:v copy -c:a copy concat_result.mp4
ffmpeg version git-2020-07-21-b5f1e05 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200621
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --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-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 55.100 / 56. 55.100
  libavcodec     58. 97.100 / 58. 97.100
  libavformat    58. 49.100 / 58. 49.100
  libavdevice    58. 11.101 / 58. 11.101
  libavfilter     7. 87.100 /  7. 87.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000254bf4f6cc0] Auto-inserting h264_mp4toannexb bitstream filter
[concat @ 00000254bf4ed240] Could not find codec parameters for stream 2 (Unknown: none): unknown codec
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
[concat @ 00000254bf4ed240] Could not find codec parameters for stream 3 (Unknown: none): unknown codec
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, concat, from 'myconcatlist.txt':
  Duration: N/A, start: 0.000000, bitrate: 58236 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 2704x1520 [SAR 1:1 DAR 169:95], 58108 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 119.88 tbc
    Metadata:
      creation_time   : 2015-06-06T11:40:09.000000Z
      handler_name    :         GoPro AVC
      encoder         : GoPro AVC encoder
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      creation_time   : 2015-06-06T11:40:09.000000Z
      handler_name    :         GoPro AAC
    Stream #0:2: Unknown: none
    Stream #0:3: Unknown: none
Output #0, mp4, to 'concat_result.mp4':
  Metadata:
    encoder         : Lavf58.49.100
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 2704x1520 [SAR 1:1 DAR 169:95], q=2-31, 58108 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 60k tbc
    Metadata:
      creation_time   : 2015-06-06T11:40:09.000000Z
      handler_name    :         GoPro AVC
      encoder         : GoPro AVC encoder
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      creation_time   : 2015-06-06T11:40:09.000000Z
      handler_name    :         GoPro AAC
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 1379 fps=0.0 q=-1.0 Lsize=  163578kB time=00:00:22.99 bitrate=58268.9kbits/s speed=26.5x
video:163189kB audio:360kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.017858%

comment:3 Changed 3 months ago by stevenliu

Version 0, edited 3 months ago by stevenliu (next)

comment:4 Changed 3 months ago by stevenliu

  • Cc liuqi05@kuaishou.com added

comment:5 Changed 3 months ago by cehoyos

  • Component changed from undetermined to avformat
  • Keywords concat added
  • Version changed from 4.2 to git-master

comment:6 Changed 3 months ago by sgugler

  • Cc sean.gugler@gmail.com added

comment:7 Changed 2 months ago by cus

  • Cc cus added
  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.