1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
Go to file
Shiwang.Xie 694545b6d5 fftools/ffmpeg: fix -t inaccurate recording time
if input start time is not 0 -t is inaccurate doing stream copy,
will record extra duration according to input start time.
it should base on following cases:

input video start time from 60s, duration is 300s,
1. stream copy:
       ffmpeg -ss 40 -t 60 -i in.mp4 -c copy -y out.mp4
   open_input_file() will seek to 100 and set ts_offset to -100,
   process_input() will offset pkt->pts with ts_offset to make it 0,
   so when do_streamcopy() with -t, exits when ist->pts >= recording_time.

2. stream copy with -copyts:
       ffmpeg -ss 40 -t 60 -copyts -i in.mp4 -c copy -y out.mp4
   open_input_file() will seek to 100 and set ts_offset to 0,
   process_input() will keep raw pkt->pts as ts_offset is 0,
   so when do_streamcopy() with -t, exits when
   ist->pts >= (recording_time+f->start_time+f->ctx->start_time).

3. stream copy with -copyts -start_at_zero:
       ffmpeg -ss 40 -t 60 -copyts -start_at_zero -i in.mp4 -c copy -y out.mp4
   open_input_file() will seek to 120 and set ts_offset to -60 as start_to_zero option,
   process_input() will offset pkt->pts with input file start time,
   so when do_streamcopy() with -t, exits when ist->pts >= (recording_time+f->start_time).

0      60     40      60                     360
|_______|_____|_______|_______________________|
      start   -ss     -t

This fixes ticket #9141.

Signed-off-by: Shiwang.Xie <shiwang.xie666@outlook.com>
2021-07-18 09:59:02 +05:30
compat avfilter: compress CUDA PTX code if possible 2021-06-22 14:05:44 +02:00
doc ffmpeg: add option readrate 2021-07-17 20:34:21 +05:30
ffbuild avfilter: compress CUDA PTX code if possible 2021-06-22 14:05:44 +02:00
fftools fftools/ffmpeg: fix -t inaccurate recording time 2021-07-18 09:59:02 +05:30
libavcodec avcodec/exr: Check uncompressed_size against max_pixels 2021-07-17 10:48:27 +02:00
libavdevice avdevice/libcdio: fix AVStream.cur_dts usage 2021-06-09 13:55:25 -03:00
libavfilter avfilter/vf_v360: avoid doubles in fov_from_dfov() 2021-07-17 23:27:51 +02:00
libavformat avformat/subtitles: Deduplicate subtitles' read_(packet|seek|close) 2021-07-18 04:26:35 +02:00
libavutil lavu/cpu.c: Add av_force_cpu_count() to override auto-detection. 2021-07-16 10:06:10 +02:00
libpostproc Bump major versions of all libraries. 2021-04-27 11:48:05 -03:00
libswresample Bump major versions of all libraries. 2021-04-27 11:48:05 -03:00
libswscale swscale/slice: Fix wrong return on error 2021-07-09 15:21:37 +02:00
presets presets: remove moldering iPod presets 2014-06-17 16:15:04 -08:00
tests fate/ffprobe: Verify ffprobe XML output against schema file 2021-07-13 08:57:23 +02:00
tools tools/target_dec_fuzzer: Fuzz FF_DEBUG_* 2021-07-17 10:48:27 +02:00
.gitattributes fate: add SCC test 2017-01-27 17:06:42 +01:00
.gitignore avfilter: compress CUDA PTX code if possible 2021-06-22 14:05:44 +02:00
.mailmap mailmap: add entry for myself 2021-03-09 02:09:55 +00:00
.travis.yml Merge commit '899ee03088d55152a48830df0899887f055da1de' 2019-03-14 15:53:16 -03:00
Changelog avformat: add a concat protocol that takes a line break delimited list of resources 2021-07-02 10:21:06 -03:00
configure configure: use the correct header for the fallback libxext check 2021-07-15 16:53:56 -03:00
CONTRIBUTING.md Add CONTRIBUTING.md 2016-09-18 10:02:13 +01:00
COPYING.GPLv2
COPYING.GPLv3
COPYING.LGPLv2.1
COPYING.LGPLv3
CREDITS CREDITS: redirect to Git log, remove current outdated content 2013-01-31 18:02:52 +01:00
INSTALL.md INSTALL.md: Fix Markdown formatting 2019-01-31 10:29:16 -09:00
LICENSE.md avfilter/vf_geq: Relicense to LGPL 2019-12-28 11:20:48 +01:00
MAINTAINERS avformat: add Argonaut Games CVG demuxer 2021-05-12 20:25:50 +10:00
Makefile libavresample: Remove deprecated library 2021-04-27 10:43:13 -03:00
README.md Remove the ffserver program 2018-01-06 18:31:37 +00:00
RELEASE Bump Versions before release/4.4 branch 2021-03-20 01:01:12 +01:00

FFmpeg README

FFmpeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata.

Libraries

  • libavcodec provides implementation of a wider range of codecs.
  • libavformat implements streaming protocols, container formats and basic I/O access.
  • libavutil includes hashers, decompressors and miscellaneous utility functions.
  • libavfilter provides a mean to alter decoded Audio and Video through chain of filters.
  • libavdevice provides an abstraction to access capture and playback devices.
  • libswresample implements audio mixing and resampling routines.
  • libswscale implements color conversion and scaling routines.

Tools

  • ffmpeg is a command line toolbox to manipulate, convert and stream multimedia content.
  • ffplay is a minimalistic multimedia player.
  • ffprobe is a simple analysis tool to inspect multimedia content.
  • Additional small tools such as aviocat, ismindex and qt-faststart.

Documentation

The offline documentation is available in the doc/ directory.

The online documentation is available in the main website and in the wiki.

Examples

Coding examples are available in the doc/examples directory.

License

FFmpeg codebase is mainly LGPL-licensed with optional components licensed under GPL. Please refer to the LICENSE file for detailed information.

Contributing

Patches should be submitted to the ffmpeg-devel mailing list using git format-patch or git send-email. Github pull requests should be avoided because they are not part of our review process and will be ignored.