FFmpeg "Pipe:0: Se encontraron datos no válidos al procesar archivos TGA de entrada"

FFmpeg "Pipe:0: Se encontraron datos no válidos al procesar archivos TGA de entrada"

Me encontré con un problema al usar FFmpeg para procesar archivos TGA en un archivo MP4. Esta es una versión de lo que estoy haciendo que demuestra el problema.

ffmpeg -loglevel debug -y -r 60 -codec targa -i pipe:0 -r 60 -vf "tblend=average,framestep=2,tblend=average,framestep=2,tblend=average,framestep=2,setpts=0.125" -vcodec h264 -preset slow -crf 18 "Z:\path\to\final.mp4" < "Z:\path\to\image.tga"

Da este error:

ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 6.3.0 (GCC) configuration: --enable-gpl --enable-version3 --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --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-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --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-zlib libavutil 55. 34.101 / 55. 34.101 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.101 / 57. 56.101 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libswscale 4. 2.100 / 4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 / 54. 1.100 Splitting the commandline. Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'. Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'. Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with argument '60'. Reading option '-codec' ... matched as option 'codec' (codec name) with argument 'targa'. Reading option '-i' ... matched as input url with argument 'pipe:0'. Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with argument '60'. Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'tblend=average,framestep=2,tblend=average,framestep=2,tblend=average,framestep=2,setpts=0.125'. Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'h264'. Reading option '-preset' ... matched as AVOption 'preset' with argument 'slow'. Reading option '-crf' ... matched as AVOption 'crf' with argument '18'. Reading option 'Z:\path\to\final.mp4' ... matched as output url. Finished splitting the commandline. Parsing a group of options: global . Applying option loglevel (set logging level) with argument debug. Applying option y (overwrite output files) with argument 1. Successfully parsed a group of options. Parsing a group of options: input url pipe:0. Applying option r (set frame rate (Hz value, fraction or abbreviation)) with argument 60. Applying option codec (codec name) with argument targa. Successfully parsed a group of options. Opening an input file: pipe:0. [pipe @ 0000000000727f40] Setting default whitelist 'crypto' [AVIOContext @ 0000000001fcb3e0] Statistics: 1048576 bytes read, 0 seeks pipe:0: Invalid data found when processing input

¿Alguna idea de lo que estoy haciendo mal? ¡Gracias!

La implementación real:

Tengo un programa externo que genera archivos TGA y quiero usar Java para leer esos archivos, enviarlos a FFmpeg y luego eliminarlos.

Respuesta1

Debido a la falta de un analizador TARGA, sólo los TGA de tamaño de archivo fijo (es decir, sin compresión RLE) se pueden canalizar a ffmpeg.

ffmpeg -f image2pipe -framerate 60 -vcodec targa -frame_size 6220844 -i pipe:0 ... "final.mp4" < image.tga

El valor frame_size debe ser el tamaño del archivo, en bytes, de sus archivos TARGA.

información relacionada