Improve consistency with libavcodec.
This breaks libavfilter API/ABI.
The non-sequential 2.1.0 -> 2.4.0 bump is due to the mess previously
done with the lavfi minor number.
The sample aspect ratio is a per-frame property, so it makes sense to
define it in AVFrame rather than in the codec/stream context.
Simplify application-level sample aspect ratio information extraction,
and allow further simplifications.
In output_packet(), move the pre_process_video_frame() call inside the
if (ist->decoding_needed) { } block. This way
pre_process_video_frame() is not called when stream-copy has been
selected.
Also simplify.
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
AVERROR_NUMEXPECTED is used only in the image muxer and demuxer, and
has a too much specific meaning, which is better explained through a
log message. Thus it can be replaced by AVERROR(EINVAL).
This breaks API.
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
The problem with url_exist() is that it tries to open a resource in
RDONLY mode. If the file is a FIFO and there is already a reading
client, the open() call will hang.
By using avio_check() with access mode of 0, the second reading
process will check if the file exists without attempting to open it,
thus avoiding the lock.
Fix issue #1663.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Make AVIO_FLAG_ access constants work as flags, and in particular fix
the behavior of functions (such as avio_check()) which expect them to
be flags rather than modes.
This breaks API.
Use av_log() rather than fprintf(stderr, ...), and show information
related to the previous size/pixel format configuration.
Consistent with the corresponding message issued in case of audio
configuration change.
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Redesign the way -aspect option is handled. This is done by making
ffmpeg read the sample aspect ratio set in the corresponding input
stream by default, and overriding it using the value specified by
-aspect.
If the output display aspect ratio is specified with -aspect, it is
set at the end of the filterchain, thus overriding the value set by
filters in the filterchain.
This implementation is more robust, since does not modify the
filterchain description (which was creating potential syntax errors).
Prefer parse_number_or_die() over atoi()/atol() parsing for the options:
-pass, -top, -vc, and -qscale.
Improve input validation.
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Mostly useful for the audio-filters branch, to make more apparent the
distinction between configure_audio_filters() and
configure_video_filters().
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
I think the documentation of sameq is causing confusion and misuse of
this option.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
This is done by adding a setsar filter at the beginning of the
configured filterchain.
This implementation is more robust, since does not modify the
filterchain description (which was creating potential syntax errors),
but directly modifies the filterchain structure.
This also changes the ffmpeg -aspect behavior, as following filters in
the filterchain can change the DAR/SAR set by the inserted setsar
filter.
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Currently bits_per_raw_sample is exposed as an AVCodecContext option.
The option is not very useful, because ffmpeg 1) overwrites it with
a value from the upstream codec, or 2) it resets the value whenever
the video is resampled.
This patch adds the -bits_per_raw sample option to FFmpeg, and
caches the value like is done for the -pix_fmt option.
Example usage:
ffmpeg v210.avi -pix_fmt rgb48 -bits_per_raw_sample 10 out%d.dpx
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>