Registered Member
|
MJ Peg:
> In the end I came up with the batch files I posted here : > http://forums.virtualdub.org/index.php?act=ST&f=5&t=17772&st=15&hl= Thanks, I think it is possible to move from MJ Peg's example to wine for an entire directory, ... I don't have time this week, but maybe in the next couple of weeks. I note this works for one file if the terminal session is in the video directory (with deshake01.vcf (pass01) and deshake02.vcf (pass02) in same directory): wine /path/to/virtualdub/VirtualDub.exe /c /s deshake01.vcf /p initial-video.avi temporary-video.avi /r /x wine /path/to/virtualdub/VirtualDub.exe /c /s deshake02.vcf /p initial-video.avi final-output-video.avi /r /x which is in essence what MJ Peg created. One next needs to sort the paths, and then set up a simple bash loop to do this for an entire directory. I've done that for ffmpeg, so the same should be true/doable with wine/VirtualDub. As noted, I don't have time to sort this now, but it should be viable. |
Registered Member
|
Re: Jerem's comment:
> conversion of the original video with ffmpeg into mjpeg avi For this I use the following one line (it may appear wrapped in this forum, but it is just one line): for i in *.mts; do ffmpeg -y -i "$i" -f avi -vcodec mpeg4 -b 8000000 -acodec ac3 -ab 128000 -s 1280x720 year_month_day_${i/%mts/avi}; done where I have a directory of ".mts" files, and I have added the Year_month_day_in front of each file, converting it from a .mts to a .avi extension. I still have not got around to looking for a wine/virtualdub/deshaker script. |
Registered Member
|
OK, further to my post above, ... I'm not very good at this, but I think something like this might work:
for i in *.avi; do wine /path/to/virtualdub/VirtualDub.exe /c /s deshake01.vcf /p $i temp.mp4 /r /x; wine /path/to/virtualdub/VirtualDub.exe /c /s deshake02.vcf /p $i deshaken_${i/%avi/mp4} /r /x; rm temp.mp4; done In the above example one has a directory of video files with the .avi extension that one wishes to deshake. One also has the files deshake01.vcf and deshake02.vcf in the same directory as the .avi files (I have not sorted paths under wine). deshake01.vcf is pass01 of deshaker. deshake02.vcf is pass02 of deshaker. After deshaking them with VirtualDub and deshaker, the final files ending up with a .mp4 extension and the words "dehaken_" in front of the file. ie if original file was "original.avi" the output file would be "deshaken_original.mp4". |
Registered Member
|
my scripts is like tour last post :
I have a file "Deshake" in ~/.gnome2/nautilus-scripts directory, with KDE, there must be something similar. -------------------------------------------
-------------------------------------------
For each file passed in parameter, the script doing : -delete the file previously created -convert the file with ffmpeg to be recognized by VirtualDub -deshake tempory file "input.avi" (the file converted by ffmpeg) to a file "output.avi" -delete tempory file -rename output file to original name + "-stab.avi" Deshaker.syl : -------------------------------------------
-------------------------------------------
You need to change one time all names ("Z:\\media\\data*" and "/media/data*") It's not optimized, it's not the best way and the names are hard coded, but it works very well and it's simple. However, it lacks the offset of the audio and I will add several sets of parameters for the second pass (to make differents outputs for each files) |
Registered Member
|
========
>> Any tips for getting deshaker to be recognized as a plugin in >> virtualdub? I get an error saying it cannot load the module. > Got deshaker working. Also had to use winetricks to install MFC42.DLL ======== I decided to put VirtualDub with the deshaker plugin on my 64-bit openSUSE-11.2 running on my Dell Studio 1537 laptop. I encountered the same "can not load the module" error, and I found just using winetricks to install MFC42.DLL was insufficient. I also had to use a hint from the deshaker web site: http://www.guthspot.se/video/deshaker.htm which states: Important: If VirtualDub reports an error or if it can't load Deshaker correctly, you're most likely missing some required files. In that case, simply install the Microsoft Visual C++ 2005 SP1 Redistributable Package http://www.microsoft.com/downloads/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647 After installing that, VirtualDub running under wine was able to use the deshaker plugin. I'm testing it now. Its interesting to note that the VirtualDub/deshaker performance under my DualCore P8400 Dell Studio 1537 laptop is significantly slower than under my Intel Core i7 920 desktop (as would be expected given the Intel Core i7 have 4 cores (eight virtual)). |
Registered Member
|
There is a mjpegtools component called "y4mstabilizer" that will do image stabilization.
It is less sophisticated than the "Deshaker", and to get optimum results from it, you must deinterlace and resample to 444 (which can be done in the same mjpegtools command line pipeline, you need to separately install y4mscaler however). When I will be big, and have a lot of time, I will try to contribute code to it... There was another project, or at least an attempt, called something like "yuvstabilizer", but somehow I can't google it out now... I think it was by a guy from Sweden... it used some advanced computer vision library... Using some tools in Cinelera, a kind of image stabilzation can be obtained, too. But this is based on the tracking of a single object, which is less efficient, and will not give you full info about the camera motion. |
Registered Member
|
I took notes during my last two VirtualDub installations under wine (with the deshaker plugin) and wrote them in in a brief How To Guide here: http://forums.opensuse.org/new-user-how-faq-read-only/unreviewed-how-faq/429428-howto-install-virtualdub-under-wine-deshaker-plugin.html
While that is an openSUSE Linux forum, I think most of what I did is applicable to all Linux versions. |
Registered Member
|
> There is a mjpegtools component called "y4mstabilizer" that will do image stabilization.
> It is less sophisticated than the "Deshaker", and to get optimum results from it, > you must deinterlace and resample to 444 (which can be done in the same mjpegtools > command line pipeline, you need to separately install y4mscaler however). That is interesting to know. After reading your post I checked my openSUSE Packman packaged version of mjpegtools rpm and sure enough, included was /usr/bin/y4mstabilizer. With mjpegtools installed, by typing: "y4mstabilizer -h" one can learn a bit more about this mjpegtools stabilization package. Edit: further to this, I note the mjpegtools mailing list has examples of the use of y4mstabilizer http://sourceforge.net/mailarchive/forum.php?thread_name=1244141157.9699.66.camel%40hal9000&forum_name=mjpeg-users There are examples in that thread of useage attempts ... I have not tried this so I can not comment on its use. The syntax from my copy and paste may not be good. |
Registered Member
|
Finally I found the other thing, it is called "yuv motion tools", and is from Denmark, not Sweden :-)
It is called YUV motion tools, for download see here: http://vaults.atomicmonstergirls.net/useful/techworks/utilities/yuvmotiontools/ http://atomicmonstergirls.net/blog/2008/09/ and the project site is at http://savannah.gnu.org/ but does not seem to be very active. I remember that once it was accompanied with a rather long webpage containing an exhaustive descriprion and examples, but that I still cannot find. I have downloaded it a few minutes ago, it compiled without problems, but will not work. I fed it a DV clip through the suggested pipeline, but it just throws out an error and dies... I'll try to contact the author... |
Registered Member
|
I have contacted the author. He is a very nice guy, and has fixed the bug in no time.
Now this works, so we have another image stabilizing tool under Linux! It is based on the "openCV" computer vision libary. He also pointed out that the english description page somehow got lost, only the danish version remains: http://www.modspil.dk/itogtech/fri_software_og_multimedier__videostabilisering_med_yuv_motion_tools_og_mjpegtools.html |
Registered Member
|
> He also pointed out that the english description page
> somehow got lost, only the danish version remains: Too bad about no English version (for us who do not speak Danish). I note here a translator for Danish to English: * http://www.translation-guide.com/free_online_translators.php?from=Danish&to=English where one just copies the Danish web page URL into that translation tool. Of course one has to then go and change the code that was inappropriately translated. And as in all such electronic/computer translations, the translation often does not make sense. |
Registered Member
|
If the motion stabilization effect is based on OpenCV you should be able to contact Frei0r developers and ask them to include the effect in Frei0r. They are very nice guys probably interested in this kind of tool. Or maybe the effect developer in Danemark would be interested to add the effect to Frei0r. You can create a ticket on Frei0r here: http://www.piksel.no/projects/frei0r/report and register the mailing list there: https://piksel.no/mailman/listinfo/frei0r-devel
When it is included in Frei0r, you can use it in Kdenlive. It is just a question of passing the information to the right persons. |
Registered Member
|
this really came as a surprise to me - some time ago I have installed "trasncode" on my suse 11.1 from the rpm repositories, but never knew it included a stabilizer...
Just typed tcmodinfo -i stabilize and tcmodinfo -i transform and saw that really it was here all the time! |
Registered Member
|
I've tried the two stabilization commands as follows:
transcode -H0 -i INFILE -x mplayer,mplayer -J smartyuv=highq=1:diffmode=2:cubic=1:Blend=1:chromathres=4:threshold=8:doChroma=1 -J stabilize -y null,null -o dummy transcode -H0 -i INFILE -x mplayer,mplayer -J smartyuv=highq=1:diffmode=2:cubic=1:Blend=1:chromathres=4:threshold=8:doChroma=1 -J transform -o OUTFILE -y ffmpeg,ffmpeg -F huffyuv And my resulting file is just coloured snow. Here are my outputs from the two commands: For the first statement: transcode -H0 -i INFILE -x mplayer,mplayer -J smartyuv=highq=1:diffmode=2:cubic=1:Blend=1:chromathres=4:threshold=8:doChroma=1 -J stabilize -y null,null -o dummy I get: keithclark@HP1211N:~/Videos/Home Video/22 January 2010$ transcode -H0 -i VID00003.MP4 -x mplayer,mplayer -J smartyuv=highq=1:diffmode=2:cubic=1:Blend=1:chromathres=4:threshold=8:doChroma=1 -J stabilize -y null,null -o dummy transcode v1.1.4 (C) 2001-2003 Thomas Oestreich, 2003-2009 Transcode Team [transcode] V: AV demux/sync | (1) sync AV at initial MPEG sequence [transcode] V: import frame | 720x576 1.25:1 encoded @ UNKNOWN [transcode] V: bits/pixel | 0.174 [transcode] V: decoding fps,frc | 25.000,0 [transcode] V: video format | YUV420 (4:2:0) aka I420 [transcode] A: import format | 0x2000 AC3 [48000,16,2] [transcode] A: export | disabled [transcode] V: encoding fps,frc | 25.000,3 [transcode] A: bytes per frame | 7680 (7680.000000) [transcode] A: adjustment | 0@1000 [transcode] V: IA32/AMD64 accel | sse3 sse2 sse 3dnowext 3dnow mmxext mmx cmove asm [transcode] V: video buffer | 10 @ 720x576 [0x2] [transcode] A: audio buffer | 10 @ 48000x2x16 [import_mplayer.so] v0.1.2 (2007-11-01) (video) rendered by mplayer | (audio) rendered by mplayer [filter_smartyuv.so] options=highq=1:diffmode=2:cubic=1:Blend=1:chromathres=4:threshold=8:doChroma=1 [filter_smartyuv.so] (MMX) 0.1.6 (2007-05-31) Motion-adaptive deinterlacing [filter_stabilize.so] v0.4.3 (2008-11-30) extracts relative transformations of subsequent frames (used for stabilization together with the transform filter in a second pass) [filter_stabilize.so] Image Stabilization Settings: [filter_stabilize.so] maxshift = 48 [filter_stabilize.so] stepsize = 2 [filter_stabilize.so] allowmax = 1 [filter_stabilize.so] algo = 1 [filter_stabilize.so] fieldsetup = 3 [filter_stabilize.so] fieldsize = 57 [filter_stabilize.so] result = VID00003.MP4.trf [export_null.so] v0.1.2 (2001-08-17) (video) null | (audio) null [import_mplayer.so] mplayer -slave -hardframedrop -vo null -ao pcm:nowaveheader:file="/tmp/mplayer2transcode-audio.4HYsNd" "VID00003.MP4" > /dev/null 2>&1 [import_mplayer.so] tcextract -i /tmp/mplayer2transcode-audio.4HYsNd -x pcm -t raw [import_mplayer.so] mplayer -slave -benchmark -noframedrop -nosound -vo yuv4mpeg:file=/tmp/mplayer2transcode-video.Kyaf3X "VID00003.MP4" -osdlevel 0 > /dev/null 2>&1 [import_mplayer.so] tcextract -i /tmp/mplayer2transcode-video.Kyaf3X -x yuv420p -t yuv4mpeg [decoder.c] cancelling the import threads 0:00:32, (17| 0| 3) [transcode] encoded 822 frames (0 dropped, 0 cloned), clip length 32.88 s ************************************************************************* For the second statement: transcode -H0 -i INFILE -x mplayer,mplayer -J smartyuv=highq=1:diffmode=2:cubic=1:Blend=1:chromathres=4:threshold=8:doChroma=1 -J transform -o OUTFILE -y ffmpeg,ffmpeg -F huffyuv I get: keithclark@HP1211N:~/Videos/Home Video/22 January 2010$ transcode -H0 -i VID00003.MP4 -x mplayer,mplayer -J smartyuv=highq=1:diffmode=2:cubic=1:Blend=1:chromathres=4:threshold=8:doChroma=1 -J transform -o VID00003_STAB.MP4 -y ffmpeg,ffmpeg -F huffyuv transcode v1.1.4 (C) 2001-2003 Thomas Oestreich, 2003-2009 Transcode Team [transcode] V: AV demux/sync | (1) sync AV at initial MPEG sequence [transcode] V: import frame | 720x576 1.25:1 encoded @ UNKNOWN [transcode] V: bits/pixel | 0.174 [transcode] V: decoding fps,frc | 25.000,0 [transcode] V: video format | YUV420 (4:2:0) aka I420 [transcode] A: import format | 0x2000 AC3 [48000,16,2] [transcode] A: export format | 0x55 MPEG ES Layer 3 [48000,16,2] 128 kbps [transcode] V: export format | unknown (module dependant) [transcode] V: encoding fps,frc | 25.000,3 [transcode] A: bytes per frame | 7680 (7680.000000) [transcode] A: adjustment | 0@1000 [transcode] V: IA32/AMD64 accel | sse3 sse2 sse 3dnowext 3dnow mmxext mmx cmove asm [transcode] V: video buffer | 10 @ 720x576 [0x2] [transcode] A: audio buffer | 10 @ 48000x2x16 [import_mplayer.so] v0.1.2 (2007-11-01) (video) rendered by mplayer | (audio) rendered by mplayer [filter_smartyuv.so] options=highq=1:diffmode=2:cubic=1:Blend=1:chromathres=4:threshold=8:doChroma=1 [filter_smartyuv.so] (MMX) 0.1.6 (2007-05-31) Motion-adaptive deinterlacing [filter_transform.so] v0.4.4 (2008-12-06) transforms each frame according to transformations given in an input file (e.g. translation, rotate) see also filter stabilize [filter_transform.so] Image Transformation/Stabilization Settings: [filter_transform.so] maxshift = -1 [filter_transform.so] maxangle = -1.000000 [filter_transform.so] smoothing = 10 [filter_transform.so] crop = Keep [filter_transform.so] relative = True [filter_transform.so] invert = False [filter_transform.so] input = VID00003.MP4.trf [export_ffmpeg.so] v0.3.18 (2008-11-29) (video) Lavc52.20.0 | (audio) MPEG/AC3/PCM [import_mplayer.so] mplayer -slave -hardframedrop -vo null -ao pcm:nowaveheader:file="/tmp/mplayer2transcode-audio.LIQeMN" "VID00003.MP4" > /dev/null 2>&1 [import_mplayer.so] tcextract -i /tmp/mplayer2transcode-audio.LIQeMN -x pcm -t raw [import_mplayer.so] mplayer -slave -benchmark -noframedrop -nosound -vo yuv4mpeg:file=/tmp/mplayer2transcode-video.1ZLzyO "VID00003.MP4" -osdlevel 0 > /dev/null 2>&1 [import_mplayer.so] tcextract -i /tmp/mplayer2transcode-video.1ZLzyO -x yuv420p -t yuv4mpeg [export_ffmpeg.so] Using FFMPEG codec 'huffyuv' (FourCC 'HFYU', Lossless HUFFYUV codec). [export_ffmpeg.so] No profile selected [export_ffmpeg.so] warning: Error opening configuration file ./ffmpeg.cfg: No such file or directory [export_ffmpeg.so] Starting 1 thread(s) [export_ffmpeg.so] Set display aspect ratio to input [huffyuv @ 0x20e5470]using huffyuv 2.2.0 or newer interlacing flag [export_ffmpeg.so] warning: Usage of this module for audio encoding is deprecated. [export_ffmpeg.so] warning: Consider switch to export_tcaud module. [transcode] Audio: using lame-3.98.2 [decoder.c] cancelling the import threads 0:00:32, (17| 0| 3) [transcode] encoded 822 frames (0 dropped, 0 cloned), clip length 32.88 s |
Registered Member
|
I also tried the transcode and vid.stab commands above but all I get is these messages:
[filter_stabilize.so] warning: too low contrast! No field remains. Use larger fild size. and a noise like output file. This was with transcode version 1.1.5 with vid.stab 0.75 patch. Does anyone know a working transcode version with or without patches? |
Registered users: Bing [Bot], Google [Bot], kde-naveen, Sogou [Bot]