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 > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 28th June 2013, 07:49   #61  |  Link
Music Fan
Registered User
 
Join Date: May 2009
Location: Belgium
Posts: 1,743
Quote:
Originally Posted by VFR maniac View Post
Inversion can be done by 'dominance'.



Even if a source file is TFF, If the first frame consists of two PAFF field coded pictures and the first field is missing, it should be treated as BFF.
Libavcodec returns frames by pair of two field coded picture.
You can see the source is TFF but the recorded and decoded stream is BFF.

source: ... T0 B1 T2 B3 T4 B5 T6 B7 T8 B9 ...
recorded: B1 T2 B3 T4 B5 T6 B7 T8 B9 ... (the first field dropped)
decoded: [B1 T2] [B3 T4] [B5 T6] [B7 T8] [B9 X] ...

For PAFF field coded pictures, there is no concept of field order or field dominance.
They only play role being coded as top field or bottom field.
Thanks, interesting.
Do you believe that TV channels encode in PAFF ?
I believed it was rare.
Music Fan is offline   Reply With Quote
Old 28th June 2013, 07:55   #62  |  Link
Music Fan
Registered User
 
Join Date: May 2009
Location: Belgium
Posts: 1,743
Quote:
Originally Posted by LigH View Post
The field dominance is an attribute of the video stream, not of the container.

If AssumeBFF().Bob() doubtlessly returns smooth motion, whereas AssumeTFF().Bob() returns a forth-and-back jitter, then it is correct, and the material was recorded using a camera with a dominant bottom field.
Not necessarily, tv channels often do field inversion to mix tff and bff sources (as we can do with video editing softwares).
When I used to record in analog, video was always in tff, for years, and on all channels.
I guess they also chose tff in digital.
Music Fan is offline   Reply With Quote
Old 28th June 2013, 08:58   #63  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,752
Quote:
Originally Posted by Music Fan View Post
Do you believe that TV channels encode in PAFF ?
I believed it was rare.
PAFF is probably more suitable for hardware real-time encoders (per-frame "decision" – possibly always "yes, this frame is interlaced" – is faster than per-macroblock decision). Many AVCHD cameras record PAFF.

If there is enough time to encode the material "offline", broadcasters may use more elaborate encoders; results created by x264 have been spotted in TV broadcasts already.
__

Field inversions ... do you mean wrong flagging (motion analysis reveals TFF order but bitstream flags report BFF), or do you mean a correct TFF/BFF conversion by omitting one field?
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid

Last edited by LigH; 28th June 2013 at 09:01.
LigH is offline   Reply With Quote
Old 28th June 2013, 10:00   #64  |  Link
Music Fan
Registered User
 
Join Date: May 2009
Location: Belgium
Posts: 1,743
Quote:
Originally Posted by LigH View Post
do you mean wrong flagging (motion analysis reveals TFF order but bitstream flags report BFF), or do you mean a correct TFF/BFF conversion by omitting one field?
I mean a correct conversion.
So I meant that TV often do that kind of conversion and we can't know if it was filmed in tff or bff.
And as my analog recordings were in tff and as MediaInfo also detects tff for my digital recordings, I was astonished to note that these digital recordings were in bff for Libavcodec.
But VFR maniac has given a good explanation about this phenomenon.

Quote:
Originally Posted by LigH View Post
PAFF is probably more suitable for hardware real-time encoders (per-frame "decision" – possibly always "yes, this frame is interlaced" – is faster than per-macroblock decision). Many AVCHD cameras record PAFF.
Ok, good to know.

Quote:
Originally Posted by LigH View Post
results created by x264 have been spotted in TV broadcasts already
Do you mean some typical x264 defects seen on TV, which means they also use x264 (which is free) ?

Last edited by Music Fan; 28th June 2013 at 11:13.
Music Fan is offline   Reply With Quote
Old 28th June 2013, 10:08   #65  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,752
I mean that there have been broadcasts where the video stream contained metadata revealing x264 as encoder.

Nothing to worry about, x264 has commercial licensing too.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 8th July 2013, 13:56   #66  |  Link
Music Fan
Registered User
 
Join Date: May 2009
Location: Belgium
Posts: 1,743
Update ;
http://k4095-takuan.blogspot.de/p/blog-page_17.html
Music Fan is offline   Reply With Quote
Old 16th July 2013, 07:40   #67  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,752
There is a report that Apple ProRes videos (e.g. clipcanvas_14348_PRORES_HQ.mov) are incorrectly decoded and deskewed by LWLibavVideoSource (LSMASHSource r632), in contrast to FFVideoSource (FFMS2 v2.18 RC1).
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 16th July 2013, 14:15   #68  |  Link
VFR maniac
Spinner of yarns
 
VFR maniac's Avatar
 
Join Date: May 2009
Posts: 164
Apple ProRes?
Haha, I guess the strange output from LWLibavVideoSource is high bit-depth interleaved format.
You may feel FFMS2 outputs correctly but, the fact, the output loses accuracy around 2-bit for each Y'CbCr component.
Try format="YUV422P8" or stacked=true.

