[FFmpeg-user] Where's the error?
Oliver Fromme
oliver at fromme.com
Wed Sep 18 19:55:08 EEST 2024
Laine wrote:
> I use ffmpeg on my Mac without understanding much of it. I'd like to
> be able to determine where in the video occasional reported errors
> occur so I can view the affected passage in the output. My questions
> about the following command and output are, "do the errors reported
> include the time in the video where the error occurred, and if so,
> how do I calculate that time in hours, minutes, and seconds so I can
> view its containing passage in the encoded video?"
>
> The errors I'm referring to in the output are
>
> [h264 @ 0x127f33070] concealing 858 DC, 858 AC, 858 MV errors in B frame0.4kbits/s dup=76 drop=0 speed=8.83x
> [h264 @ 0x127f44130] left block unavailable for requested intra mode
> [h264 @ 0x127f44130] error while decoding MB 0 30, bytestream 49191
> [h264 @ 0x127f44130] concealing 4609 DC, 4609 AC, 4609 MV errors in P frame
> [vist#0:0/h264 @ 0x127f05730] [dec:h264 @ 0x127f06d30] corrupt decoded frame
There are no time stamps in the above output.
However, when you use the option ``-stats'', FFmpeg prints progress
information. I think this is even the default (unless you give the
option ``-nostats''). It looks like this:
frame= 175 fps= 12 q=29.9 Lsize= 925kB time=00:00:08.12 bitrate= 932.6kbits/s speed=0.549x
^^^^^^^^^^ ^^^^^^^^^^^^^^^^
As you can see, it contains a frame number as well as a time stamp
in HH:MM:SS.ss format.
The problem is, when a module prints a diagnostic message (in your
case it's the h264 decoder module), that message overwrites parts
of the progress information line. This seems to happen in your
case, so you don't see the time stamp.
There are several ways to solve this. One way is to modify FFmpeg's
output by appending a tr(1) command like this:
ffmpeg ... 2>&1 | tr '\r' '\n'
That will cause the progress display to be printed on separate lines,
so it won't be overwritten. That trick works on Linux and BSD, it
does *not* work on Windows. Not sure about MacOs, but since MacOS
has some BSD heritage, it might work.
Best regards
-- Oliver
More information about the ffmpeg-user
mailing list