| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
We were only applying SSA inline override tags. With this patch we now
parse SSA style descritions in the SSA header and apply them per event.
|
| |
|
|
|
|
|
|
|
| |
Audio mixdown occurs in decoders before sync. So number of channels
in a silence buffer is the output channel count. But audio samplerate
conversion happens in later here in sync.c FilterAudioFrame, so
samples_per_frame in silence buffers are still the input sample count.
|
|
|
|
|
| |
*really* fix https://github.com/HandBrake/HandBrake/issues/1374 this
time.
|
|
|
|
|
|
|
|
|
|
|
|
| |
We had a hash of limited size where we stored frame durations in
encx264. This hash has not been necessary since we moved to using
libavformat for muxing. Since the limited size of the hash put
constraints on how short frame durations could be, I've eliminated it.
This means that after the encoder, hb_buffer_t s.stop and s.duration are
no longer valid. But since they are not used during muxing, this is not
a problem.
Fixes https://github.com/HandBrake/HandBrake/issues/1374
|
|
|
| |
Found via `codespell -q 3 --skip="./gtk/po`
|
|
|
|
| |
fixes https://forum.handbrake.fr/viewtopic.php?f=11&t=37311
|
| |
|
|
|
|
| |
It was not an even number of sample size * num channels in some cases
|
| |
|
|
|
|
|
|
|
|
| |
Fixes https://github.com/HandBrake/HandBrake/issues/673
If the end point is near the end of file and one of the streams reaches
eof before the end point is detected, the eof buffer for that stream was
not sent. Flush all streams when end point is reached.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a preset key AlignAVStart that enables this work-around. When
enabled, blank frames are inserted or frames are dropped to force
alignment of the initial timestamp of every audio and video stream.
Aligning the start times minimizes the impact of broken edit list
support in players.
Closes #763.
Squashed:
sync: improve alignment when passthru audio is present
presets: enable AlignAVStart for General and Gmail presets
LinGui: Improve AlignAVStart tooltip
sync: avoid inserting a black frame < nominal frame duration
sync: fix start alignment when doing p-to-p encoding
sync: add comments
|
|
|
|
|
|
|
| |
Reader can skip data at the beginning of the file. We were not
informing decsrt how much was skipped when pts_to_start caused the skip.
Fixes https://forum.handbrake.fr/viewtopic.php?f=11&t=36258
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This very small error snowballs into a crash in x264 :-p
If the amount of jitter on the first frame in the queue was small
(about 1 tick) then jitter would not be removed from that frame.
This extra tick of jitter can appear on different frames depending
on when frame arrives and how much has been queued. This very small
amount of randomness lead to problems in the VFR filter. A frame
duration difference as small as 1 tick can lead to an extra frame
getting duplicated when doing CFR. When doing 2 pass encoding, this
extra frame causes x264 to crash at the end of the 2nd pass.
|
|
|
|
|
|
| |
If a stream is delayed by a large amount and the first timestamp from
the stream is AV_NOPTS_VALUE, sync assumed a 0 timestamp which caused
loss of sync. Drop the buffer instead.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Delayed subtitles were causing incorrect muxing in mkv. The mkv muxer
writes chunks where all samples should be relative to a chunk's base
timestamp. When the subtitle is delayed long enough for a new chunk to
start before it gets muxed, the calculated offset to the chunk's base
time is negative (which is illegal).
Note that this is still a possibility with subtitles that must be
delayed (e.g. CC and VOBSUB) because the duration is not known until
the next subtitle's start time is known. The only fix for this would be
to add a special subtitle parsing pass that caches subtitle timestamps
before the main encoding pass is performed.
|
| |
|
|
|
|
|
|
| |
reader adjusts pts_to_start after seeking. if the adjustment makes
pts_to_start == 0, sync didn't properly search for the start point and
hung.
|
|
|
|
|
| |
Continue processing input queues until none are full after p-to-p end
time is reached.
|
| |
|
|
|
|
|
|
| |
When a stream is finished, we need to see if there were any other
streams that were pending. The other streams could be blocking on a
condition variable and need to be unstuck.
|
|
|
|
| |
Fixes https://github.com/HandBrake/HandBrake/issues/328
|
|
|
|
| |
an hb_list_t was not freed at the end of an encode
|
|
|
|
|
| |
wake up potentially waiting sync threads when p-to-p end point is
reached.
|
|
|
|
| |
The output buffer size was not set correctly after resampling
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When doing point-to-point encoding, subtitles can cause a long
delay in finishing the job when the stop point is reached. This
is due to the sparse nature of subtitles. We may not even see
any additional subtitle till we reach the end of the file.
So when all audio and video streams have reached the end point,
force the termination of all subtitle streams by pushing an
end-of-stream buffer into each subtitles input fifo.
This will cause each subtitle sync worker to wake and return
HB_WORK_DONE.
|
|
|
|
| |
A full input queue could cause the search to stall
|
| |
|
|
|
|
|
|
|
|
|
| |
After finding the start position, some data prior to the start from
other streams could leak through causing duplicate timestamps in the
output.
Also, improves alignment of stop times of all streams when a stop time
is set.
|
|
|
|
|
|
| |
It was dropping subtitles because the "end of CC" marker buffer can have
the same time as the next valid CC which triggered the subtitle overlap
dropping code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* sync: correct timestamp discontinuities in sync instead of reader
This patch passes discontinuity information through the pipeline till it
reaches sync.c. The timestamps are passed through the pipeline as read
and unmodified to sync.c (instead of attempting to correct
discontinuities in reader). In sync, when we see a discontinuity,
we know where the next timestamp should be based on the timestamp
and duration of the previous buffer (before the discontinuity). So
we calculate an "SCR" offset based on the timestamp after the
discontinuity and what we calculate it should be.
The old discontinuity handling code was broken due to the following.
The MPEG STD timing model relies heavily on the decoder having an STC
that is phase lock looped to the PCRs in the stream. When decoding a
broadcast stream, the decoder can count on the time measure between PCRs
using the STC to match to a high degree of accuracy.
I.e. STC - lastSTC == PCR - lastPCR. When a discontinuity occurs, the
decoder calculates a new PCR offset = PCR - STC. I.e. the offset is the
new PCR value minus what it would have been if there had been no
discontinuity.
The above does not work without a reliable STC, which we do not have.
We have been attempting to approximate one by avereraging the duration
of received packets and extrapolating an "STC" based on the last PTS and
the average packet duration. But this is highly variable and
unreliable.
* decavcodec: fix data type of next_pts
It needs to be double so that partial ticks are not lost
* deccc608sub: clarify comment
* sync: allow queueing more audio
Audio is small, and there is often a significant amount of audio in the
stream before the first video frame.
* sync: improve handling of damaged streams
When data is missing, the audio decoder was extrapolating timestamps
from the last pts before the error caused by the missing data which
caused sync issues.
Also, missing data can cause the video decoder to output a frame out of
order with the wrong scr sequence. Drop such frames.
|
|
|
|
|
|
| |
essentially an off-by-one error. OutputBuffer had to wait for one more
buffer before any output was performed after the queue should have
already been filled to it's minimum levels.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
It's not strictly necessary because it gets done elsewhere as well. But
putting it here makes the code more understandable.
|
| |
|
| |
|
|
|
|
|
| |
... by allowing a deeper initial buffer when looking for the fist PTS of
each stream.
|
|
|
|
| |
... at log level 11 ;)
|
| |
|
|
|
|
|
|
|
| |
We were dropping all buffers before the start frame was found regardless
of the buffers start time. Now we keep track of the start time of the
last video frame seen and only drop buffers that start before that
frame.
|
| |
|
| |
|
| |
|
| |
|