1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
Commit Graph

92 Commits

Author SHA1 Message Date
Stephen Hutchinson
92916e8542 avisynth: support pix_fmts added to AviSynth+
A number of new pix_fmts have been added to AviSynth+:
16-bit packed RGB and RGBA
10-, 12-, 14, and 16-bit YUV 4:2:0, 4:2:2, and 4:4:4
8-, 10-, 12-, 14-, and 16-bit Planar RGB
8-, 10-, 12-, 14-, and 16-bit Planar YUVA and Planar RGBA*
10-, 12-, 14-, and 16-bit GRAY variants*
32-bit floating point Planar YUV(A), Planar RGB(A), and GRAY*

*some of which are not currently available pix_fmts here and were
 not added to the demuxer due to this

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-30 00:23:52 +02:00
Stephen Hutchinson
0ed5c3ce81 avisynth: simplify the pix_fmt check for the newer AviSynth API
The values don't need to be hardcoded since the correct values are
returned by avs_bits_per_pixel.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-11 19:55:16 +02:00
Clément Bœsch
8ef57a0d61 Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'
* commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb':
  cosmetics: Fix spelling mistakes

Merged-by: Clément Bœsch <u@pkh.me>
2016-06-21 21:55:34 +02:00
Vittorio Giovara
41ed7ab45f cosmetics: Fix spelling mistakes
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-05-04 18:16:21 +02:00
Derek Buitenhuis
6f69f7a8bf Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
* commit '9200514ad8717c63f82101dc394f4378854325bf':
  lavf: replace AVStream.codec with AVStream.codecpar

This has been a HUGE effort from:
    - Derek Buitenhuis <derek.buitenhuis@gmail.com>
    - Hendrik Leppkes <h.leppkes@gmail.com>
    - wm4 <nfxjfg@googlemail.com>
    - Clément Bœsch <clement@stupeflix.com>
    - James Almer <jamrial@gmail.com>
    - Michael Niedermayer <michael@niedermayer.cc>
    - Rostislav Pehlivanov <atomnuker@gmail.com>

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-10 20:59:55 +01:00
Anton Khirnov
9200514ad8 lavf: replace AVStream.codec with AVStream.codecpar
Currently, AVStream contains an embedded AVCodecContext instance, which
is used by demuxers to export stream parameters to the caller and by
muxers to receive stream parameters from the caller. It is also used
internally as the codec context that is passed to parsers.

In addition, it is also widely used by the callers as the decoding (when
demuxer) or encoding (when muxing) context, though this has been
officially discouraged since Libav 11.

There are multiple important problems with this approach:
    - the fields in AVCodecContext are in general one of
        * stream parameters
        * codec options
        * codec state
      However, it's not clear which ones are which. It is consequently
      unclear which fields are a demuxer allowed to set or a muxer allowed to
      read. This leads to erratic behaviour depending on whether decoding or
      encoding is being performed or not (and whether it uses the AVStream
      embedded codec context).
    - various synchronization issues arising from the fact that the same
      context is used by several different APIs (muxers/demuxers,
      parsers, bitstream filters and encoders/decoders) simultaneously, with
      there being no clear rules for who can modify what and the different
      processes being typically delayed with respect to each other.
    - avformat_find_stream_info() making it necessary to support opening
      and closing a single codec context multiple times, thus
      complicating the semantics of freeing various allocated objects in the
      codec context.

Those problems are resolved by replacing the AVStream embedded codec
context with a newly added AVCodecParameters instance, which stores only
the stream parameters exported by the demuxers or read by the muxers.
2016-02-23 17:01:58 +01:00
Marton Balint
8009a1f1fd avisynth: fix setting stream timebase
Stream timebase should be set using avpriv_set_pts_info, otherwise
avctx->pkt_timebase is not correct.

This should fix ticket #4766.

Patch is only compile tested.

Signed-off-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Stephen Hutchinson <qyot27@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-13 01:20:16 +02:00
Michael Niedermayer
67ac31d1be Merge commit '247aa7af7d8197247c181e3fbfe8d93d75e41b29'
* commit '247aa7af7d8197247c181e3fbfe8d93d75e41b29':
  avisynth: Simplify shared library name construction

Conflicts:
	libavformat/avisynth.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 20:03:16 +02:00
