Video file analysers

raffriff

Moderator
Staff member
Site Contributor
Let's have a thread for video file troubleshooting :)

First, I've mentioned this before: using Avisynth for checking video levels
(video levels should be within "TV range" for YouTube etc.)

I have a new batch file that makes this check fairly easy, once you have it set up:

PREPARE
INSTALL
  • no-install: To ACTIVATE, right-click a video*; Copy;
    navigate to "analyse.bat;" right-click, Paste
    ...
  • "SEND TO" mode: right-click analyse.bat, "Copy";
    in the Explorer navigation bar, type "shell:sendto", Enter;
    right-click in the Send To folder, "Paste Shortcut"
    ...
    To ACTIVATE, right-click any video file, select "Send To", "analyse.bat"
    ...
  • "DRAG AND DROP" mode: right-click analyse.bat, "Copy";
    right-click on the Desktop, "Paste Shortcut"
    ...
    To ACTIVATE, drag any video file to the analyse.bat shortcut
RUN
When activated, the batch file will launch your media player.​
You will see your video file with an overlay added, like this:​
Loose Minimum should be near 16; Loose Maximum should be near 235.​
NOTE: the video won't play smoothly. That's normal :)

analyse.bat
Code:
@echo off
::** version 3.0 05-July-2012
::** requires Avisynth - http://avisynth.org/
::** requires FFmpegsource - http://code.google.com/p/ffmpegsource/
::** requires LibAV - http://libav.org/
 
::** set PLAYER to your desired media player
set PLAYER="C:\Program Files\VirtualDub\VirtualDub.exe"
::set PLAYER="C:\Program Files\MPC-HomeCinema\mpc-hc.exe"
 
@echo on
@echo #avisynth > "%~dpn1-analyse.avs"
@echo O=AudioDub(FFmpegSource2("%~dpnx1"), DirectShowSource("%~dpnx1")) >> "%~dpn1-analyse.avs"
@echo C=(O.IsRGB) ? O.RGBAdjust(analyze=true): O.ColorYUV(analyze=true) >> "%~dpn1-analyse.avs"
@echo C=C.ConvertToYV12(matrix="PC.601") >> "%~dpn1-analyse.avs"
@echo C=C.Crop(0,0,-256,0).Histogram() >> "%~dpn1-analyse.avs"
@echo C=C.Subtitle("%~nx1", y=250) >> "%~dpn1-analyse.avs"
@echo C=C.Histogram(mode="audiolevels") >> "%~dpn1-analyse.avs"
@echo return C.ColorYUV(levels="PC->TV") >> "%~dpn1-analyse.avs"
 
%PLAYER% "%~dpn1-analyse.avs"
if errorlevel 1 pause
del "%~dpn1-analyse.avs"
del "%~dpnx1.ffindex"
@echo.
EDIT 13-May-2012: removed (commented out) audio levels command for wider compatibility
EDIT 5-June-2012: clarify which files will work and which won't; add "no-install"
EDIT 5-July-2012: new version - more reliable analysis
 

raffriff

Moderator
Staff member
Site Contributor
(this post has been moved from another thread)
The method I've been suggesting for detecting AVI file errors is a little cumbersome, so I tried some alternate methods.

First, since I didn't have a corrupted file to test with, I took a test Fraps video and intentionally changed some bits at random with the excellent MiTeC hex editor. I played the video in different media players. Sure enough, I got white lines or streaking on a few frames - just what I was looking for.

Then I tried to *detect* the errors - here are my results:

TEST #1: Source = Fraps AVI
  1. VirtualDub (Video menu, "Scan Video stream for errors...")
    no errors detected :eek: (error hiding is a feature, not a bug!)
    ...
  2. VirtualDubMod (Video menu, "Scan Video stream for errors...")
    success! "1 frames bad, 8 frames good but undecodable" :)
    ...
  3. WinFF+ffmpeg, as per HOWTO: Check avi file for errors
    no errors found :eek:
    ...
  4. DivFix++ ("Check Errors" only)
    success! "Total Error Count: 2" :)
    ...
  5. DivXRepair
    no errors found :eek:
