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 29th March 2019, 01:34   #21  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,758
Quote:
Originally Posted by Wolfberry View Post
I will guess some kinds of frame properties (matrix, transfer...) is missing when reading that particular source file.
Yes.



@WorBry

Set the clip props for the missing matrix parameter

If you look at mediainfo , "Matrix" is usually there, but not on this clip (or at least the one I tested, I'm assuming they are the same from the same batch)

Code:
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Code:
clip = core.std.SetFrameProp(clip, prop="_Matrix", intval=1)
poisondeathray is offline   Reply With Quote
Old 29th March 2019, 02:36   #22  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,187
Tried:

Code:
import vapoursynth as vs
core = vs.get_core()
clip = core.lsmas.LWLibavSource(source=r"X:/A003C003H1801239K_CANON.MXF",format="YUV422P10", fpsnum=30000, fpsden=1001)
clip = core.std.SetFrameProp(clip=clip, prop="_Matrix", intval=1)
clip.set_output()
...and:

Code:
import vapoursynth as vs
core = vs.get_core()
clip = core.lsmas.LWLibavSource(source=r"X:/A003C003H1801239K_CANON.MXF",format="YUV422P10", fpsnum=30000, fpsden=1001)
clip = core.resize.Point(clip=clip, matrix_in_s="709")
clip.set_output()
...but get the same error.



Sorry Wolfberry, didn't intend to turn your thread into a case-specific problem solving session, but might as well stick with it if poisondeathray has a fix.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 29th March 2019 at 03:03.
WorBry is offline   Reply With Quote
Old 29th March 2019, 02:57   #23  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,758
ffms2 works for me in vsedit (VapourSynthEditor-r19-64bit), only when setting the props , otherwise I get the same error

Lsmash ok without it . I just used default settings, did not specify format or any parameters. It opened as YUV422P10

Using both updated versions in the 1st post (vslsmashsource-20190326, ffms2-20190326)

The clip was A003C074H180124UZ_CANON.MXF ,maybe something different about it ?


Are you sure you're loading the correct .dll version, (not mixing up autoloading from some other directory) ?
poisondeathray is offline   Reply With Quote
Old 29th March 2019, 03:43   #24  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,187
Quote:
Originally Posted by poisondeathray View Post
...
vsedit (VapourSynthEditor-r19-64bit)..
Same here.

Quote:
Originally Posted by poisondeathray View Post
Using both updated versions in the 1st post (vslsmashsource-20190326, ffms2-20190326)
Same here.

Quote:
Originally Posted by poisondeathray View Post
Are you sure you're loading the correct .dll version, (not mixing up autoloading from some other directory) ?
I'm sure. I'm using ChaosKing's Fatpack Portable and simply replaced the existing ffms2 and vslsmashsource dll's (and ffmsindex.exe) in the Plugins folder with the above versions.

Quote:
Originally Posted by poisondeathray View Post
The clip was A003C074H180124UZ_CANON.MXF ,maybe something different about it ?
I'll check that clip and others from the set.

Edit: Yes, that particular clip opens and previews in VSedit with LWLibavSource and ffms2, even without setting the frame props. Two other clips A003C030H180123NR_CANON.MXF and A003C072H180124NU_CANON.MXF) gave the same error as the first one I tested (A003C003H1801239K_CANON.MXF).

What distinguishes A003C074H180124UZ_CANON.MXF is that it is B&W (and quite noisy) - looks to be shot in Infrared mode at night ? I converted all four clips to ProRes with ffmpeg just to be sure and that's the only one that's B&W. How strange.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 29th March 2019 at 04:27.
WorBry is offline   Reply With Quote
Old 29th March 2019, 04:37   #25  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,758
Hah! figures I'd download the different one

I tried A003C027H180123PR_CANON.MXF, and got the same error as you.

It must not be reading the metadata correctly, maybe since this type of mxf support was recently added to ffmpeg

Just set them all and it works
Code:
clip = core.std.SetFrameProp(clip, prop="_Matrix", intval=1)
clip = core.std.SetFrameProp(clip, prop="_Transfer", intval=1)
clip = core.std.SetFrameProp(clip, prop="_Primaries", intval=1)
mediainfo reads as
Code:
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Not sure if it's really a "bug" report , maybe file a feature enhancement
poisondeathray is offline   Reply With Quote
Old 29th March 2019, 04:48   #26  |  Link
_Al_
Registered User
 
Join Date: May 2011
Posts: 28
I get the same error,

