John Stebbins [Mon, 20 Feb 2017 17:49:44 +0000 (10:49 -0700)]
libav: explicitly write encoder delay and preroll to mp4
This will make it possible to read encoder delay back and drop the
samples appropriately.
Writing preroll sample group to the mp4 fixes post-processing of the
file with Apple tools. If the roll sample group is not present, Apple
tools will apply an implicit rule to remove encoder delay which results
in the delay being dropped twice.
John Stebbins [Sat, 18 Feb 2017 21:11:17 +0000 (14:11 -0700)]
sync: fix sync problem with delayed streams
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.
Waterflames [Sat, 18 Feb 2017 13:11:57 +0000 (14:11 +0100)]
Enabled "Per monitor DPI awareness"
This commit adds entries to app.config and app.manifest to enable per
monitor DPI awareness in Windows 10. The application will behave as
before on platforms that do not support this.
The implementation was done using official Microsoft documentation:
https://github.com/Microsoft/WPF-Samples/tree/master/PerMonitorDPI
John Stebbins [Wed, 15 Feb 2017 22:47:49 +0000 (15:47 -0700)]
muxavformat: Inform muxer of encoder delay
initial_padding is used to inform libav muxers of initial encoder delay
duration. When set for mkv it can be used to remove the silence samples
during playback since the delay value gets stored in the mkv CodecDelay
element.
John Stebbins [Wed, 15 Feb 2017 22:43:48 +0000 (15:43 -0700)]
libav: fix mkv timestamps when initial_padding is set
initial_padding is used to inform libav muxers of initial encoder delay
duration. When set for mkv it can be used to remove the silence samples
during playback.
John Stebbins [Tue, 14 Feb 2017 23:36:07 +0000 (16:36 -0700)]
mux: revert shift timestamps by largest encoder delay
Ugh! I need a brain transplant! This would have cause a properly
functioning player to insert silence at the start of playback that
wasn't in the original source.
sr55 [Sat, 11 Feb 2017 15:11:06 +0000 (15:11 +0000)]
WinGui: Change the following libraries to use NuGet sources.
- Gong-WPF-DragDrop (Upgraded to 0.1.4.3 -> 1.1.0)
- NewtonSoft.Json (Upgraded to 7.0.0 -> 9.0.1)
- Ookii.Dialogs 1.0
- Caliburn Micro (Upgraded to 2.0.2 -> 3.0.3)
Here's a description of how mp4 timestamps work and what is going wrong
for the curious.
Terminology:
pts = presentation timestamp, when a frame is displayed
dts = decode timestamp, when a frame is decoded
cts = composition offset, pts - dts
empty edit = defines the pts of the first frame in an mp4 track
mp4 timestamps are computed from 3 primary values that are in the mp4
stream.
An "empty edit" in the track edit list
per frame duration
per frame cts
Here's where things get messy. How do you compute pts(N) and dts(N) for
some frame N from only the above 3 values in the mp4 file?
empty edit == pts(0) and is read from the mp4 file (EDTS table)
duration(N) is read from the mp4 file (STTS table)
cts(N) is read from the mp4 file (CTTS table)
We know cts(0) = pts(0) - dts(0) by definition of cts
And cts(0) and pts(0) are known since they can be read from the mp4 file
This is the step libav gets wrong!
Therefore we can compute dts(0) = pts(0) - cts(0).
libav computes dts(0) = pts(0) which shifts all frames by cts(0)
After that dts(N) = dts(0) + duration(0) + ... + duration(N-1)
And finally pts(N) = dts(N) + cts(N)
John Stebbins [Thu, 9 Feb 2017 17:23:19 +0000 (10:23 -0700)]
libhb: fix Bob + CFR Same As Source + 2 Pass encode
The bob filter predicts the resulting output framerate as 2 * input
framerate. So during 2 pass encoding, we must adjust the framerate with
the knows 1st pass values *after* any predictions made by filters.
sr55 [Sun, 29 Jan 2017 17:19:16 +0000 (17:19 +0000)]
WinGui: Remove System.Windows.Forms, PresentationCore, PresentationFramework and WindowsBase from the Services library. This makes the library more portable.
sr55 [Fri, 13 Jan 2017 21:44:08 +0000 (21:44 +0000)]
WinGui: Fix an issue which prevented the GUI from parsing presets with hb_presets_read_file_json becaused it returned an unnamed list when reading plist files. It can now handle PresetList or just unnamed Json List []
Also made the parser more tolerant to casing and unset and unexpected values.
Damiano Galassi [Mon, 9 Jan 2017 08:18:03 +0000 (09:18 +0100)]
libhb: check if decvobsub.c private_data is not null before accessing one of its member. Fix a crash when calling decsubClose if the decoder had not been initialized yet.