jstebbins [Sun, 2 Oct 2011 21:28:45 +0000 (21:28 +0000)]
CLI: x264 preset, tuning, and profile support
New cli options --x264-preset, --x264-tune, and --x264-profile. x264
preset and tune are set first, followed by any custom x264 option string,
and finally the profile is applied.
The PCR comparison we were doing could cause us to drop all the
timestamps for an audio stream when the audio packets are very widely
spaced. Now, it detects PCR changes explicitely and only drops the
timestamps if a discontinuity PCR prior to the packets current PCR has
already been sent to the reader.
When the audio tracks are omitted (no -a), the cli uses the first source
audio track and replicates it for each audio output codec. The way it
knows what to replicate is to look at audio->in.track for the last audio
that was added to the job. This track number was being copied from the
title's in.track. But title track numbers are not guaranteed to be
sequential (e.g. scan drops tracks it can't decode). So when adding an
audio to a job, set in.track to the value of in.track that is passed in
the audio_config structure passed to hb_audio_add.
Extracts duplicated code from decomb.c and deinterlace.c and puts
it in a shared module. Fixes a bug that existed in the decomb
version of mcdeint_filter.
Adds --loose-crop option. Loose croping rounds up (or down) the crop
values to the specified mod so that scaling is not required. One
noteworthy efect of this is that both display aspect and pixel aspect in
the output will be exactly the same as the source when anamorphic is
enabled.
For TS streams that don't have PCRs, we substitute the DTS timestamp
from the video track (or PTS if we don't see DTS). But these can bounce
around or be wider spaced in the stream that PCRs are meant to be. So I
have added a test to see if the timestamp looks like a discontinuity.
Then I only pass the timestamp as a PCR if there appears to be a
discontinuity. This prevents a lot of scr_offset thrashing.
I have also fixed an error in our scr_offset processing. It is rarely
triggered and it's effects are so minor with well behaved streams that
it would be completely unnoticed. But with the test stream I was using,
it caused a factor of 10 times more "audio went backwards" errors.
A new obfuscation technique it to add UDF-16 filenames that have junk in
the high byte and things like "VIDEO_TS.IFO" in the low byte.
libdvdread throws away the high byte which results in references to the
bogus copy of the file.
SSA subtitles have an empty layer field (bare ','). The
scanf format specifier "%*128[^,]" will not match on a
bare ','. There must be at least one non ',' character in
the match. So the format specifier is placed directly next
to the 'Dialogue:' string so that the next expected ' '
after the ':' will be the character it matches on when
there is no layer field.
The AVCHD-Lite specification only supports 50 or 60 fps. So to get
25 or 30 fps, they double every frame using repeat flags. Detect
this and adjust the framerate accordingly.
I like how Yeasah ensures that top and left crop will be even pixel
aligned in his cli patch. Do the same for the lingui. This ensures
that even if the input crop values are not even pixel aligned, the
result will be.
HandBrake's video pipeline uses yuv420 color which requires even
dimensions. The input video may be a diffent color space that allows
odd dimensions. So crop a row or colomn if necessary.
LinGui: ensure loose crop always crops even values
Subsampled chroma (i.e. yuv420) requires that you do all cropping
on even boundaries and that the result has even dimensions. There
were cases where my cropping could violate this.
Periodic intra refresh has no IDR frames, but x264 signals a keyframe at
recovery points. Use this flag to fake keyframes in the container so
that seeking in these files works properly.
Seek point may be a recovery point which will not be a complete clean
frame. So consume frames till we reach the recovery frame count.
Patches Libav so it can tell us when the recovery point has been
reached.
Also improves detection of recovery points in TS files.
WinGui: Fixes to the Audio Panel.
- Fix a display issue with Encoder and Mixdown on the data grid.
- Don't try to load tracks if there isn't any.
- Fix an issue with auto-correction of Passthru option. (DTS-HD would not auto-correct to the correct passthru for the source track type)
I ran across a stream that has bad timestamps in the Teletext track
which causes the demux to think there are discontinuities and drop
packets. makes a real mess of things.
fixes streams that have broken frame count field. since this
value can be computed from the frame size, we can ignore it.
Also fixes some decode errors in 20 and 24bit lpcm.
WinGui: Numerous fixes to Libhb based scanning and encoding. Aside from several non-critical bugs, the code is now "usable" but should be considered experimental.
libhb: fix incorrect decrementing of audio->config.out.track; it starts at 1, not 0. Also, explicitly log that we are dropping the track when we find an incompatible passthru.
Fixes:
[01:26:41] Sample rate 24000 not supported (ca_haac). Using 32kHz for track 1
track 1 suddenly becomes track 0:
[01:26:41] work: sanitizing track 0 mixdown Dolby Pro Logic II to Stereo
[01:26:41] work: sanitizing track 0 audio bitrate 160 to 80
[…]
[01:26:41] * audio track 0
libhb: work around the lack of 6.1 support for DTS sources
libhb doesn't support 6.1 sources and assumes they're 7.0 instead. This breaks downmixing.
Libav can decode the DTS-ES 6.1 core of DTS-HD 6.1 audio tracks; tell it to not process the additional channel so that such tracks can be re-encoded correctly.
See https://reviews.handbrake.fr/r/200/ for more information.
WinGui: Initial support for batch queueing.
A new option "Add All" which will add all scanned titles using the current settings. Ideally used with batch scanned sources.
MacGui: Behold that which is hidden ... Batch Queueing Support.
- Add batch queueing support to the macgui.
- Currently accessed under File > Add All Titles To Queue
- No toolbar button yet since it needs to soak for a while and needs refinement.
- Applies all current settings to all titles.
- Best used with batch scanning flat files.
- Works with a dvd scan where the dvd titles are in the title structure ... but not recommended.
- Use at your own peril!
I found myself wanting to know what the source video codec was when
I discovered that several of my VC-1 trancodes were crap. So this
adds the video codec name to the summary information I display on the
summary tab.
sr55 [Sat, 27 Aug 2011 22:04:54 +0000 (22:04 +0000)]
WinGui: Some tweaks to the way the picture settings panel handles cropping and preset stored values. Check if the preset has values, before ignoring the source values.
sr55 [Sat, 27 Aug 2011 21:39:15 +0000 (21:39 +0000)]
WinGui: Some refactoring of the preset services to make them simpler and restoring old functionality that allowed storing of crop settings to match the macgui.
dynaflash [Wed, 24 Aug 2011 20:11:53 +0000 (20:11 +0000)]
MacGui: Live Preview ...
- Use the first subs track that has been specified to display in the live preview.
-- Tested against TX3G (3GPP) subs in mp4 and vobsubs in mkv.
- Also change Live Preview durations to less granular yet longer durations to: (seconds) 15, 30, 45, 60 90, 105 and 120.
- Subs patch by Rodeo. Thanks!
Rodeo [Fri, 19 Aug 2011 22:25:06 +0000 (22:25 +0000)]
CLI: fix a bug where gain wouldn't be initialized when there were more input audio tracks than the number of gain values specified in the command line.
jstebbins [Fri, 19 Aug 2011 16:00:42 +0000 (16:00 +0000)]
LinGui: compute passthru fallbacks
if we have an encoder for a passthru codec, use that encoder when
passthru isn't possible. for 'Auto Passthru' use the fallback
specified in the preset.
dynaflash [Thu, 18 Aug 2011 22:11:49 +0000 (22:11 +0000)]
MacGui: Fix crash when launching then cancelling new source and quitting would cause a crash due to there being no preview when calling windowWillClose in HBPreview.m
dynaflash [Wed, 17 Aug 2011 15:43:14 +0000 (15:43 +0000)]
MacGui: Fix a crash in live preview where upon closing the preview window during a live preview encode it was not being properly stopped so upon reopening and clicking on "Still Previews" there was a crashy.
jstebbins [Tue, 16 Aug 2011 14:45:11 +0000 (14:45 +0000)]
libhb: Use h.264 recovery points as key frames when decoding
Many transport streams have few or zero IDR frames. So scanning them
takes a long time, generates a lot of log spam, and results in poor
preview quality. Often there will be several identical preview frames
because it will find the same IDR for several of the previews. Using
recovery points helps all these problems.