summaryrefslogtreecommitdiff
path: root/fftools
Commit message (Collapse)AuthorAge
* ffmpeg: silence a thread_safe_callbacks deprecation warningJames Almer2021-06-10
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* ffmpeg_videotoolbox: skip memory copy if hwaccel_output_format matchzhilizhao2021-06-10
| | | | | | | | | | | | | | | | | | | | | Simple test results: Command: ./ffmpeg -y -hwaccel videotoolbox -hwaccel_output_format videotoolbox_vld \ -i test.mp4 -an -c:v h264_videotoolbox -benchmark out.mp4 Before: frame= 1221 fps= 66 q=-0.0 Lsize= 3144kB time=00:00:20.33 bitrate=1266.6kbits/s dup=4 drop=0 speed= 1.1x bench: utime=2.714s stime=1.218s rtime=18.574s After: frame= 1221 fps=137 q=-0.0 Lsize= 3144kB time=00:00:20.33 bitrate=1266.4kbits/s dup=4 drop=0 speed=2.28x bench: utime=1.450s stime=1.440s rtime=8.924s It has limited usecase since there is no video filter support, so a log message is added to notify the user. Reviewed-by: Steven Liu <liuqi05@kuaishou.com>
* fftools/ffplay: 240M matrix is not the same as BT.601Valerii Zapodovnikov2021-06-08
| | | | | Signed-off-by: Valerii Zapodovnikov <val.zapod.vz@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* fftools/ffprobe: Remove redundant check before avcodec_free_context()Andreas Rheinhardt2021-06-08
| | | | | | | | Besides being unnecessary it is also safer: If the error for an unrecognized option were triggered (which seems to be impossible right now), it might be that the stream whose codecpar is accessed is NULL. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg: remove usage of internal timestamp AVStream fieldsJames Almer2021-06-04
| | | | | | They should not be accessed outside of libavformat. Signed-off-by: James Almer <jamrial@gmail.com>
* ffmpeg: return no chosen output if an uninitialized stream is unavailableJan Ekström2021-05-13
| | | | | | | | | | | | | | | Otherwise the rate emulation logic in `transcode_step` never gets hit, and the unavailability flag never gets reset, leading to an eternal loop with some rate emulation use cases. This change was missed during the rework of ffmpeg.c, in which encoder initialization was moved further down the time line in commit 67be1ce0c6de330b1c10d1d121819d8a74a7b1f5 . Previously, as the encoder initialization had happened earlier, this state was not possible (flow getting as far as hitting the rate emulation logic, yet not having the encoder initialized yet). Fixes #9160
* ffprobe: support printing more packet side data typesAnton Khirnov2021-05-09
| | | | | Specifically WebVTT subtitle data, CPB properties, audio service type and mpegts stream id.
* ffprobe: only hash extradata when it is presentAnton Khirnov2021-05-09
| | | | | Passing zero-sized/NULL buffers to av_hash_update() is invalid and may crash with certain hashes.
* ffprobe: add option to control optional fields displayGyan Doshi2021-05-05
|
* ffmpeg: stop accessing private AVStream.codec_info_nb_framesJames Almer2021-05-02
| | | | | | | | Use AVSTREAM_EVENT_FLAG_NEW_PACKETS instead, which should provide the same information in this case. Finishes removing all uses of this field as started by 87f0c8280c. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: remove deprecated AVStream.codecJames Almer2021-04-27
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avdevice/avdevice: Constify av_*_device_next APIAndreas Rheinhardt2021-04-27
| | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avdevice/avdevice: Constify avdevice_list_input_sources/output_sinksAndreas Rheinhardt2021-04-27
| | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avformat: Constify AVFormatContext.*_codec pointersAndreas Rheinhardt2021-04-27
| | | | | | | | This also allows to exclusively use pointers to const AVCodec in fftools/ffmpeg_opt.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* libavresample: Remove deprecated libraryAndreas Rheinhardt2021-04-27
| | | | | | | | Deprecated in c29038f3041a4080342b2e333c1967d136749c0f. The resample filter based upon this library has been removed as well. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/buffer: Switch AVBuffer API to size_tAndreas Rheinhardt2021-04-27
| | | | | | | Announced in 14040a1d913794d9a3fd6406a6d8c2f0e37e0062. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: Constify the API wrt AV(In|Out)putFormatAndreas Rheinhardt2021-04-27
| | | | | | | Also constify AVProbeData. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* fftools/ffprobe: Remove check on show_frames and show_packets in XML writerTobias Rapp2021-04-16
| | | | | | | | The "packets_and_frames" element has been added to ffprobe.xsd in 0c9f0da0f7656059e9bd41931d250aafddf35ea3 but apparently removing the check in ffprobe.c has been forgotten. Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
* ffprobe: only print exported private decoder optionsJames Almer2021-04-14
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* fftools/ffmpeg_filter: Fix check for mjpeg encoderAndreas Rheinhardt2021-04-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MJPEG encoder supports some pixel format/color range combinations only when strictness is set to unofficial or less. Before commit 059fc2d9da5364627613fb3e6424079e14dbdfd3 said encoder's pix_fmts array only included the pixel formats supported with default strictness. When strictness was <= unofficial, fftools/ffmpeg_filter.c used an extended list of pixel formats instead of the encoder's including the pixel formats only supported when strictness <= unofficial. Said commit turned the logic around: The encoder's pix_fmts array now included all pixel formats and fftools/ffmpeg_filter.c instead used a small list of all pixel formats supported when strictness is > unofficial and the encoder's pixel formats instead. In particular, the codec's pix_fmt is not used when strictness is normal. This works for the mjpeg encoder; yet it did not work for other (hardware-based) mjpeg encoders, because the check for whether one is using the MJPEG encoder is wrong: It just checks the codec id. So if one used strict unofficial with a hardware-accelerated MJPEG encoder before commit 059fc2d9da53, the unofficial (non-hardware) pixel formats of the MJPEG encoder would be used; since said commit the codec's pixel formats are overridden at ordinary strictness by the ordinary MJPEG pixel formats. This leads to format conversion errors lateron which were reported in #9186. The solution to this is to check AVCodec.name instead of its id. Fixes ticket #9186. Tested-by: Eoff, Ullysses A <ullysses.a.eoff@intel.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_filter: Don't needlessly copy stringAndreas Rheinhardt2021-04-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_filter: Don't write string that is never usedAndreas Rheinhardt2021-04-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_filter: Avoid allocations when configuring output filtersAndreas Rheinhardt2021-04-10
| | | | | | Use an AVBPrint to handle the (typically short) strings involved here. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mjpegenc: Include all supported pix_fmts in mpegenc pix_fmtsAndreas Rheinhardt2021-04-10
| | | | | | | | | | | | | | | Currently said list contains only the pixel formats that are always supported irrespective of the range and the value of strict_std_compliance. This makes the MJPEG encoder an outlier as all other codecs put all potentially supported pixel formats into said list and error out if the chosen pixel format is unsupported. This commit brings it therefore in line with the other encoders. The behaviour of fftools/ffmpeg_filter.c has been preserved. A more informed decision would be possible if colour range were available at this point, but it isn't. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg: copy average framerate for streamcopy, when knownAnton Khirnov2021-04-08
|
* fftools/ffmpeg: when framerate is set, prefer its inverse as output timebaseAnton Khirnov2021-04-08
| | | | | Codec timebase is not well-defined for streamcopy, so it should only be used as the last resort.
* fftools/ffprobe: Add missing dispositionsAndreas Rheinhardt2021-03-31
| | | | | Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg: use av_packet_alloc() to allocate packetsJames Almer2021-03-17
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* fftools/ffprobe: use av_packet_alloc() to allocate packetsJames Almer2021-03-17
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* cmdutils: replace strncpy() with direct assignmentAnton Khirnov2021-03-16
| | | | | | | | Only one character is actually rewritten. Fixes truncation warnings, such as warning: ‘strncpy’ output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation] in gcc 10.2.0
* lavc: rename AV_CODEC_CAP_AUTO_THREADS->AV_CODEC_CAP_OTHER_THREADSAnton Khirnov2021-03-16
| | | | | | | | | | This cap is currently used to mark multithreading-capable codecs that wrap external libraries with their own multithreading code. The name is highly confusing for our API users, since libavcodec ALWAYS handles thread_count=0 (see commit message in previous commit). Therefore rename the cap and update its documentation to make its meaning clear. The old name is kept deprecated until next+1 major bump.
* fftools/ffplay: do not write out of rdft visualization textureMarton Balint2021-03-10
| | | | | | | | | | | | If the window is resized it was possible that xpos pointed outside the visualization texture. By rearranging the overflow check we make sure this (and a crash) does not happen. We also don't have to use xleft for start position, as that is 0 anyways, and if we ever want to take into account xleft then the texture should be positioned accordingly when rendering. Signed-off-by: Marton Balint <cus@passwd.hu>
* ffprobe: switch to av_bprint_escape for XML escapingJan Ekström2021-03-05
| | | | | | Additionally update the result of the ffprobe XML writing test. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* fftools: Switch to const AVCodec * where possibleAndreas Rheinhardt2021-03-02
| | | | | | | | | | | The obstacle to do so was in filter_codec_opts: It uses searches the AVCodec for options via the AV_OPT_SEARCH_FAKE_OBJ method, which requires using a void * that points to a pointer to a const AVClass. When using const AVCodec *, one can not simply use a pointer that points to the AVCodec's pointer to its AVClass, as said pointer is const, too. This is fixed by using a temporary pointer to the AVClass. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* fftools/cmdutils: Use av_strstart instead of strncmpAndreas Rheinhardt2021-02-28
| | | | | | | It makes the intent clearer and avoids searching for a delimiter in advance. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* fftools/ffmpeg, ffplay: Don't set refcounted_framesAndreas Rheinhardt2021-02-28
| | | | | | | It only affects the old and deprecated avcodec_decode_(video2|audio4) API which is no longer used here. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* fftools/ffmpeg_filter: Don't use deprecated functionAndreas Rheinhardt2021-02-26
| | | | | | | | avcodec_find_best_pix_fmt_of_2 has been moved to libavutil in 617e866e25b72fa5d9f9d6bbcbd7e4bd69e63a54. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* ffprobe: stop setting AVCodecContext.framerateAnton Khirnov2021-02-22
| | | | | That field is supposed to be exported by decoders, it makes no sense for a user to set it.
* ffprobe: stop printing deprecated fieldsAnton Khirnov2021-02-22
| | | | | | | | | | | The FF_API macros are private and must not be used by external callers. As the fields in question are to be removed without replacement, just drop them. The fields are: AVPacket.convergence_duration AVCodecContext.time_base AVCodecContext.timecode_frame_start AV_PIX_FMT_FLAG_PSEUDOPAL pixel descriptor flag
* ffprobe: drop code accessing deprecated AVStream.codecAnton Khirnov2021-02-22
|
* ffprobe: do not use deprecated AVStream.codec for max bitrateAnton Khirnov2021-02-22
| | | | Use the decoder context instead.
* ffprobe: remove an unnecessary deprecation guardAnton Khirnov2021-02-22
| | | | | | The code it is guarding is not accessing anything deprecated (disregarding the fact that a library caller must not use FF_API deprecation guards).
* fftools/ffplay: reindent and some minor cosmeticsMarton Balint2021-02-19
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* fftools/ffplay: use av_packet_alloc() to allocate packetsMarton Balint2021-02-19
| | | | | | Heavily based on a patch by James Almer. Signed-off-by: Marton Balint <cus@passwd.hu>
* fftools/ffplay: use context AVPacket in decoder_decode_frame()Marton Balint2021-02-19
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* fftools/ffplay: get rid of flush_pktMarton Balint2021-02-19
| | | | | | The packet serial can be used instead to detect when a flush is needed. Signed-off-by: Marton Balint <cus@passwd.hu>
* ffmpeg: add -fpsmax to clamp output framerateGyan Doshi2021-02-05
| | | | Useful when encoding in batch or with aberrant inputs.
* avformat/mxfenc: prefer to use the configured metadataLimin Wang2021-02-05
| | | | | | | | | | | | | | | | The metadata company_name, product_name, product_version from input file will be deleted to avoid overwriting information Please to test with below commands: ./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy out.mxf and ./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy \ -metadata company_name="xxx" \ -metadata product_name="xxx" \ -metadata product_version="xxx" \ out.mxf Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* fftools/ffmpeg_filter: Make functions only used locally staticAndreas Rheinhardt2021-02-02
| | | | | | Also remove some declarations of inexistent functions while at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* fftools/ffmpeg_filter: Remove ist_in_filtergraphAndreas Rheinhardt2021-02-02
| | | | | | Unused since af1761f7b5b1b72197dc40934953b775c2d951cc. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>