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 > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 12th February 2015, 14:35   #61  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
I'm trying it right now with the exr from BBB.
It seems to work really well, if i have some spare cpu in the next years maybe there will be a 16bit h265 lossless version of BBB thanks to vapoursynth
MonoS is offline   Reply With Quote
Old 12th February 2015, 14:44   #62  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
If this version is confirmed to mostly work I'll probably go on and add float output support as well since it's a very small modification to do.

...some day.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 12th February 2015, 15:33   #63  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
Maybe something don't work quite well, but i don't know.

Importing the exr from BBB [16bit float] the format is specified as RGB48 and not RGBS.
Is this expected??
MonoS is offline   Reply With Quote
Old 12th February 2015, 15:35   #64  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by MonoS View Post
Maybe something don't work quite well, but i don't know.

Importing the exr from BBB [16bit float] the format is specified as RGB48 and not RGBS.
Is this expected??
Yes. Imagemagick is retarded so at compile time you have to specify the image format. For all images opened... Ever. This is why I may add float support later.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 12th February 2015, 15:43   #65  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
I bet they won the Ig Nobel for programing at some point
MonoS is offline   Reply With Quote
Old 20th February 2015, 06:52   #66  |  Link
Kupildivan
Registered User
 
Join Date: Feb 2015
Posts: 19
I've done this script:

Code:
import vapoursynth as vs
core = vs.get_core()
v = core.ffms2.Source ('HOB2.mkv')
v = core.std.Trim (v, 1600, 1701)
v = core.fmtc.matrix (v, mat="709", col_fam=vs.RGB, bits=16)
v = core.imwri.Write (v, 'PNG48', 'IMG\%05d.png')
v.set_output()
and the .bat file for it:

Code:
"C:\Program Files (x86)\VapourSynth\core64\vspipe.exe" VS.vpy -
that writes on disk only 7 first images and cmd hangs.

How to write all of these 101 images proprerly?

Last edited by Kupildivan; 20th February 2015 at 07:52.
Kupildivan is offline   Reply With Quote
Old 20th February 2015, 12:54   #67  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Kupildivan View Post
I've done this script:

Code:
import vapoursynth as vs
core = vs.get_core()
v = core.ffms2.Source ('HOB2.mkv')
v = core.std.Trim (v, 1600, 1701)
v = core.fmtc.matrix (v, mat="709", col_fam=vs.RGB, bits=16)
v = core.imwri.Write (v, 'PNG48', 'IMG\%05d.png')
v.set_output()
and the .bat file for it:

Code:
"C:\Program Files (x86)\VapourSynth\core64\vspipe.exe" VS.vpy -
that writes on disk only 7 first images and cmd hangs.

How to write all of these 101 images proprerly?
I'll have to test it myself and see. I mostly tested reading images acutally...
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 20th February 2015, 20:54   #68  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Try piping to NUL:
Code:
"C:\Program Files (x86)\VapourSynth\core64\vspipe.exe" VS.vpy NUL
sneaker_ger is offline   Reply With Quote
Old 21st February 2015, 04:39   #69  |  Link
Kupildivan
Registered User
 
Join Date: Feb 2015
Posts: 19
Quote:
Originally Posted by sneaker_ger View Post
Try piping to NUL:
Code:
"C:\Program Files (x86)\VapourSynth\core64\vspipe.exe" VS.vpy NUL
It's worked for me - "Output 102 frames in 217.67 seconds (0.47 fps)".

As for real writing I forgot to mention when I click on that .bat file cmd window begins to draw very long sequence of symbols for a while and then it hangs without suggesting to close it until I click on it.
I suppose I have done a mistake somewhere in the script or bat.
Kupildivan is offline   Reply With Quote
Old 21st February 2015, 08:59   #70  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by Kupildivan View Post
It's worked for me - "Output 102 frames in 217.67 seconds (0.47 fps)".

As for real writing I forgot to mention when I click on that .bat file cmd window begins to draw very long sequence of symbols for a while and then it hangs without suggesting to close it until I click on it.
I suppose I have done a mistake somewhere in the script or bat.
Yes. The hyphen (which you replaced with "NUL") tells vspipe to write the output to stdout, i.e. dump it all in the cmd window.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 22nd February 2015, 12:01   #71  |  Link
Kupildivan
Registered User
 