It actually loads clip:
Code:
Format Descriptor
	Id: 3000020
	Name: YUV422P10
	Color Family: YUV
	Sample Type: Integer
	Bits Per Sample: 10
	Bytes Per Sample: 2
	Planes: 3
	Subsampling W: 1
	Subsampling H: 0
that is why Check Script in VSEdit does not catch any error first,
for example script just flies thru these lines without printing error:
Code:
try:
   f = clip.get_frame(0)
except:
    print('error')
It just looks, there is a sort of delay and then it throws error
_Al_ is offline   Reply With Quote
Old 29th March 2019, 04:52   #27  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,187
Quote:
Originally Posted by poisondeathray View Post
Just set them all and it works
Code:
clip = core.std.SetFrameProp(clip, prop="_Matrix", intval=1)
clip = core.std.SetFrameProp(clip, prop="_Transfer", intval=1)
clip = core.std.SetFrameProp(clip, prop="_Primaries", intval=1)
Yep, that does it. Brilliant deduction Holmes
__________________
Nostalgia's not what it used to be
WorBry is offline   Reply With Quote
Old 29th March 2019, 06:46   #28  |  Link
_Al_
Registered User
 
Join Date: May 2011
Posts: 28
interesting, Python catches this with:
Code:
try:
      stride = clip.get_frame(0).get_stride(0)
except vs.Error as err:
      print(str(err))
but not with:
f = clip.get_frame(0)

not really, both catch that error but only after a conversion (to RGB or COMPATBGR32), but not original clip,
because , there is nothing wrong with the clip , just conversion fails because of those missing props

Last edited by _Al_; 29th March 2019 at 07:04.
_Al_ is offline   Reply With Quote
Old 4th April 2019, 04:00   #29  |  Link
_Al_
Registered User
 
Join Date: May 2011
Posts: 28
M2TS camcorder videos, 1920x1080, give a trouble, it just crashes VSEdit or any script, it can be tested on 1920x1080 M2TS video from here I tried that last Jay Leno clip.
Code:
import vapoursynth as vs
from vapoursynth import core
input=r'F:/20090227_235906-H.264.m2ts'
clip = core.lsmas.LWLibavSource(input)
clip.set_output()
I have here some old vslsmashsource.dll dated 2/23/2017 and that one was ok

edit: it seems to be ok, I did not delete old lwi files, thanks for the plugins

Last edited by _Al_; 4th April 2019 at 04:07.
_Al_ is offline   Reply With Quote
Old 7th April 2019, 06:40   #30  |  Link
Wolfberry
Helenium(Easter)
 
Wolfberry's Avatar
 
Join Date: Aug 2017
Location: Hsinchu, Taiwan
Posts: 96
Rebuild with updated libraries, see first post for details.
__________________
Monochrome Anomaly
Wolfberry is offline   Reply With Quote
Old 8th April 2019, 18:09   #31  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 450
you use any patch for build lsmashsource?

greetings
__________________
[AUR] Vapoursynth Stuff
sl1pkn07 is offline   Reply With Quote
Old 9th April 2019, 06:02   #32  |  Link
Wolfberry
Helenium(Easter)
 
Wolfberry's Avatar
 
Join Date: Aug 2017
Location: Hsinchu, Taiwan
Posts: 96
#77 and #78

I also removed the deprecated av_register_all() and avcodec_register_all() calls from the source.
__________________
Monochrome Anomaly
Wolfberry is offline   Reply With Quote
Old 9th April 2019, 16:32   #33  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 450
have you a patch for the last one?

gretings
__________________
[AUR] Vapoursynth Stuff
sl1pkn07 is offline   Reply With Quote
Old 14th April 2019, 22:32   #34  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 450
thanks!
__________________
[AUR] Vapoursynth Stuff
sl1pkn07 is offline   Reply With Quote
Old 15th April 2019, 03:24   #35  |  Link
Wolfberry
Helenium(Easter)
 
Wolfberry's Avatar
 
Join Date: Aug 2017
Location: Hsinchu, Taiwan
Posts: 96
A reminder, the proper way to patch it is to do a version check, I simply delete it because I don't need compatibility with older ffmpeg version.

Code:
#define VERSION_CHECK(LIB, cmp, major, minor, micro) ((LIB) cmp (AV_VERSION_INT(major, minor, micro)))

#if VERSION_CHECK(LIBAVFORMAT_VERSION_INT, <, 58, 9, 100)
#       define FFMS_REGISTER() av_register_all();
#else
#       define FFMS_REGISTER()
#endif

