Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VirtualDub, VDubMod & AviDemux

Reply
 
Thread Tools Search this Thread Display Modes
Old 24th November 2014, 08:20   #381  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
I'm just wondering, is frame duplication really the ideal way of converting from 15 fps to 30 fps in the first place? Effectively you'll still have 15 fps-based motion, just played out at 30 fps. Would interpolation (e.g. MFlowFps()/MBlockFPs() and I think also SVP) be an option to provide smoother motion (and get around this problem) for you?
fvisagie is offline   Reply With Quote
Old 24th November 2014, 09:00   #382  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
Metadata-based stabilisation

Is anyone interested in looking into this? I've done some feasibility checking and it is definitely very much possible, at least for AR.Drone 2 videos. Although more direct methods are available, the quickest time-to-implementation at this point seems to simply convert the output of ExifTool. I just don't have the time to take it further at this point.

In case someone would like to look into this:

The AR.Drone 2 stores flight metadata in two places: the .MP4 recording, and userbox files on the drone.

.MP4 recording
Code:
0 7 84.023 -0.0138157112523913 0.020807821303606 1.58786511421204 0 0
0 7 84.055 -0.013349455781281 0.0169658288359642 1.58657622337341 0 0
...
1 7 85.913 0.0174348670989275 -0.00090780045138672 1.564129114151 0 0.659
1 7 85.946 0.0190824717283249 -0.00098724861163646 1.56361031532288 0 0.662
0 9 85.979 0.0209523718804121 -0.00107379746623337 1.56401801109314 0 0.665
0 9 86.012 0.0216640736907721 -0.00160936382599175 1.56422352790833 0 0.661
To convert from ExifTool to Deshaker pass 1 output format should be a cynch. Alternatively, the data could be parsed directly from the video, of course.

Userbox files
I can provide short sample videos and userbox files if required.
fvisagie is offline   Reply With Quote
Old 24th November 2014, 20:11   #383  |  Link
guth
Registered User
 
Join Date: Apr 2003
Location: Uppsala, Sweden
Posts: 157
sorin86... Yes, any moving objects in the video will jump back and forth, but the background that is stabilized on will look smoother than before.
My honest (but maybe not so nice ) answer to this problem is that if you have duplicate frames you're either doing something wrong, or you're using a lousy camera. Garbage in, garbage out...
I don't think I will address this problem unless I get lots of requests. Sorry...