Conclusion: I would use VirtualDubMod first, since it seems to detect the most errors. DivFix++ was the runner up, and it was very easy to use [EDIT but DivFix++ rejected a Fraps video because the "frame size is too large"]. Unfortunately, nothing was able to *fix* the errors.
EDIT - DivFix in combination with VirtualDub has fixed a corrupted video, at least once!

UPDATE: I don't know why ffmpeg failed to find any errors. It must be the source - an original Fraps AVI file. So I tested again with an MP4 video, again with random induced errors:

TEST #2: Source = MP4
  1. VirtualDub: no errors found :confused:
    ...
  2. VirtualDubMod: can't open the file :oops:
    ...
  3. WinFF+ffmpeg: success! all errors detected :) (see "UPDATE" below)
    ...
  4. DivFix++ : can't open file :oops:
    ...
  5. DivXRepair (did not test)
Interestingly, MP4 hides the errors much better - which is good for the end user, but not for a content producer, so it's important to check your MP4's before uploading if there's any doubt.

UPDATE - How to check for errors with ffmpeg:
Encode the video; check the output window for the word 'error.' That's it!
Get WinFF for ease of use. Suggested settings (might as well make a high quality video) -
Convert To = "MPEG-4"
Preset = "MPEG-4 H.264 video (very high quality)"
Click the Options button; click the FFmpeg tab​
Add this under Additional Command Line Parameters:​
-preset superfast -pix_fmt yuv420p
 

raffriff

Moderator
Staff member
Site Contributor
It's important to check if you are dropping frames. This is a sign you're trying to capture more pixels than your system can handle.

You do this by looking at your capture file and comparing Keyframe count to total frame count. If there is no frame dropping during the capture process these numbers will be equal. Dropping a few seems to be normal. (100% keyframes is good, less than 90% is bad)

Method 1:
Open a Fraps AVI file with VirtualDub and select File menu, File Information.

Method 2:
Use my FRAFS Avi Info, which shows percentage of keyframes (100% keyframes is good, less than 90% is bad)

Method 3:
see post #8.

Last Updated Jan 11, 2014
 
Last edited:

raffriff

Moderator
Staff member
Site Contributor
EDIT 12/2012 - try FRAFS Avi Info - does what MediaInfo does (AVI files only), but tailors the output for Fraps users:
  • file size
  • run time
  • audio channel count
  • audio sample rate
  • width, height
  • video frame rate
  • interlaced / progressive
  • color space (YUV/RGB)
  • dropped frames
  • bits/pixel (Qf)
- - - - - - - -
Use MediaInfo to give you the following information about an AVI video file:
  • file size
  • run time
  • audio channel count
  • audio sample rate
  • width, height
  • video frame rate
  • interlaced / progressive
  • color space
    • If file is not RGB , there will be line item like this:
      Color space : YUV
    • If file is RGB, the line will be missing - or it may be like this:
      Color space : RGB
mediainfo-fraps-rgb-vs-yuv.png

If you don't know whether a Fraps video was made with RGB Lossless mode enabled or not, this will tell you.
MediaInfo is incorporated into the Media Player MPC-HC , which if you don't have already, you should.
Play a video; right-click, Properties; MediaInfo tab.

- - - - - - - -
MediaInfo doesn't get the color space correctly in some cases; the best way (but much less user friendly) is to use ffmpeg. You have to scrutinize the output for color space info.
video-info-ffmpeg-output-frgb.png
Here are some examples:
  • Fraps YUV
    Stream #0:0: Video: fraps (FPS1 / 0x31535046), yuvj420p,
    ...
  • Fraps RGB
    Stream #0:0: Video: fraps (FPS1 / 0x31535046), bgr24,
    ...
  • ffmpeg+mpeg4
    Stream #0:0: Video: mpeg4 (Simple Profile) (FMP4 / 0x34504D46), yuv420p,...
  • VirtualDub + x264vfw
    Stream #0:0: Video: h264 (High) (x264 / 0x34363278), yuv420p, ...
  • MS Expression + WMV9/VC-1 Advanced
    Stream #0:1(eng): Video: vc1 (Advanced) (WVC1 / 0x31435657), yuv420p, ...