Example taken from ffms2/ffmscompat.h
__________________
Monochrome Anomaly
Wolfberry is offline   Reply With Quote
Old 15th April 2019, 18:17   #36  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 450
my (distro) version of ffmpeg is 4.1.2. np (?)

EDIT: is a warning, but:

Code:
../common/libavsmash.c: In function 'libavsmash_flush_buffers':
../common/libavsmash.c:807:6: warning: 'refcounted_frames' is deprecated [-Wdeprecated-declarations]
      || open_decoder( &ctx, codecpar, codec, config->ctx->thread_count, config->ctx->refcounted_frames ) < 0 )
      ^~
In file included from /usr/include/libavformat/avformat.h:319,
                 from ../common/libavsmash.c:33:
/usr/include/libavcodec/avcodec.h:2360:9: note: declared here
     int refcounted_frames;
         ^~~~~~~~~~~~~~~~~
../common/libavsmash.c: In function 'update_configuration':
../common/libavsmash.c:857:5: warning: 'refcounted_frames' is deprecated [-Wdeprecated-declarations]
     const int          refcounted_frames = config->ctx->refcounted_frames;
     ^~~~~
In file included from /usr/include/libavformat/avformat.h:319,
                 from ../common/libavsmash.c:33:
/usr/include/libavcodec/avcodec.h:2360:9: note: declared here
     int refcounted_frames;
         ^~~~~~~~~~~~~~~~~
../common/decode.c: In function 'open_decoder':
../common/decode.c:82:5: warning: 'refcounted_frames' is deprecated [-Wdeprecated-declarations]
     c->refcounted_frames = refcounted_frames;
     ^
In file included from ../common/decode.c:27:
/usr/include/libavcodec/avcodec.h:2360:9: note: declared here
     int refcounted_frames;
         ^~~~~~~~~~~~~~~~~
../common/lwlibav_dec.c: In function 'lwlibav_flush_buffers':
../common/lwlibav_dec.c:52:5: warning: 'refcounted_frames' is deprecated [-Wdeprecated-declarations]
     if( open_decoder( &ctx, codecpar, codec, dhp->ctx->thread_count, dhp->ctx->refcounted_frames ) < 0 )
     ^~
In file included from /usr/include/libavformat/avformat.h:319,
                 from ../common/lwlibav_dec.c:29:
/usr/include/libavcodec/avcodec.h:2360:9: note: declared here
     int refcounted_frames;
         ^~~~~~~~~~~~~~~~~
../common/lwlibav_dec.c: In function 'lwlibav_update_configuration':
../common/lwlibav_dec.c:90:5: warning: 'refcounted_frames' is deprecated [-Wdeprecated-declarations]
     const int          refcounted_frames = dhp->ctx->refcounted_frames;
     ^~~~~
In file included from /usr/include/libavformat/avformat.h:319,
                 from ../common/lwlibav_dec.c:29:
/usr/include/libavcodec/avcodec.h:2360:9: note: declared here
     int refcounted_frames;
         ^~~~~~~~~~~~~~~~~
is possible silence it?

a have other patch for other warning:

Code:
diff --git a/common/osdep.c b/common/osdep.c
index d81e47f..a6900fe 100644
--- a/common/osdep.c
+++ b/common/osdep.c
@@ -65,3 +65,5 @@ FILE *lw_win32_fopen( const char *name, const char *mode )
 }
 
 #endif
+
+typedef int make_iso_compilers_happy;
diff --git a/VapourSynth/video_output.c b/VapourSynth/video_output.c
index 4599863..45a1fb0 100644
--- a/VapourSynth/video_output.c
+++ b/VapourSynth/video_output.c
@@ -20,7 +20,7 @@
 
 /* This file is available under an ISC license. */
 
-#include <string.h>
+#include <strings.h>
 
 /* Libav */
 #include <libavcodec/avcodec.h>         /* Decoder */
one of them is posted in the github repo

greetings
__________________
[AUR] Vapoursynth Stuff

Last edited by sl1pkn07; 15th April 2019 at 18:23.
sl1pkn07 is offline   Reply With Quote
Old 16th April 2019, 07:28   #37  |  Link
Wolfberry
Helenium(Easter)
 
Wolfberry's Avatar
 
Join Date: Aug 2017
Location: Hsinchu, Taiwan
Posts: 96
New patch : https://pastebin.com/yVcwKTbE

Also silences the deprecated refcounted_frames warnings.

Compatibility: FFmpeg 4.0 and above (libavformat >= 58.9.100 to be precise)
__________________
Monochrome Anomaly

Last edited by Wolfberry; 16th April 2019 at 08:00.
Wolfberry 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 00:06.


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