Join Date: Feb 2015
Posts: 19
I knew it. Anyway it doesn't matter, for I found another way to convert 10-bit mkv to png in the neighbour thread:
Code:
%ffmpeg% -i "Хоббит. Битва пяти воинств - Трейлер №2 в 3D [DCPrip 2K Hi444PP Hi10P OU].mkv" IMG\%%04d.png
Even without forcing 16-bits to output it creates correct sequence of PNG48 by default for such video.
Kupildivan is offline   Reply With Quote
Old 23rd July 2015, 12:51   #72  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Can someone with a clean R27 Windows install check whether or not he has the ImageMagick plugin? I thought it's supposed to come with the VapourSynth package nowadays but it seems to be missing here. Or at least it does not load here (Win 7 x64, no AVX CPU)

Code:
ret = core.imwri.Read('graded_edit_%05d.tiff')
"Python exception: No attribute with the name imwri exists"

Last edited by sneaker_ger; 23rd July 2015 at 12:58.
sneaker_ger is offline   Reply With Quote
Old 23rd July 2015, 12:59   #73  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
It's not included and never will be due to its insane size.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 23rd July 2015, 12:59   #74  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
It's listed as included in the docs:
http://www.vapoursynth.com/doc/includedplugins.html
sneaker_ger is offline   Reply With Quote
Old 23rd July 2015, 13:01   #75  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
That should be read as "included in the source tree"
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 30th July 2015, 15:14   #76  |  Link
dipje
Registered User
 
Join Date: Oct 2014
Posts: 268
I'm able to write EXR images no problem, but they get saved as (if I see it correctly) full 32-bit floating-point uncompressed files. Or at least 16-bit FP uncompressed.. ie huge .
The ImageMagick build seems to have support for other compression types (For example 'piz') since it's listed in the output that convert.exe and mogrify.exe give.

So is it possible to add a parameter to specify compression type (also handy for things like TIFF and such), or at least change the default for EXR somehow?

I'm also willing to mock around and try to change + compile it for my own, but you said you used a custom-built ImageMagick for all this. Is that located somewhere so it's easier for me to recompile imwri.dll against your ImageMagick build?
dipje is offline   Reply With Quote
Old 30th July 2015, 15:55   #77  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by dipje View Post
I'm able to write EXR images no problem, but they get saved as (if I see it correctly) full 32-bit floating-point uncompressed files. Or at least 16-bit FP uncompressed.. ie huge .
The ImageMagick build seems to have support for other compression types (For example 'piz') since it's listed in the output that convert.exe and mogrify.exe give.

So is it possible to add a parameter to specify compression type (also handy for things like TIFF and such), or at least change the default for EXR somehow?

I'm also willing to mock around and try to change + compile it for my own, but you said you used a custom-built ImageMagick for all this. Is that located somewhere so it's easier for me to recompile imwri.dll against your ImageMagick build?
You can use the official sdk stuff I think. Just grab the actual dlls from my version. I think that should work.

I'll add an argument for compression type and that stuff some day. Actually I completely forgot about it since I mostly tested with png.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 3rd August 2015, 16:25   #78  |  Link
dipje
Registered User
 
Join Date: Oct 2014
Posts: 268
Had a bit of a fight to understand how the ImageMagick build-thingy works. Actually reading the manual helped :S, so I got _something_ build for MSVC 2010 with a slightly more recent ImageMagick built than what you used.
Then, as you said, used it just to compile my imwri.dll and just replaced that in my Vapoursynth folder, so using your DLLs. Stuff works.

Had to fight a bit to get imwri.cpp compiling under MSVC 2010, since you seem to be using some c++11 stuff. After it compiled and worked, added a simple 'compresstype' optional string parameter, then used an ugly 'if else if else'-block to match the strings to image.compressType() calls, and tadaaah. Seems to be working. Full-hd EXR files go from 16mb to +/- 6mb with Piz compression enabled while still being lossless and some sort of deep color. Finally a nice way to go in-and-out of After Effects / Vapoursynth .
dipje is offline   Reply With Quote
Old 4th August 2015, 22:27   #79  |  Link
kaefert
Registered User
 