Edit and Note: currently libavcodec ProRes decoder supports only Y'CbCr 4:2:2 10-bit and 4:4:4 10-bit format with or without alpha channel.
Therefore, LWLibavVideoSource(source="ProRes") always output in interleaved format unless user specifies output format.
And even if ProRes4444 (12-bit) is input, the default output format will be Y'CbCr 4:4:4 10-bit with alpha.
__________________
僕と契約して、L-SMASH developerになってよ!
L-SMASH | L-SMASH Works | Opus-in-ISOBMFF specification and reference software

Last edited by VFR maniac; 16th July 2013 at 17:07.
VFR maniac is offline   Reply With Quote
Old 24th July 2013, 20:23   #69  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
btw. is there some way to roughly predict the size of the LWLibavVideoSource index.
Since I can't specify where the index should be created, I normally use to let LWLibavVideoSource create the index inside the RAM, problem is on large files the index gets to large for Avisynth to handle, so I would like to predict the size before indexing a file so I can decide whether to use LWLibavVideoSource or not.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 25th July 2013, 11:10   #70  |  Link
VFR maniac
Spinner of yarns
 
VFR maniac's Avatar
 
Join Date: May 2009
Posts: 164
There is no way to predict the size of the index file.

The index file consists of properties per packet returned by libavformat in the overall stream.
(+plus CODEC specific decoder configurations and libavformat own index entries)
The size doesn't depend on the source file size.
__________________
僕と契約して、L-SMASH developerになってよ!
L-SMASH | L-SMASH Works | Opus-in-ISOBMFF specification and reference software

Last edited by VFR maniac; 25th July 2013 at 11:13.
VFR maniac is offline   Reply With Quote
Old 4th August 2013, 11:15   #71  |  Link
VFR maniac
Spinner of yarns
 
VFR maniac's Avatar
 
Join Date: May 2009
Posts: 164
Quote:
Originally Posted by HolyWu View Post
Code:
lsmas: exceeded the number of frames.
This message means the subsequent filter requests frame number exceeding the number of output frames from vslsmashsource.
For instance, the number of output frames from vslsmashsource is 239, and the filter requests 240-th frame, then vslsmashsource will return this error message.

I guess mvtools or VapourSynth's AviSynth compatible module causes the problem.
__________________
僕と契約して、L-SMASH developerになってよ!
L-SMASH | L-SMASH Works | Opus-in-ISOBMFF specification and reference software
VFR maniac is offline   Reply With Quote
Old 4th August 2013, 11:48   #72  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by VFR maniac View Post
This message means the subsequent filter requests frame number exceeding the number of output frames from vslsmashsource.
For instance, the number of output frames from vslsmashsource is 239, and the filter requests 240-th frame, then vslsmashsource will return this error message.

I guess mvtools or VapourSynth's AviSynth compatible module causes the problem.
Just return the last frame when that happens. Vs allows frames beyond the end to be requested.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now   Reply With Quote
Old 4th August 2013, 12:06   #73  |  Link
Music Fan
Registered User
 
Join Date: May 2009
Location: Belgium
Posts: 1,743
Hi,
how to configure LWLibavVideoSource to open VFR h264 ?
Music Fan is offline   Reply With Quote
Old 4th August 2013, 14:20   #74  |  Link
VFR maniac
Spinner of yarns
 
VFR maniac's Avatar
 
Join Date: May 2009
Posts: 164
@ Myrsloik
Should return with error or warning message?

@ Music Fan
I can't get what you mean.
__________________
僕と契約して、L-SMASH developerになってよ!
L-SMASH | L-SMASH Works | Opus-in-ISOBMFF specification and reference software
VFR maniac is offline   Reply With Quote
Old 4th August 2013, 14:31   #75  |  Link
Music Fan
Registered User
 
Join Date: May 2009
Location: Belgium
Posts: 1,743
Quote:
Originally Posted by VFR maniac View Post
@ Music Fan
I can't get what you mean.
I want to open a vfr video with LWLibavVideoSource, is there anything to add at the end of the 1st line of the script ?
For comparison, when it's done with DirectShowSource, one has to add convertfps=true.
Is there anything like this for LWLibavVideoSource ?
Music Fan is offline   Reply With Quote
Old 4th August 2013, 14:47   #76  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by VFR maniac View Post
@ Myrsloik
Should return with error or warning message?
As I said, filters are allowed to request frames beyond the end. No errors or warnings.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now   Reply With Quote
Old 5th August 2013, 09:38   #77  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,752
Current versions of L-SMASH Works appears to be r662.

Changelog is probably best read in the Github.
__

A user in the german doom9/Gleitz forum is reporting intermittent issues with batch-converted DVB-S2 720p50 movies being encoded twice as long, sometimes repeated, sometimes with green blanks. But before your alarm goes off, we are trying to discover the reason (RAM, resident AV, timing issue of indexing different files with always the same temporary name...). Usually a second run returns a correct conversion.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid

Last edited by LigH; 5th August 2013 at 09:45.
LigH is offline   Reply With Quote
Old 6th August 2013, 16:14   #78  |  Link
wOxxOm
Oz of the zOo
 
