Log in

View Full Version : AvsPmod Reporting Too Many Frames???


BlockABoots
10th August 2013, 15:29
I am using OBS to captured gameplay of PC games locally (not streaming) when i load the captured mp4 file into AvsPmod its it reporting way too many frames, for a 6 minute clip there appears to be 366,792 frames!!

Any ideas why AvsPmod is report so many frames when there isnt that many frames in the capture file itself, is to do with it being a DirectShowSource file within AvsPmod?. I have noticed that if i have the video file previewed in the AvsP window and press left on the keyboard cursor once (normal to advance 1 frame) usually AvsP reports moving forward 0.33 of a second for each frame, but with this mp4 file it only moves forward 0.01 of a second for each frame is this why its reporting more frames than there really is?

Can this be fixed at all?

StainlessS
10th August 2013, 15:43
I think sometimes Directshow reports 1000.0 frames per second for some clips, no idea why.

366792 / (6*60) == 1018.866667, about 1000 fps. EDIT: or 366.792 seconds, ie 6:06.792 secs

Guest
10th August 2013, 15:50
Can this be fixed at all? Set the FPS manually in your script. Another option: instead of DirectShowSource(), use a reliable source filter, such as DGDecNV.

StainlessS
10th August 2013, 15:56
If your cant use DGDecNV for any reason, the below .cmd/.bat file will extract to HuffYUV and PCM audio with correct timing


setlocal

REM Where to Find ffmpeg
set FFMPEG="C:\BIN\ffmpeg.exe"

REM Where to get input file, No terminating Backslash, "." = current directory
set INDIR="."

REM Where to place output file, No terminating Backslash.
set OUTDIR="D:\AVS"

FOR %%A IN (*.wmv *.mpg *.avi *.flv *.mov *.mp4 *.m4v *.RAM *.RM) DO (
%FFMPEG% -i "%INDIR%\%%A" -vcodec huffyuv -acodec pcm_s16le "%OUTDIR%\%%~nxA.AVI"

)
Pause


Can replace 'huffyuv' with eg 'utvideo' if you prefer UT Video codec.
You can add container extensions to the script if ffmpeg supports them.

BlockABoots
10th August 2013, 16:55
Ok i have used the .assumeFPS(30) command, but its AvsPmod is still stating that the file has the same amount of frames.....

http://i.minus.com/iW2KL2vxBF7HH.jpg

But have noticed that now when i advance 1 frame the time does advance 0.33 instead of the 0.1 it was before, any ideas why its still reporting soo many frames?

I dont think i can use DGDecNV as i have a AMD card not Nvidia

EDIT: that doesnt appear to work, RipBot is think the file is over 3hrs long when its only 6 minutes!!....

http://i.minus.com/i8lbhE1MNhld6.jpg

creaothceann
10th August 2013, 18:09
AssumeFPS will only change the time each frame is displayed, it doesn't drop frames.

Some recording programs set the output frame rate to 1000fps for fixed-framerate video formats for the additional precision. The actually recorded frames are inserted at the appropriate times, and the rest will be "null frames".

So you just have to tell the input plugin to return the framerate you want to have. Try DSS2("input.mp4", 30), it's included in Haali splitter's avss.dll and more accurate than DirectShowSource.

Guest
10th August 2013, 19:37
AssumeFPS will only change the time each frame is displayed, it doesn't drop frames. Quite right. Thanks for the correction.

BTW, BlockABoots, you have to put your convert call before the return in your script.

BlockABoots
10th August 2013, 20:11
Quite right. Thanks for the correction.

BTW, BlockABoots, you have to put your convert call before the return in your script.

Ummm, can you explain a bit more please, still fairly new to script encoding hence why i use avspmod, only know a handful of commands :(

Guest
10th August 2013, 20:17
Exchange the "ConvertToYV12()" line and the "return video" line in your script.

creaothceann
10th August 2013, 20:22
only know a handful of commands :(

http://avisynth.nl/index.php/Main_Page

BlockABoots
10th August 2013, 20:36
Exchange the "ConvertToYV12()" line and the "return video" line in your script.

That doesnt appear to work in AvsPmod, just get, Script error: Invalid arguments to function "ConverttoYv12" (video.avs, line 2).

So how do i normalise the audio speed?

Guest
10th August 2013, 20:42
OK, my bad. Should be:

video=DirectShowSource()
video=video.ConvertToYV12()
return video

Or just:

DirectShowSource()
ConvertToYV12()

BlockABoots
10th August 2013, 20:54
Yeah that works.

Still audio to sped up however

EDIT: ok it would seem that i need to use the AssumeSampleRate command, the video was captured at 44.1khz, so i tried changing the samplerate to 22050 but it was still slightly too fast

creaothceann
10th August 2013, 21:30
What settings do you use for OBS? (obsproject.com I assume)

BlockABoots
10th August 2013, 21:33
What settings do you use for OBS? (obsproject.com I assume)

Yeah thats, i used R1CH's guide he did for local recording, so my settings are the same......

https://obsproject.com/forum/viewtopic.php?f=18&t=2972

BlockABoots
10th August 2013, 23:56
This is the file info from AvsPmod...

http://i.minus.com/iorf45d6XTlGl.jpg

It says that there is a 1000 frames for every second of video!. Is this a problem with AvsPmod rather than OBS? As looking in the logfile of OBS for that capture it says....

"Total frames rendered: 11053, number of late frames: 2 (0.02%) (it's okay for some frames to be late)"

so its reporting only 11053 frames had been captured!

raffriff42
11th August 2013, 02:53
Instead of:
DirectShowSource(path).AssumeFPS(30)
Try:
DirectShowSource(path, fps=30)

DirectShowSource (Avisynth wiki) (http://avisynth.nl/index.php/DirectShowSource)

fps: This is sometimes needed to specify the framerate of the video. If the framerate or the number of frames is incorrect (this can happen with asf or mov clips), use this option to force the correct framerate.

BlockABoots
11th August 2013, 10:22
I have actually managed to get it sorted now, i was able to get the correct amount of frame to be encode by adding the ",30" command after the input file as suggested but what i was noticing was that after the file had been encoded that when i played it back the audio was super fast. I noticed that the audio codec used in OBS was ACC, so i changed this to MP3 and now after capturing a test video and encoding the audio is the correct speed. I guess AvsPmod/avisynth doesnt like ACC audio codec much?

BlockABoots
11th August 2013, 10:25
Got this from the author of OBS...

" OBS is definitely saving only as many frames as you actually recorded. It's an incorrect measurement by whatever app you're using that's basing it upon the time base of the file rather than the actual output number of frames. These apps expect a constant framerate file, not a variable framerate file. There are no "null" frames in the file output. When using variable frame rate, the time base is set to 1:1000 so that each frame can use milliseconds for each frame's presentation timestamp. Apps will often mistakenly read this as 1000fps with files created with variable framerate. Those apps are probably doing [frame count] = [time base] * [time], instead of actually counting the number of frames in the file. Again, in reality, OBS is not recording more frames per second than what you have it set to."

So guess its just AvsPmod thats at fault here

creaothceann
11th August 2013, 14:01
AvsPmod is just a frontend for Avisynth.