VideoHelp Forum

+ Reply to Thread
Results 1 to 13 of 13
Thread
  1. I need suggestions for tools (preferably free ones) that are good for automatically scanning and checking for errors of H.264 mp4 video files. I am attaching a couple of examples of the kind of errors I am referring to. The program should automatically detect these and alert me at which point (time position) in the video that the suspected error is located. I was advised to use VirtualDubMod but that says the file type is not supported. So what else is there?
    Image Attached Thumbnails Click image for larger version

Name:	example1.jpg
Views:	13
Size:	199.8 KB
ID:	66352  

    Click image for larger version

Name:	example2.jpg
Views:	9
Size:	284.0 KB
ID:	66353  

    Quote Quote  
  2. Try ffmpeg. Put this in a batch file then drag/drop the file you want to test onto it:

    Code:
    ffmpeg.exe -v error -i %1 -f null - >"%~nx1.error.txt" 2>&1
    A file with error.txt appended to the file name will be produced. Any errors will be logged therein. Sample output from a known bad file:

    Code:
    [h264 @ 000001e8e1a82c80] cabac decode of qscale diff failed at 35 15
    [h264 @ 000001e8e1a82c80] error while decoding MB 35 15, bytestream 2125
    [h264 @ 000001e8e1a82c80] left block unavailable for requested intra4x4 mode -1
    [h264 @ 000001e8e1a82c80] error while decoding MB 0 17, bytestream 7504
    [aac @ 000001e8e1a042c0] decode_band_types: Input buffer exhausted before END element found
    Error while decoding stream #0:1: Invalid data found when processing input
    [aac @ 000001e8e1a042c0] channel element 0.0 is not allocated
    Error while decoding stream #0:1: Invalid data found when processing input
    [h264 @ 000001e8e1ab0c00] cabac decode of qscale diff failed at 39 21
    [h264 @ 000001e8e1ab0c00] error while decoding MB 39 21, bytestream 2212
    [h264 @ 000001e8e1a83a40] cabac decode of qscale diff failed at 10 28
    [h264 @ 000001e8e1a83a40] error while decoding MB 10 28, bytestream 121
    Quote Quote  
  3. Originally Posted by jagabo View Post
    Try ffmpeg. Put this in a batch file then drag/drop the file you want to test onto it:

    Code:
    ffmpeg.exe -v error -i %1 -f null - >"%~nx1.error.txt" 2>&1
    A file with error.txt appended to the file name will be produced. Any errors will be logged therein. Sample output from a known bad file:

    Code:
    [h264 @ 000001e8e1a82c80] cabac decode of qscale diff failed at 35 15
    [h264 @ 000001e8e1a82c80] error while decoding MB 35 15, bytestream 2125
    [h264 @ 000001e8e1a82c80] left block unavailable for requested intra4x4 mode -1
    [h264 @ 000001e8e1a82c80] error while decoding MB 0 17, bytestream 7504
    [aac @ 000001e8e1a042c0] decode_band_types: Input buffer exhausted before END element found
    Error while decoding stream #0:1: Invalid data found when processing input
    [aac @ 000001e8e1a042c0] channel element 0.0 is not allocated
    Error while decoding stream #0:1: Invalid data found when processing input
    [h264 @ 000001e8e1ab0c00] cabac decode of qscale diff failed at 39 21
    [h264 @ 000001e8e1ab0c00] error while decoding MB 39 21, bytestream 2212
    [h264 @ 000001e8e1a83a40] cabac decode of qscale diff failed at 10 28
    [h264 @ 000001e8e1a83a40] error while decoding MB 10 28, bytestream 121
    Thanks for answering. I tried it, but the log is blank. I saved the code as *.BAT, placed it in the same folder as FFFmpeg, dropped the video into the BAT, the program does something for a minute or two, then closes. I check the *.TXT that it created and it's blank. I tried it with another movie that I know has errors and the program just got stuck then and never finished the error check (left it on for 15 minutes then finally closed it manually cause nothing was happening).
    Quote Quote  
  4. Was the video file in the same folder as the bat file and ffmpeg? Try changing the command to:

    Code:
    ffmpeg.exe -v error -i "%~dpnx1" -f null - >"%~dpnx1.error.txt" 2>&1
    pause
    That will assure the log file is created in the same folder as the video file (and the video file doesn't need to be in the same folder as the bat file). But you must have write access to that location. It won't work if the file is on a DVD, for example.

    I add a pause to the second line so the CLI windows stays open and you can see if there are any other error messages.

    If there are no detected errors in the video the txt file will be empty. I don't know that this will find all possible errors. But it works for the ones I've tried. With many different containers and codecs.
    Quote Quote  
  5. Originally Posted by jagabo View Post
    Was the video file in the same folder as the bat file and ffmpeg? Try changing the command to:

    Code:
    ffmpeg.exe -v error -i "%~dpnx1" -f null - >"%~dpnx1.error.txt" 2>&1
    pause
    That will assure the log file is created in the same folder as the video file (and the video file doesn't need to be in the same folder as the bat file). But you must have write access to that location. It won't work if the file is on a DVD, for example.

    I add a pause to the second line so the CLI windows stays open and you can see if there are any other error messages.

    If there are no detected errors in the video the txt file will be empty. I don't know that this will find all possible errors. But it works for the ones I've tried. With many different containers and codecs.

    Yes both the video file and the *.bat were in c:\ffmpeg-5.1-full_build\bin.

    I added the new code you provided and tried it with two different videos with known errors (the ones I used in my examples in the OP).

    When I run the first video file, the command line window looks like in cmd1.jpg that I am attaching here. The log file is blank despite the video starts out with a bunch of very obvious jibberish as seen in example1.jpg.

    When I run the second video file, the command line window looks indentical to as in the first case. Also blank log file.

    Any ideas of why the errors are not recognized? It's impossible to miss them when looking at the video. The one in the second example goes on for several seconds.
    Thanks for helping me.

    Image
    [Attachment 66362 - Click to enlarge]
    Quote Quote  
  6. Note that ffmpeg is detecting errors in the encoding/decoding (corrupt, missing, or extra data), not errors in the video that was encoded therein. There's no way for it to know if what you see as picture corruption is supposed to be there or not.
    Quote Quote  
  7. Originally Posted by jagabo View Post
    Note that ffmpeg is detecting errors in the encoding/decoding (corrupt, missing, or extra data), not errors in the video that was encoded therein. There's no way for it to know if what you see as picture corruption is supposed to be there or not.
    OK I understand. So there is no way to do it then.
    Quote Quote  
  8. Member
    Join Date
    Jul 2022
    Location
    Berlin
    Search Comp PM
    I have not used it, but a friend once recommenden the freeware "QCTools" : rather nerdy but evidently offers very detailed analysis of any video file.

    This would probably be the most useful parameter to look at in that software:

    Vertical Line Repetitions (VREP)
    Filter Domain Filter Name(s) Range
    Vertical Line Repetitions VREP 0-1

    Vertical Line Repetitions, or the VREP filter, is useful in analyzing U-Matic tapes and detecting artifacts generated in the course of the digitization process. Specifically, VREP detects the repetition of lines in a video. If a time base corrector notices a video signal dropout, it will compensate by playing the same line of data several times, hence the appearance of repetitious lines.The filter works by taking a given video line and comparing it against a video line that occurs 4 pixels earlier. If the difference in the two is less than 512, the filter reads them as being close enough to be appear repetitious. Cleaning your deck and/or tape may remediate this problem.
    Last edited by Jan Tokki; 17th Aug 2022 at 05:09. Reason: additional info
    Quote Quote  
  9. Originally Posted by Jan Tokki View Post
    I have not used it, but a friend once recommenden the freeware "QCTools" : rather nerdy but evidently offers very detailed analysis of any video file.

    This would probably be the most useful parameter to look at in that software:

    Vertical Line Repetitions (VREP)
    Filter Domain Filter Name(s) Range
    Vertical Line Repetitions VREP 0-1

    Vertical Line Repetitions, or the VREP filter, is useful in analyzing U-Matic tapes and detecting artifacts generated in the course of the digitization process. Specifically, VREP detects the repetition of lines in a video. If a time base corrector notices a video signal dropout, it will compensate by playing the same line of data several times, hence the appearance of repetitious lines.The filter works by taking a given video line and comparing it against a video line that occurs 4 pixels earlier. If the difference in the two is less than 512, the filter reads them as being close enough to be appear repetitious. Cleaning your deck and/or tape may remediate this problem.
    Thanks for the suggestions. It sounds as if it might be a bit too complex for me, but I'll give it a go anyway.
    Quote Quote  
  10. Are you sure it's not decoder messing up or reencode with these errors?
    Quote Quote  
  11. Originally Posted by s-mp View Post
    Are you sure it's not decoder messing up or reencode with these errors?
    I really don't know to be honest. I'm not good with these things. How do I know? I have tried it on different computers and the error is present everywhere.
    Quote Quote  
  12. Not quite sure but on the audio end when I batch process hundreds of audio at once errors show like so

    this error is can be corrected MKVToolnix
    Error while decoding stream #0:0: Invalid data found when processing input
    Audio packet of size 24 (starting with 00000000...) is invalid, writing it anyway

    but this one is fatal as timing will be off and all sorts of #$@# will happen
    This error is fatal and the mp3 should be deleted
    mp3float @ 0x5639205e7a40] invalid new backstep -1
    [mp3float @ 0x5639205e7a40] big_values too big
    [mp3float @ 0x5639205e7a40] Error while decoding MPEG audio frame.
    Error while decoding stream #0:0: Invalid data found when processing input

    To batch multiplex mp3s all at once in MKVToolnix when dragging them into the app choose
    Create new multiplex settings for each file
    this will create a tab for each mp3
    Click Multiplex then Action for all tabs then Start multiplexing
    When done you can Multiplex then Action for all tabs then Close

    I wonder if those corrupt videos also have a corrupted audio stream. who knows.
    Quote Quote  
  13. Originally Posted by mrbass View Post
    Not quite sure but on the audio end when I batch process hundreds of audio at once errors show like so

    this error is can be corrected MKVToolnix
    Error while decoding stream #0:0: Invalid data found when processing input
    Audio packet of size 24 (starting with 00000000...) is invalid, writing it anyway

    but this one is fatal as timing will be off and all sorts of #$@# will happen
    This error is fatal and the mp3 should be deleted
    mp3float @ 0x5639205e7a40] invalid new backstep -1
    [mp3float @ 0x5639205e7a40] big_values too big
    [mp3float @ 0x5639205e7a40] Error while decoding MPEG audio frame.
    Error while decoding stream #0:0: Invalid data found when processing input

    To batch multiplex mp3s all at once in MKVToolnix when dragging them into the app choose
    Create new multiplex settings for each file
    this will create a tab for each mp3
    Click Multiplex then Action for all tabs then Start multiplexing
    When done you can Multiplex then Action for all tabs then Close

    I wonder if those corrupt videos also have a corrupted audio stream. who knows.
    I'm sorry I really have no clue. I didn't encode them personally. I was fixing to backup a lot of files to BD-R discs and I wish there was a relatively easy way to know if anything has errors before I waste discs. Sitting and watching them all through prior to burning is unfortunately not an option.
    Quote Quote  



Similar Threads