Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

Pages: (4) 1 2 [3] 4  ( Go to first unread post )
Caching input driver, with FFMpeg, in development
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
shekh
Posted: Dec 10 2014, 06:53 PM


Advanced Member


Group: Members
Posts: 89
Member No.: 37903
Joined: 21-April 14



Fixed some crashes
Fixed frame rounding
Added duplicate frames where frame rate is non constant (for example Video2.WMV)
Fixed sound offset
Fixed noise in sound where sound stream is not sample accurate (for example "Sync Test 2.mkv")
Etc

Also changed memory management of big image buffers. Now can deal with much more memory. And example 3840*2160 H264, 500 frames in memory take around 6Gb, it works. Btw that video can decode at stunning 10fps on my pc, useful to extract some photos.
 
     Top
shekh
Posted: Dec 10 2014, 06:56 PM


Advanced Member


Group: Members
Posts: 89
Member No.: 37903
Joined: 21-April 14



New issue:
fast recompress mode, analyze pass will crash.

Some investigation showed that fast recompress is a pile of problems, dont use it.

[edit]
And another one, almost forgot.
Tested xvid I-frame compressed 1280*960, and internal VD decoder can navigate it really fast. Dont know how to measure but it is really really fast. And ffmpeg is slow. But the "analyze pass" comparison shows that ffmpeg is 2x faster. Looks like ffmpeg here has a very stupid seeking method.

[edit]
fixed!
 
     Top
dloneranger
Posted: Dec 10 2014, 07:20 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



Somethings seriously broken in this build

Vid analysis pass showed decoding as 1000+ fps, so i saved a file
The output file has many repeated frames and garbage ones that look like mixtures of two or more frames

user posted image

[edit]
analysis pass at 1000fps seemed weird as it ffwd'd at about the same speed as the other plugin, and that one only analysed at about 100fps


--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
shekh
Posted: Dec 10 2014, 07:49 PM


Advanced Member


Group: Members
Posts: 89
Member No.: 37903
Joined: 21-April 14



There is something that I need to check: thread safety.
Anyway for me it somehow works. Saved "Sync Test 1.mkv" as uncompressed, full processing mode. Looks ok.
Do you have video buffering set to what? Mine is 4 buffers.
 
     Top
dloneranger
Posted: Dec 10 2014, 08:03 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



I have most things set to non standard - it's easier to catch problems that way

Let's see
Video decoding mode is set to yuv420
Threading is set to compression threads=1, filtering=4, process ahead=4
buffering all at max

The problem also shows when playing
no motion when playing input
stop motion when playing output

Lowering the video buffers down to 4 gets it working, but that's a problematic solution

--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
shekh
Posted: Dec 10 2014, 08:13 PM


Advanced Member


Group: Members
Posts: 89
Member No.: 37903
Joined: 21-April 14



Ok it is a known problem, I wrote before
Want to find good solution but it is not easy, because the entire caching idea violates the plugin api.
 
     Top
shekh
Posted: Dec 13 2014, 03:08 PM


Advanced Member


Group: Members
Posts: 89
Member No.: 37903
Joined: 21-April 14



QUOTE (shekh @ Dec 10 2014, 06:56 PM)
Tested xvid I-frame compressed 1280*960, and internal VD decoder can navigate it really fast. Dont know how to measure but it is really really fast. And ffmpeg is slow. But the "analyze pass" comparison shows that ffmpeg is 2x faster. Looks like ffmpeg here has a very stupid seeking method.

Performed some more testing around this.

The problematic file I create with virtualdub, xvid, quantization=1
It takes 8sec to seek & decode 100 random frames. It is interesting that before it can reach any video packet it is skipping 24 audio packets / 10 Megabytes of file content. But the ffprobe shows all the packets are interleaved 1 by 1... I am clueless.

[update] OMG this is how audio preloading works. Not using it fixes the file.

The comparison file I created with ffmpeg.exe -c:v mpeg4 -vtag DX50 -qscale:v 2 -g 0 -c:a pcm_s16le
It takes 1 sec for the same test (this is good result: better than vfw way).

Some interesting facts:
1) xvid at quantization 1 creates file twice bigger and slower for ffmpeg than ffmpeg utility. Changing quantization to 2 makes them equal. Didnt check visual quality.
2) remuxing virtualdub-created file with ffmpeg -c:v copy -c:a copy immediately fixes the thing with packet seeking

After these 2 fixes the test runs at normal speed (1 sec).
 
     Top
shekh
Posted: Dec 16 2014, 07:18 PM


Advanced Member


Group: Members
Posts: 89
Member No.: 37903
Joined: 21-April 14



Fixed performance with skewed avi streams (see previous message)
Improved performance with all-keyframe files
Fixed spike in backward scan with P/B frame files
Minor fixes

Added warning to decrease process ahead buffers, the message is Cache overflow: set "Performance \ Video buffering" to 32 or less
Should be obvious enough and prevents frustration of corrupt output.
 
     Top
dloneranger
Posted: Dec 16 2014, 07:54 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



Some files load in this version with the wrong duration (about 2 to 12 frames long) vs the previous version
File information dialog shows correct length though (eg 20 minutes)

--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
dloneranger
Posted: Dec 16 2014, 08:13 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



Fails here in videosource initstream

if(trust_index){
sample_count = m_pStreamCtx->nb_index_entries;

trust_index is true and nb_index_entries is something low like 2 or 12

moving to the other branch (trust_index=false) gives a sample count much higher eg 16388

[edit]
there's also an occasional audio glitch/spike at the beginning of the videos
user posted image

--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
shekh
Posted: Dec 16 2014, 09:14 PM


Advanced Member


Group: Members
Posts: 89
Member No.: 37903
Joined: 21-April 14



Looks like it is the kind of video where there is index but it does not list all frames.
Have idea for workaround: compare #frames derived from duration vs from index.
Can you upload your sample?

[update]
Fixed
 
     Top
dloneranger
Posted: Dec 16 2014, 09:27 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



https://dl.dropboxusercontent.com/u/1702491...%281080p%29.mkv
almost all mkv's do it though


--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
shekh
Posted: Dec 17 2014, 09:56 PM


Advanced Member


Group: Members
Posts: 89
Member No.: 37903
Joined: 21-April 14



QUOTE (dloneranger @ Dec 16 2014, 08:13 PM)
there's also an occasional audio glitch/spike at the beginning of the videos
user posted image

How can I reproduce this audio defect? Is it persistent or random?
 
     Top
dloneranger
Posted: Dec 17 2014, 10:12 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



Seems random, but it's always right at the start

--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
shekh
Posted: Dec 17 2014, 10:23 PM


Advanced Member


Group: Members
Posts: 89
Member No.: 37903
Joined: 21-April 14



Anyway please upload the sample where you see it

[update]
Fixed
 
     Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
54 replies since Nov 25 2014, 01:31 PM Track this topic | Email this topic | Print this topic
Pages: (4) 1 2 [3] 4 
<< Back to VirtualDub Filters and Filter Development