Last edited by guth; 24th November 2014 at 20:22.
guth is offline   Reply With Quote
Old 26th November 2014, 17:51   #384  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
@fvisagie
Dont know if this of any use but take a peek about this post (from about post #14 onward, user name Filker could be used as search filter in that thread)
http://forum.doom9.org/showthread.ph...94#post1588194
Avisynth based (still camera Exif).
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 27th November 2014, 07:40   #385  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
Quote:
Originally Posted by StainlessS View Post
@fvisagie
Dont know if this of any use but take a peek about this
I'd had in mind to Call() an external script for the conversion, but that looks like it could come in handy for conversion in Avisynth.

The problem for me though remains not so much how to do it, but to find the time. I posted in the hope of finding someone else who's interested in taking the idea further.
fvisagie is offline   Reply With Quote
Old 27th November 2014, 12:11   #386  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
fvisagie,
See Martin53 posts (and mine) in same thread as posted and also in Call(and maybe CallCmd) threads, he wanted to do something like that
for deshaker, I did some coding for him to parse and extract data from the files, dont know if he finished the project.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 27th November 2014, 13:23   #387  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
StainlessS,
I found those two threads, but saw nothing that seems related to Deshaker or parsing text files. Thanks, anyway.
fvisagie is offline   Reply With Quote
Old 27th November 2014, 16:38   #388  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Well you could have searched on deshaker with user name Martin53 as here:
LINK REMOVED:

in particular this
LINK REMOVED:

however, it seems M53 abondoned the project (or at least that attack stance).
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 27th November 2014 at 20:43.
StainlessS is offline   Reply With Quote
Old 27th November 2014, 17:15   #389  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
Indeed I didn't think that far. A slow day, sorry and thanks.
fvisagie is offline   Reply With Quote
Old 27th November 2014, 20:42   #390  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
fvisagie, sorry, the links posted did not work (they worked when I posted them, I checked), but after search and
log-off they must disappear or something. anyway, this was the 2nd link posted again and hopefully working this time.
http://forum.doom9.org/showthread.ph...64#post1596064

Previous bad links removed.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 28th November 2014, 08:14   #391  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
@StainlessS,
Strange, that link did work for me the first time also . Thanks for your trouble.
fvisagie is offline   Reply With Quote
Old 12th September 2015, 17:05   #392  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
Deshaking concatenated file one clip at a time

It seems possible, but will it work correctly deshaking a concatenated file in VirtualDub, one input clip at a time?

Background to the question: a large 350+ file HD project is creating space problems with the saving of intermediate files such as Deshaken versions of each input clip. An advantage of Deshaking clips individually is that scene changes are not missed. In this case it seems I'd need to work on a real or hopefully frame-served concatenation of input files, and I was wondering whether it would be possible to still ensure reliable detection of clip transitions. That would save me having to manually locate and check all those boundaries afterwards.

In principle the following approach seems possible, in the sense that it can at least be scripted in VirtualDub:
For each clip
Apply Clear() & AddRange() to restrict processing to that clip's material only
Process Deshaker pass 1 (configured to save individual log files for each clip - AddRange() will cause frame numbers to start at 0 for each clip)
Apply Deshaker pass 2 (configured to use the same log file as used in pass 1)
Some questions that create doubt:
1. What happens to the results of Deshaker's processing when pass 2 is applied (i.e. the "Deshaking" message)? Will this get over-written or somehow become inaccessible when the next clip is processed?
2. What happens once all of the concatenated clip has been processed, the last AddRange() is removed and saving or frame-serving starts? Frame number offsets as seen by Deshaker of all clips but the very first one will change - how will that affect Deshaker's operation?
3. Does this regarding frame-serving from the VirtualDub online help apply to Deshaker: "Video filters that have a lag — most notably the temporal smoother. The filter will function, but there will be a delay in the video."?

I realise that I can try this all out for myself. However, I am under some time pressure and would rather hear now "this is guaranteed to fail" as opposed to wasting time on a bad idea. On the other hand, if this could work, I'd appreciate any corrections or improvements to the approach.

Thanks,
François

Last edited by fvisagie; 12th September 2015 at 18:54. Reason: Added question 3
fvisagie is offline   Reply With Quote
Old 12th September 2015, 18:49   #393  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
When you isolate range, deshaker sees original frame numbers (not starting from 0 for each range) so in general this way should work.
However,
there is no meaning to "apply pass 2" if you do not save the result (video).
And there is no normal way to apply different deshaker instance (with different log files) to each range.

But instead you could simply use one normal deshaker instance with one log file: it can deal with scene cuts.
If you are going to manually pass range parameters to AddRange() you could as well just force these frames to be scene cuts in the deshaker log file.
shekh is offline   Reply With Quote
Old 12th September 2015, 19:25   #394  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
Quote:
Originally Posted by shekh View Post
When you isolate range, deshaker sees original frame numbers (not starting from 0 for each range) so in general this way should work.
Unfortunately, not in my experience. Applying AddRange() results in a VirtualDub clip with frame numbers [0...n-1], and the frame numbers recorded in the resulting Deshaker log file are [0...n-1]. Unless you are referring to a way of isolating ranges other than AddRange()?

Quote:
And there is no normal way to apply different deshaker instance (with different log files) to each range.
That would then be the one potential deal-breaker, see below.

Quote:
If you are going to manually pass range parameters to AddRange() you could as well just force these frames to be scene cuts in the deshaker log file.
I realise that that possibility is available, but it's very easy to automatically isolate individual clips in the VirtualDub script, which itself is very easy to generate automatically. Avisynth can be used to catalogue clip lengths and generate the script, and below is an example with VirtualDub doing the concatenation (of .avi inputs) itself. A batch file can easily generate such a script from a list of filenames:
Code:
// Start of script
declare startframe;
startframe = 0;
declare endframe;
endframe = 0;
// ...

// Start of clip 000 processing
VirtualDub.Open(U"clip000.avi");
VirtualDub.subset.Delete();
startframe = endframe;
endframe = VirtualDub.video.length;
VirtualDub.Log("startframe="+Sylia.ToString(startframe));
VirtualDub.Log("endframe="+Sylia.ToString(endframe));
VirtualDub.Log("cliplength="+Sylia.ToString(endframe - startframe));
VirtualDub.subset.Clear();
VirtualDub.subset.AddRange(startframe,endframe - startframe);
// ...

// Start of clip 001 processing
VirtualDub.Append(U"clip001.avi");
VirtualDub.subset.Delete();
startframe = endframe;
endframe = VirtualDub.video.length;
VirtualDub.Log("startframe="+Sylia.ToString(startframe));
VirtualDub.Log("endframe="+Sylia.ToString(endframe));
VirtualDub.Log("cliplength="+Sylia.ToString(endframe - startframe));
VirtualDub.subset.Clear();
VirtualDub.subset.AddRange(startframe,endframe - startframe);
// ...

// ...
So it seems the question is whether it is possible to apply different Deshaker instances to different portions of a clip?

Additionally, it seems there may be issues with temporal filters when frame-serving; see the added question 3. above. However, that at least has the work-around of saving to disk if needed.
fvisagie is offline   Reply With Quote
Old 12th September 2015, 19:59   #395  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
Quote:
Originally Posted by fvisagie View Post
Unfortunately, not in my experience. Applying AddRange() results in a VirtualDub clip with frame numbers [0...n-1], and the frame numbers recorded in the resulting Deshaker log file are [0...n-1]. Unless you are referring to a way of isolating ranges other than AddRange()?
Yes sorry, but you can use SetRangeFrames() which restricts range for analyze pass without tweaking timeline.

Quote:
Originally Posted by fvisagie View Post
I realise that that possibility is available, but it's very easy to automatically isolate individual clips in the VirtualDub script...
Maybe you can generate log files this way, and then concatenate them with another script?

Quote:
Originally Posted by fvisagie View Post
whether it is possible to apply different Deshaker instances to different portions of a clip?
You may try with blend curves, when a value of blend curve is 0 the filter is skipped. But I am not sure if this is efficient as all instances will probably take a lot of memory (and preparing concatenated logfile looks more easy to do).

Quote:
Originally Posted by fvisagie View Post
Additionally, it seems there may be issues with temporal filters when frame-serving
AFAIK there is internal delay in pass2 if you apply border filling with future frames. But I dont know if/how it is connected with frameserving.
shekh is offline   Reply With Quote
Old 12th September 2015, 21:18   #396  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
Quote:
Originally Posted by shekh View Post
you can use SetRangeFrames() which restricts range for analyze pass without tweaking timeline.
Yes, that seems workable, although the fact that the offsets are in milli-seconds makes that a somewhat shaky approach.

Quote:
Maybe you can generate log files this way, and then concatenate them with another script?
At this point that seems like the safest way 1) to avoid the creation of intermediate files and 2) to ensure all scene changes are detected. Something like
Code:
Run Deshaker pass 1 on individual clips
Concatenate clips and log files, adjusting frame numbers in the latter
Set Deshaker to pass 2 and render
Thanks for your suggestions.
fvisagie is offline   Reply With Quote
Old 12th September 2015, 21:30   #397  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
Quote:
Originally Posted by fvisagie View Post
Yes, that seems workable, although the fact that the offsets are in milli-seconds makes that a somewhat shaky approach.
Which milliseconds? SetRangeFrames() is equivalent of "mark in/mark out" in the UI.
shekh is offline   Reply With Quote
Old 12th September 2015, 21:36   #398  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
Quote:
Originally Posted by shekh View Post
Which milliseconds? SetRangeFrames() is equivalent of "mark in/mark out" in the UI.
Yes, when done manually. However, when invoked from a script (from VirtualDub scripting language reference, v0.7):
Quote:
int GetRange(int var);
void SetRange(int startMS, int endMS);

Gets or sets a particular range value. If var=0, the start offset
is used, and if var=1, the end offset is used. The start offset is
measured in milliseconds from the beginning, and the end offset is
in milliseconds from the end. Yes, I know this is stupid.

Because the end offset is only an offset, it is not possible to
determine the length of the video stream using these functions.
fvisagie is offline   Reply With Quote
Old 12th September 2015, 21:45   #399  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
Maybe this script reference is too old.

oops I was referring to SetRangeFrames not SetRange

it is saved when you do "save processing settings" and select "include selection"
shekh is offline   Reply With Quote
Old 13th September 2015, 09:51   #400  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
Quote:
Originally Posted by shekh View Post
oops I was referring to SetRangeFrames not SetRange
Thanks for pointing that out; that would simplify things a lot.
fvisagie is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:08.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.