Join Date: May 2005
Posts: 208
Quote:
Originally Posted by VFR maniac View Post
I added supporting of a hack of high bit-depth input between rev594 and rev603.
For interleaved format (at default), only little endianness output is supported currently i.e. LSB comes at the first byte and MSB comes at the second.
Stacked format is also available but direct rendering is always not available if used.
In order to use LW in avisynth to process 10-bit video files with high-bitdepth plugins (like modded dfttest and mdegrain from the Dither package) the output needs to be converted.

Stacked=true: 950 fps (LWLibavVideoSource only) -> 400 fps drop.
Code:
msb = crop(0,0,0,height/2)
lsb = crop(0,height/2,0,0)
stackvertical(mt_lutxy(msb,lsb,"x 8 << y + 2 >>",u=3,v=3),
\ mt_lutxy(msb,lsb,"x 8 << y + 3 &u  6 <<",u=3,v=3))
On default settings it's even slower because of bad avisynth's turn implementation: 110 fps (or 300 fps with FTurn SSE2)
Code:
assumebff.turnleft.separatefields.turnright.assumeframebased
stackvertical( mt_lutxy(selectodd, selecteven, "x 8 << y + 2 >>", u=3,v=3),
\ mt_lutxy(selectodd, selecteven, "x 8 << y + 3 &u  6 <<", u=3,v=3))
BTW, the output of FFVideoSource with 10-bit-to-stacked hack can be used directly by the aforementioned plugins...
It'd be nice if the LW output for 10-bit files in avisynth would match that, since it's not as useful otherwise.

Last edited by wOxxOm; 6th August 2013 at 16:20.
wOxxOm is offline   Reply With Quote
Old 16th August 2013, 22:43   #79  |  Link
VFR maniac
Spinner of yarns
 
VFR maniac's Avatar
 
Join Date: May 2009
Posts: 164
Quote:
Originally Posted by Music Fan View Post
I want to open a vfr video with LWLibavVideoSource, is there anything to add at the end of the 1st line of the script ?
For comparison, when it's done with DirectShowSource, one has to add convertfps=true.
Is there anything like this for LWLibavVideoSource ?
LWLibavVideoSource doesn't support VFR->CFR conversion i.e. doesn't pad frames for VFR source.
It just returns frame by frame.
VFR->CFR conversion is "patches welcome".

Quote:
Originally Posted by wOxxOm View Post
In order to use LW in avisynth to process 10-bit video files with high-bitdepth plugins (like modded dfttest and mdegrain from the Dither package) the output needs to be converted.

Stacked=true: 950 fps (LWLibavVideoSource only) -> 400 fps drop.
Code:
msb = crop(0,0,0,height/2)
lsb = crop(0,height/2,0,0)
stackvertical(mt_lutxy(msb,lsb,"x 8 << y + 2 >>",u=3,v=3),
\ mt_lutxy(msb,lsb,"x 8 << y + 3 &u  6 <<",u=3,v=3))
On default settings it's even slower because of bad avisynth's turn implementation: 110 fps (or 300 fps with FTurn SSE2)
Code:
assumebff.turnleft.separatefields.turnright.assumeframebased
stackvertical( mt_lutxy(selectodd, selecteven, "x 8 << y + 2 >>", u=3,v=3),
\ mt_lutxy(selectodd, selecteven, "x 8 << y + 3 &u  6 <<", u=3,v=3))
BTW, the output of FFVideoSource with 10-bit-to-stacked hack can be used directly by the aforementioned plugins...
It'd be nice if the LW output for 10-bit files in avisynth would match that, since it's not as useful otherwise.
Did you try format="YUV4**P16"?
'format' and 'stacked' are not exclusive option each other.
I have not tested speed comparison though.
__________________
僕と契約して、L-SMASH developerになってよ!
L-SMASH | L-SMASH Works | Opus-in-ISOBMFF specification and reference software

Last edited by VFR maniac; 16th August 2013 at 22:45.
VFR maniac is offline   Reply With Quote
Old 16th August 2013, 22:58   #80  |  Link
wOxxOm
Oz of the zOo
 
Join Date: May 2005
Posts: 208
Quote:
Originally Posted by VFR maniac View Post
Did you try format="YUV4**P16"?
'format' and 'stacked' are not exclusive option each other.
I have not tested speed comparison though.
Thank you for the hint, I've totally missed the flexibility of 'format', here's a 1080p-10bit quick test results (the video is different, so fps shouldn't be compared to that in my previous post):
Code:
YUV420P10		265 - default mode
YUV420P10stacked	248
YUV420P16		270
YUV420P16stacked	190 - same fps as the old ffms2-mod
Edit: 18 Aug build
Code:
YUV420P10		285 - 7% faster
YUV420P10stacked	285 - 15% faster
YUV420P16		285 - 5% faster
YUV420P16stacked	223 - 17% faster than the previous build

Last edited by wOxxOm; 18th August 2013 at 23:02. Reason: 18 Aug build speed test added
wOxxOm 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 12:24.


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