Join Date: Jul 2013
Posts: 60
how can the imwri plugin be compiled on linux? I've followed the guide here: http://www.vapoursynth.com/doc/insta...n-instructions but this did not compile the imwri plugin, only a few others.
@dipje what manual do you mean? is there some manual for compiling imwri somewhere?

UPDATE: Okey. So far thats what I managed to do:
Code:
cd ~/src/vapoursynth/src/filters/imwri
g++ -std=c++0x -I/usr/include/ImageMagick/ -I/home/kaefert/src/vapoursynth/include/ imwri.cpp
which still gives quite a few errors:
Code:
imwri.cpp: In function ‘const VSFrameRef* writeGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, const VSAPI*)’:
imwri.cpp:169:19: error: ‘class Magick::Image’ has no member named ‘quantizeDitherMethod’
             image.quantizeDitherMethod(Magick::FloydSteinbergDitherMethod);
                   ^
imwri.cpp:169:40: error: ‘FloydSteinbergDitherMethod’ is not a member of ‘Magick’
             image.quantizeDitherMethod(Magick::FloydSteinbergDitherMethod);
                                        ^
imwri.cpp:169:40: note: suggested alternative:
In file included from /usr/include/ImageMagick/magick/deprecate.h:34:0,
                 from /usr/include/ImageMagick/magick/MagickCore.h:85,
                 from /usr/include/ImageMagick/Magick++/Include.h:43,
                 from /usr/include/ImageMagick/Magick++.h:9,
                 from imwri.cpp:27:
/usr/include/ImageMagick/magick/quantize.h:32:3: note:   ‘FloydSteinbergDitherMethod’
   FloydSteinbergDitherMethod
   ^
imwri.cpp:173:23: error: ‘class Magick::Image’ has no member named ‘alphaChannel’
                 image.alphaChannel(Magick::ActivateAlphaChannel);
                       ^
imwri.cpp:173:36: error: ‘ActivateAlphaChannel’ is not a member of ‘Magick’
                 image.alphaChannel(Magick::ActivateAlphaChannel);
                                    ^
imwri.cpp:173:36: note: suggested alternative:
In file included from /usr/include/ImageMagick/magick/draw.h:26:0,
                 from /usr/include/ImageMagick/magick/annotate.h:25,
                 from /usr/include/ImageMagick/magick/MagickCore.h:66,
                 from /usr/include/ImageMagick/Magick++/Include.h:43,
                 from /usr/include/ImageMagick/Magick++.h:9,
                 from imwri.cpp:27:
/usr/include/ImageMagick/magick/image.h:33:3: note:   ‘ActivateAlphaChannel’
   ActivateAlphaChannel,
   ^
imwri.cpp: In function ‘void readCreate(const VSMap*, VSMap*, void*, VSCore*, const VSAPI*)’:
imwri.cpp:572:58: warning: narrowing conversion of ‘d.std::unique_ptr<_Tp, _Dp>::operator-><ReadData, std::default_delete<ReadData> >()->ReadData::filenames.std::vector<_Tp, _Alloc>::size<std::basic_string<char>, std::allocator<std::basic_string<char> > >()’ from ‘std::vector<std::basic_string<char> >::size_type {aka long unsigned int}’ to ‘int’ inside { } [-Wnarrowing]
     d->vi[0] = { nullptr, 30, 1, 0, 0, d->filenames.size(), 0 };
update2: okey, so I guess maybe the imagemagick version included in my distribution is too old (8:6.7.7.10-6ubuntu3 --> 6.7.7.10)
I'm gonna try and update

Last edited by kaefert; 5th August 2015 at 06:49.
kaefert is offline   Reply With Quote
Old 5th August 2015, 07:26   #80  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by kaefert View Post
how can the imwri plugin be compiled on linux? I've followed the guide here: http://www.vapoursynth.com/doc/insta...n-instructions but this did not compile the imwri plugin, only a few others.
You need to pass '--enable-imwri' to configure. It's right there in the output of 'configure --help'.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill 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 16:00.


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