Git Product home page Git Product logo

clippropertiesparser's Introduction

Avisynth ClipProperties to Frame Properties Parser

Avisynth Clip Properties to Frame Properties parser for FFAStrans internal use.

Brief Explanation
The parser will try to populate Avisynth streams with frame properties that can be used by third party programs like FFAStrans' filter_builder to have an idea about what is being delivered and encode the stream accordingly. If there are NO frame properties (legacy Avisynth or legacy indexer or maybe the user used propClearAll() or for some other reason), the parser will try to use some of the clip properties to assume frame properties (but it's largely based on guess-work) while if there are SOME frame properties, it will preserve those but it will also try to see whether it has all the ones that are needed and it will try to fill the gap either by using what it has got as frame properties OR by using the same guess-work it would have used if it didn't have anything in the first place.

The result of this is a series of conditional and try-catch statement that try to prevent the function from erroring out.

Non FFAStrans users, beware!
Even though the function is publicly available, this is made for FFAStrans' filter_builder internal use cases only, therefore you'll see that the interlacing check doesn't really make sense for a normal user. This is because technically in Avisynth there was no way to know the field order and the exact interlacing from the clip properties alone, so we came up with the idea long ago to use AssumeFieldBased() to carry frames in a progressive fashion and AssumeFrameBased() to carry interlaced fields so that we could cross-check the clip properties to know whether it was interlaced TFF, interlaced BFF or progressive 'cause there were no frame properties in the past and now this thing has come back to bite us, but anyway, this is just the reason why the interlacing check wouldn't make sense for a normal user.

Example (Use case without the properties parser)

#Indexing a video without properties

video=DGDecode_MPEG2Source("colorbars_no_data.d2v")

audio=WAVSource("colorbars_no_data.wav")

AudioDub(video, audio)

Stream delivered without the properties parser
image

Example using the properties parser

#Indexing a video without properties

video=DGDecode_MPEG2Source("colorbars_no_data.d2v")

audio=WAVSource("colorbars_no_data.wav")

AudioDub(video, audio)

#Auto populate frame properties with the parser

_ffas_helpers()

Stream delivered with the properties parser
image

clippropertiesparser's People

Contributors

francebb avatar

Stargazers

t3nzin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.