| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
The word "monotonous" means "spoken in a monotone" which is not what we
mean here. We mean "monotonic" i.e. nondecreasing.
Signed-off-by: Leo Izen <leo.izen@gmail.com>
|
|
|
|
|
|
| |
This function is primarily a destructor for OutputFile, the underlying
AVIOContext is normally closed earlier (right after writing the
trailer).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function converts packet timestamps from the input stream timebase
to OutputStream.mux_timebase, which may or may not be equal to the
actual output AVStream timebase (and even when it is, this may not
always be the optimal choice due to bitstream filtering).
Just keep the timestamps in input stream timebase, they will be rescaled
as needed before bitstream filtering and/or sending the packet to the
muxer.
Move the av_rescale_delta() call for audio (needed to preserve accuracy
with coarse demuxer timebases) to write_packet.
Drop now-unused OutputStream.mux_timebase.
|
|
|
|
|
|
|
|
|
|
| |
Bitstream filtering input timebase is not always necessarily equal to
OutputStream.mux_timebase. Also, set AVPacket.time_base correctly for
packets output by bitstream filters
Do not rescale at all in of_output_packet() when not doing bitstream
filtering, as it's unnecessary - write_packet() will rescale to the
actual muxer timebase.
|
| |
|
| |
|
|
|
|
|
|
|
| |
EOF from sq_receive() means no packets will ever be output by the sync
queue. Since the muxing sync queue is always used by all interleaved
(i.e. non-attachment) streams, this means no further packets can make
it to the muxer and we can terminate muxing now.
|
|
|
|
|
|
|
|
|
|
| |
This is only a preparatory step to a fully threaded architecture and
does not yet make decoding truly parallel - the main thread will
currently submit a packet and wait until it has been fully processed by
the decoding thread before moving on. Decoder behavior as observed by
the rest of the program should remain unchanged. That will change in
future commits after encoders and filters are moved to threads and a
thread-aware scheduler is added.
|
|
|
|
| |
It is no longer used outside of muxing code.
|
|
|
|
|
| |
Use NULL packets to signal EOF instead of a separate variable. This is
made possible by the previous commit.
|
|
|
|
|
|
| |
Currently of_output_packet() reuses the input packet, which requires its
callers to submit blank packets even on EOF, which makes the code more
complex.
|
|
|
|
|
|
| |
Packets submitted to the muxer now have their timebase attached to them,
so the muxer can do conversion to muxing timebase and avoid exposing it
to callers.
|
|
|
|
|
| |
Stop assuming the encoder knows the muxing timebase, which does not
always have to hold (e.g. due to bitstream filters).
|
|
|
|
|
|
| |
Current code marks the output stream as finished and waits for a flush
packet, but that is both unnecessary and suspect, as in theory nothing
should be sent to a finished stream - not even flush packets.
|
|
|
|
|
|
| |
Currently NULL would be passed for simple filtergraphs, which would
make the filter code extract the graph description from the output
stream when needed. This is unnecessarily convoluted.
|
| |
|
|
|
|
|
| |
Start by moving OutputStream.filtered_frame to it, which really belongs
to the filtergraph rather than the output stream.
|
|
|
|
| |
It will be made private to Encoder in the future.
|
| |
|
|
|
|
|
|
| |
Fix #10327.
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove now-obsolete code setting packet durations pre-muxing for CFR
encoded video.
Changes output in the following FATE tests:
* numerous adpcm tests
* ffmpeg-filter_complex_audio
* lavf-asf
* lavf-mkv
* lavf-mkv_attachment
* matroska-encoding-delay
All of these change due to the fact that the output duration is now
the actual input data duration and does not include padding added by
the encoder.
* apng-osample: less wrong packet durations are now passed to the muxer.
They are not entirely correct, because the first frame duration should
be 3 rather than 2. This is caused by the vsync code and should be
addressed later, but this change is a step in the right direction.
* tscc2-mov: last output frame has a duration of 11 rather than 1 - this
corresponds to the duration actually returned by the demuxer.
* film-cvid: video frame durations are now 2 rather than 1 - this
corresponds to durations actually returned by the demuxer and matches
the timestamps.
* mpeg2-ticket6677: durations of some video frames are now 2 rather than
1 - this matches the timestamps.
|
|
|
|
| |
It is no longer used outside of ffmpeg_mux*
|
|
|
|
| |
It is no longer used outside of ffmpeg_mux*
|
|
|
|
| |
It is no longer used outside of ffmpeg_mux*
|
|
|
|
| |
It is no longer used outside of ffmpeg_mux*
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
That field was added to store timestamp conversion state for audio
decoding code. Later it started being used by streamcopy as well, but
that use is wrong because, for a given input stream, both decoding and
an arbitrary number of streamcopies may be performed simultaneously.
They would then all overwrite the same state variable.
Store this state in MuxStream instead.
This is the last use of InputStream in of_streamcopy(), so the ist
parameter can now be removed.
|
|
|
|
|
| |
They should always be the same as the input stream parameters, but this
reduces the need to access InputStream in muxing code.
|
|
|
|
|
|
| |
do_streamcopy() is muxing code, so this is a more appropriate place for
this. The last uses of InputStream in it will be removed in following
commits.
|
|
|
|
|
|
|
|
|
|
|
| |
It stores codec parameters of the stream submitted to the muxer, which
may be different from the codec parameters in AVStream due to bitstream
filtering.
This avoids the confusing back and forth synchronisation between the
encoder, bitstream filters, and the muxer, now information flows only in
one direction. It also reduces the need for non-muxing code to access
AVStream.
|
|
|
|
|
|
|
|
|
| |
Reduces access to a deeply nested muxer property
OutputStream.st->codecpar->codec_type for this fundamental and immutable
stream property.
Besides making the code shorter, this will allow making the AVStream
(OutputStream.st) private to the muxer in the future.
|
|
|
|
| |
It is no longer used outside of this file.
|
|
|
|
|
|
|
|
|
|
| |
Current code in print_final_stats(), printing the final summary such as
video:8851kB audio:548kB subtitle:0kB other streams:0kB global headers:20kB muxing overhead: 0.559521%
was written with a single output file in mind and makes very little
sense otherwise.
Print this information in mux_final_stats() instead, one line per output
file. Use the correct filesize, if available.
|
| |
|
| |
|
|
|
|
| |
This is a more appropriate place for this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is currently done in two places:
* at the end of print_final_stats(), which merely prints a warning if
the total size of all written packets is zero
* at the end of transcode() (under a misleading historical 'close each
encoder' comment), which instead checks the packet count to implement
-abort_on empty_output[_stream]
Consolidate both of these blocks into a single function called from
of_write_trailer(), which is a more appropriate place for this. Also,
return an error code rather than exit immediately, which ensures all
output files are properly closed.
|
|
|
|
|
|
|
|
| |
Properly pass muxing return codes through the call stack instead.
Slightly changes behavior in case of errors:
* the output IO stream is closed even if writing the trailer returns an
error, which should be more correct
* all files get properly closed with -xerror, even if one of them fails
|
|
|
|
|
| |
It is audio/video encoding-only and does not need to be visible outside
of ffmpeg_enc.c
|
|
|
|
|
| |
Start by moving OutputStream.last_frame to it. In the future it will
hold other encoder-internal state.
|
|
|
|
|
| |
They are always properly set now. Avoid a separate timebase-setting
call, which duplicates the knowledge of the timebase being used.
|
|
|
|
|
|
|
| |
Individual streams should be terminated in the former case, the whole
muxing process in the latter.
Reported-by: Gyan Doshi
|
|
|
|
|
|
| |
Analogous to -enc_stats*, but happens right before muxing. Useful
because bitstream filters and the sync queue can modify packets after
encoding and before muxing. Also has access to the muxing timebase.
|
|
|
|
| |
Useful to keep track of what timebase the packet's timestamps are in.
|
|
|
|
|
| |
Use it for logging. This makes log messages related to this output
stream more consistent.
|
|
|
|
|
| |
Use it for logging. This makes log messages related to this output file
more consistent.
|
|
|
|
|
|
|
| |
Similar to -vstats, but more flexible:
- works for audio as well as video
- frame and/or packet information
- user-specifiable format
|
|
|
|
|
| |
It is not needed after the spec is parsed. Also avoids ugly string
comparisons for each video frame.
|
|
|
|
| |
Allows to remove the ugly of_get_chapters() wrapper.
|
|
|
|
|
|
| |
There are 8 of them and they are typically used together. Allows to pass
just this struct to forced_kf_apply(), which makes it clear that the
rest of the OutputStream is not accessed there.
|
|
|
|
|
|
|
|
|
| |
Do it in set_dispositions() rather than during stream creation.
Since at this point all other stream information is known, this allows
setting disposition based on metadata, which implements #10015. This
also avoids an extra allocated string in OutputStream that was unused
after of_open().
|