Diego Biurrun
247aa7af7d avisynth: Simplify shared library name construction 2015-04-15 14:52:57 +02:00
Stephen Hutchinson
7a5f444766 avisynth: Bump minimum required version to interface version 6
The AVSC_API changes in the new headers mean that the 2.6 alphas
are just as incompatible as 2.5 is.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2015-04-14 13:53:04 +02:00
Stephen Hutchinson
a6a45e5a9a avisynth: Fix detection of AviSynth 2.5
In order to safely exit when the user tries to use AviSynth 2.5, the
continue_on_fail value for 2.6's functions need to be set to 1.
Otherwise, the library loader fails before the 'upgrade to 2.6'
log message appears.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2015-04-14 13:52:41 +02:00
Stephen Hutchinson
3723a18310 avisynth: Bump minimum required version to interface version 6
The AVSC_API changes in the new headers mean that the 2.6 alphas
are just as incompatible as 2.5 is.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-02 23:52:48 +02:00
Stephen Hutchinson
d858c3a18f avisynth: Fix detection of AviSynth 2.5
In order to safely exit when the user tries to use AviSynth 2.5,
the continue_on_fail value for 2.6's functions need to be set to
1.  Otherwise, the library loader fails before the 'upgrade to
2.6' log message appears.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-02 23:30:08 +02:00
Stephen Hutchinson
1492118c9d avisynth: drop support of AviSynth 2.5
If the user attempts to use AviSynth 2.5, an error message will
now tell them they need to upgrade.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-25 20:37:26 +01:00
Michael Niedermayer
153073201c Merge commit 'a8c99205ca8703bd849efae13fcf844315c7147d'
* commit 'a8c99205ca8703bd849efae13fcf844315c7147d':
  avisynth: Fix compilation against current 2.6 header(s).

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-24 11:40:12 +01:00
Stephen Hutchinson
1188119624 avisynth: update documentation about the avisynth_c.h header
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-03-24 10:31:04 +01:00
Stephen Hutchinson
a8c99205ca avisynth: Fix compilation against current 2.6 header(s).
AviSynth 2.6 (and by extension, AviSynth+) moves these functions
into AVSC_API. This requires both adjusting their normal use,
and for AvxSynth, adjusting the position/use of the USING_AVISYNTH
ifdefs.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-03-24 10:31:04 +01:00
Michael Niedermayer
4bcb58b3ad Merge commit 'f2ad1495f23376ce61542967f4fc14205f284d40'
* commit 'f2ad1495f23376ce61542967f4fc14205f284d40':
  avisynth: Use RTLD_LOCAL instead of RTLD_GLOBAL

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-03 13:24:57 +01:00
Martin Storsjö
f2ad1495f2 avisynth: Use RTLD_LOCAL instead of RTLD_GLOBAL
There shouldn't be any need to add the loaded libraries to the global
symbol namespace.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-03 02:30:03 +02:00
Hendrik Leppkes
7c377f0e74 avisynth: set duration of audio streams
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-05-16 14:41:02 +02:00
Hendrik Leppkes
ae8e2d7634 avisynth: set duration of audio streams
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 04:38:33 +02:00
Michael Niedermayer
c9db8694a8 avisynth: fix setting packet properties
Reviewed-by: Stephen Hutchinson <qyot27@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-01-17 11:11:08 +01:00
Michael Niedermayer
4cb9c20136 avformat/avisynth simplify packet allocation
Reviewed-by: Stephen Hutchinson <qyot27@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-10 15:38:59 +01:00
Stephen Hutchinson
16ae337bd8 avisynth: Use av_packet_from_data instead of av_new_packet
If the audio changes from 9eac7c4 were merged as they were, this
would cause scripts with both video+audio to fail with a lot of
audio decoding errors (the video would be fine). Scripts with
only one of either video or audio were unaffected. Additionally,
the av_packet changes in general caused seeking to break.

Using av_packet_from_data allows video+audio scripts to work as
expected, without audio decoding errors.  It also fixes seeking.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-08 12:54:27 +01:00
Anton Khirnov
02dd178d9d avisynth: More av_new_packet changes
These are the remaining av_packet-related bits from 9eac7c4
that didn't get merged at that time.

Changes authored by Anton Khirnov <anton@khirnov.net>, split out
from 9eac7c4 by Stephen Hutchinson <qyot27@gmail.com>

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-08 12:54:22 +01:00
Michael Niedermayer
9eac7c435f Merge commit 'f0b234ab9e406efee85c17eb435db646092a943b'
* commit 'f0b234ab9e406efee85c17eb435db646092a943b':
  avformat: AviSynth demuxer rewrite

Conflicts:
	configure
	libavformat/avisynth.c

See: b9ad009475 (as well as later commits)
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-09 12:03:09 +01:00
d s
f0b234ab9e avformat: AviSynth demuxer rewrite
Directly loads AviSynth through LoadLibrary instead of relying on
Video for Windows, and supports using AvxSynth (via dlopen) to
open scripts on Linux and OS X.

Error messages from AviSynth/AvxSynth are now reported through
av_log and exit, rather than the traditional behavior of generating
an error video that the user would need to watch to diagnose.

