Alex Blokha
Alex Blokha

Reputation: 1171

Invalid data found when processing input. No start code is found

I am trying to concat video from many files. But sometimes I receive an error: "Invalid data found when processing input".

So, I am trying to iterate over files with ffprobe and find invalid files. Here is the error.

ffprobe started on 2020-06-28 at 16:06:39
Report written to "ffreport.log"
Log level: 32
Command line:
"f:\\prog\\ffmpeg\\bin\\ffprobe.exe" -i Rec496_20200423123337_A_1.avi
ffprobe version git-2020-03-23-ba698a2 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20200122
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --e
nable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrn
b --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-lib
soxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --e
nable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-l
ibvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-
libaom --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. 42.101 / 56. 42.101
  libavcodec     58. 76.100 / 58. 76.100
  libavformat    58. 42.100 / 58. 42.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.100 /  7. 77.100
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
[avi @ 000002510398e1c0] non-interleaved AVI
[h264 @ 00000251039a0480] missing picture in access unit with size 256
[extract_extradata @ 0000025103996740] No start code is found.
Rec496_20200423123337_A_1.avi: Invalid data found when processing input

Questions:

  1. How can this be fixed, so I don't need to iterate with ffprobe and just use concat (command line: f:\prog\ffmpeg\bin\ffmpeg.exe -f concat -safe 0 -i mylist.txt -c copy output-xx.avi)?
  2. If not, how can I receive an error in my .bat file and move "invalid" file to "Error" folder?

Upvotes: 2

Views: 3905

Answers (1)

Alex Blokha
Alex Blokha

Reputation: 1171

Ok, here is the solution for .bat file. It moves file to "Err" folder, if found word "Invalid" in log.

set FFREPORT=file=ffreport.log:level=32

IF NOT EXIST "err" md err

for %%i in (*.avi) do (
f:\prog\ffmpeg\bin\ffprobe.exe -i %%i 
echo 'errlevel:' + %ERRORLEVEL% >> err.txt  

find /c "Invalid" ffreport.log && ( move %%i err )

type ffreport.log >> err.txt  
)

Upvotes: 1

Related Questions