Here is a batch file that will help. Drag your video file onto the batch file to launch ffmpeg.
video-info-ffmpeg.bat (install & use the same way as in the first post)
Code:
"C:\Program Files\ffmpeg\bin\ffmpeg.exe" -i "%~dpnx1"
pause
- - - - - - - -

Use GSpot to give you the above information on both AVI and non-AVI media files, minus the color space, but it tells you the codecs that are used to play the file. This is useful for troubleshooting codec problems.

In the box at the bottom of the GSpot window, under "MS A/V", click [1], then [2] to see all the DirectX modules used to play the video. This should also show a small video preview.
 

ciarlo2006

Well-Known Member
Site Contributor
Just quickly browsing through your dropped frames section.

As I said before I record at 100fps usually and it makes no difference to my fps in game and the playback of videos, unless full-size then obviously it's not going to play back smoothly.

I never thought about checking for dropped frames and from a typical recording session of L4D, I decided to have a look and it was:

  1. Frames: 9060
  2. Keyframes: 5350 (Every 1)
Looking at that I'd have thought it was bad but play back of the video is perfectly fine.

But by that it would mean that I should be recording at roughly 55-60 fps?

I'll have a play around and see what happens, but I just prefer always having smooth recordings. I can normally feel a difference playing at 50 fps, depending on what type of game.

Edit: Success, 0 dropped frames. Mind you I was recording at 1fps
 

raffriff

Moderator
Staff member
Site Contributor
Thanks for bringing this up. There's three problems that can come from dropped frames:
  1. Some programs don't read Fraps "dummy" frames correctly as "repeat" frames, instead skipping over them, causing the video to be shorter in duration than the audio, which causes the audio to lose sync. I haven't experienced this personally, but others have.
    ...
  2. Some systems get occasional lags & slowdowns when they try to record more than the hard drive can handle. Not sure why this happens to some systems and not to others.
    • Maybe the write cache is storing up the overflow data, and then dumping itself to disk all at once, killing performance.
    • Maybe when the HDD is worked really hard, it goes into overtemp recovery or some kind of housekeeping mode.
      ...
  3. You get some amount of motion judder because the "real" (non-dummy) frames don't represent evenly spaced samples in time. Judder is most seen with certain types of footage -- slow camera pans & in-vehicle cams, mostly.
Are you still recording with the Velociraptor? That could explain why you don't notice lagging: the Velociraptor thrives on abuse. If by chance you are somehow dropping frames very "neatly," say every other frame (instead of say, 2 good frames followed by 2 skipped frames), then motion judder would be very mild. Of course, I could be wrong about a lot of what I just said. To be on the safe side though, I would suggest recording at 60 fps -- or 50 fps, if that's your monitor refresh rate.
 

ciarlo2006

Well-Known Member
Site Contributor
I tried at 50 and was still a fair bit of dropped frames but not near as many. Yes I use the velociraptor, and if I recall correctly, it doesn't hit the max write even at 100 fps, normally around 60mb/s.

Just tested on my desktop quickly, half size at 100fps is just under 30mb/s when moving a folder around the screen eratically. I'll test a game later on.

Also, I hadn't use the velociraptor for maybe 6 months because I bent a pin and thought it was snapped. It's suprising what a bit of tape and an imagination can do.
 

raffriff

Moderator
Staff member
Site Contributor
Here's another way to see how bad your dropped frames are: Bitrate Viewer.



All those white spaces in the screen shot above are dropped frames.
Click the icon in the upper-left and select "Frame based" mode (Ctl-F).
Use the mouse wheel to zoom in & out. Explore.

If you want to find *where* your video has dropped frames, this will help you.
Use the time listed under "Cursor" to find the spot in your video.

For comparison, Frafs AVI Info reports this video has 88% keyframes ( = 12% dropped frames).
Both tools are useful: sometimes you want a quick summary, and other times you want more detail.
 
Top