The main rewrite was authored by d s <avxsynth.testing@gmail.com>
from the AvxSynth team, with additional contributions by

Oka Motofumi <chikuzen.mo@gmail.com>
Stephen Hutchinson <qyot27@gmail.com>
Diego Biurrun <diego@biurrun.de>
Anton Khirnov <anton@khirnov.net>

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-12-08 21:54:50 +01:00
Michael Niedermayer
b2c89453dc avformat/avisynth: remove duplicate av_new_packet() call
Found-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-01 22:12:57 +01:00
Anton Khirnov
c46ab34d81 avisynth: make avs_library statically allocated.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-01 13:14:47 +01:00
Stephen Hutchinson
801c186440 avisynth: Move to av_new_packet/av_free_packet.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-01 13:14:42 +01:00
Clément Bœsch
8d55362fd0 avformat/avisynth: re-add trailing \n.
Regression since ac9529ce.

Spotted by Timothy Gu.
2013-10-29 19:42:08 +01:00
Stephen Hutchinson
f87a2e1272 avisynth: Factor out a couple of returns
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-28 22:30:43 +01:00
Stephen Hutchinson
ac9529ceec avisynth: Simplify a stray av_log message
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-28 22:30:36 +01:00
Stephen Hutchinson
7ac67583c3 avisynth: Switch a couple of AVERROR_UNKNOWNs to AVERROR(ENOMEM)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-28 22:30:20 +01:00
Stephen Hutchinson
c7f9aab801 avisynth: Use AV_* prefixes for video and audio IDs
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-28 22:26:56 +01:00
Stephen Hutchinson
cf31c1d4f8 avisynth: Remove outdated undef block
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-28 22:26:47 +01:00
Stephen Hutchinson
df6279e737 avisynth: Remove a couple of useless AviSynthContext casts
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-28 22:26:37 +01:00
Stephen Hutchinson
da9852670c avisynth: Don't declare structs anonymously
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-28 22:26:28 +01:00
Stephen Hutchinson
d10d60be68 avisynth: Compact AvxSynth's avoidance of 2.6's colorspaces.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-28 22:26:14 +01:00
Stephen Hutchinson
2c18bfe6af avisynth: Cosmetics
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-28 22:25:26 +01:00
Stephen Hutchinson
1549122d26 avisynth: Change most of the comments to /* */ from //
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-28 22:25:12 +01:00
Stephen Hutchinson
bd97ba72dc avisynth: Introduce USING_AVISYNTH macro
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-28 22:24:58 +01:00
Michael Niedermayer
86ca6a7568 Merge commit '97b052e56807fab6887e9ba210a28a622e6a4b78'
* commit '97b052e56807fab6887e9ba210a28a622e6a4b78':
  avisynth: Add missing #include for NULL_IF_CONFIG_SMALL

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-06 13:39:15 +02:00
Diego Biurrun
c16ddcc90b avisynth: K&R formatting cosmetics 2013-09-06 11:13:36 +02:00
Diego Biurrun
97b052e568 avisynth: Add missing #include for NULL_IF_CONFIG_SMALL 2013-09-06 09:09:07 +02:00
Stephen Hutchinson
2c25e83b1d avisynth: Support video input from AviSynth 2.5 properly.
Uses the 2.5 compatibility header included with the variant of
FFMS2 that uses AviSynth's C-interface. A copy of this header is
now provided in compat/avisynth.

avs_get_row_size_p and avs_get_height_p changed between versions
2.5 and 2.6. Since the avisynth_c.h header that avformat uses
assumes AviSynth 2.6, it would cause 2.5 to crash if given any
kind of real video (the Version() function was known to work,
though).

AvxSynth was unaffected by this issue because, despite being based
on AviSynth 2.5.8 and using 2.5.8's interface version number of 3,
it actually uses 2.6's versions of these functions.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-17 14:27:25 +02:00
Stephen Hutchinson
9db353bc47 avisynth: Exit gracefully when trying to serve video from v2.5.8.
'Fixes' ticket #2526 insofar as it stops 2.5.8 from crashing and
tells the user to upgrade to 2.6 if they want to make video input
work. A real solution to #2526 would be to get video input from
2.5.8 to work right.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-07 10:38:48 +02:00
Stephen Hutchinson
f277d6bf42 avisynth: Cosmetics
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-07 10:37:19 +02:00
Diego Biurrun
0e8c6f221a avisynth: Fix a "AVISynth" vs. "AviSynth" struct name typo
Also fix some similar typos in comments and documentation.
2013-07-29 20:09:59 +02:00
Diego Biurrun
03039f4c8c miscellaneous typo fixes 2013-07-25 19:43:32 +02:00