FFMpeg concat demuxer nome do arquivo não seguro

14

Estou usando o ffmpeg dentro do meu aplicativo .net para mesclar (concatenar) alguns vídeos curtos com as mesmas dimensões de codificação e largura e altura. Eu criei um arquivo txt como a documentação diz e este é o meu txt:

concatTextDirectory é o diretório do meu arquivo txt.

file 'C:\Users\mtst\Desktop\Clips\keep\a1.mp4'
file 'C:\Users\mtst\Desktop\Clips\keep\a2.mp4'
file 'C:\Users\mtst\Desktop\Clips\keep\a3.mp4'
file 'C:\Users\mtst\Desktop\Clips\keep\a4.mp4'
file 'C:\Users\mtst\Desktop\Clips\keep\a5.mp4'

E esta é a parte do argumento ffmpeg:

ffmpeg.StartInfo.Arguments = "/c ffmpeg.exe -f concat -i " + concatTextDirectory + " -c copy " + videoOut + " -y -report";

mas não tem resultado e abaixo está o relatório

ffmpeg started on 2016-04-25 at 19:02:30 Report written to
"ffmpeg-20160425-190230.log" Command line: ffmpeg.exe -f concat -i
"C:\Users\mtst\Desktop\Clips\keep\keep.txt" -c copy
"C:\Users\mtst\Desktop\Clips\keep\keep.mp4" -y -report ffmpeg
version N-79546-g13406b6 Copyright (c) 2000-2016 the FFmpeg
developers built with gcc 5.3.0 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-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 --enable-zlib libavutil 55. 22.100 / 55. 22.100 libavcodec 57. 35.100 / 57. 35.100 libavformat 57. 34.102 / 57. 34.102 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 44.100 / 6. 44.100 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 Splitting the commandline. Reading option '-f' ... matched as option
'f' (force format) with argument 'concat'. Reading option '-i' ...
matched as input file with argument
'C:\Users\mtst\Desktop\Clips\keep\keep.txt'. Reading option '-c' ...
matched as option 'c' (codec name) with argument 'copy'. Reading
option 'C:\Users\mtst\Desktop\Clips\keep\keep.mp4' ... matched as
output file. Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'. Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'. Finished
splitting the commandline. Parsing a group of options: global .
Applying option y (overwrite output files) with argument 1. Applying
option report (generate a report) with argument 1. Successfully
parsed a group of options. Parsing a group of options: input file
C:\Users\mtst\Desktop\Clips\keep\keep.txt. Applying option f (force
format) with argument concat. Successfully parsed a group of options. Opening an input file: C:\Users\mtst\Desktop\Clips\keep\keep.txt.
[file @ 00000000027d3ee0] Setting default whitelist 'file,crypto'
[concat @ 00000000027d3800] Unsafe file name
'C:\Users\mtst\Desktop\Clips\keep\a1.mp4' [AVIOContext @
0000000000957ca0] Statistics: 238 bytes read, 0 seeks
C:\Users\mtst\Desktop\Clips\keep\keep.txt: Operation not permitted

como você pode ver no final, diz:

Unsafe file name 'C:\Users\mtst\Desktop\Clips\keep\a1.mp4'

... e operação não permitida. Eu tentei adicionar barras invertidas extras ou alterar barras invertidas para encaminhar barras ou dois-pontos duplos, adicionando aspas duplas ou aspas simples no início ou no final do concatTextDirectory ... nenhuma dessas alterações fez nenhum resultado.

    
por Eftekhari 25.04.2016 / 16:48

1 resposta

23

Execute

ffmpeg.exe -f concat -safe 0 -i
"C:\Users\mtst\Desktop\Clips\keep\keep.txt" -c copy
"C:\Users\mtst\Desktop\Clips\keep\keep.mp4

Ou não use caminhos absolutos (completos) em keep.txt

    
por 25.04.2016 / 17:16