Commit Graph

22 Commits

Author SHA1 Message Date
Leo Butler a483779bc1 Compensate for ffprobe deficiency in probing h265-encoded files
The current version of ffprobe,

ffprobe version 4.2.4-1ubuntu0.1 Copyright (c) 2007-2020 the FFmpeg developers

prints a value of 0 for each frame number in an h265-encoded
mpegts. So, we need to count for ourselves.


Experiments with h265-encoded videos shows that there is great
compression (~30-40% better than h264), but:

-the mythling player on android can't play them;
-the 8-yr old asus frontend can play cartoons fine, but not
 "real-life" video
-transcoding is about 1/3 the speed with libx265 vs. libx264

I will revisit the issue when one of the first two points makes it
possible, but until one of them needs to be replaced, I will stick
with h264.
2021-04-18 06:46:48 -05:00
Leo Butler eb0f6c85cc Add map-cons
This idiom of converting a list (L1 L2) of two lists into a list of
cons cells was appearing in a few places, so add a function to
encapsulate it.
2021-04-18 06:44:01 -05:00
Leo Butler 80111fa2ec in SHELL-COMMAND-TO-STRING, throw an error upward
We want to treat all errors in SHELL-COMMAND-TO-STRING as fatal unless
the caller installs a handler for ERROR-IN-SHELL-COMMAND-TO-STRING.
2021-04-18 06:42:22 -05:00
Leo Butler af706d5d4b sharpen transcoding options, add choice for muxer
In v31 of mythtv, playback and editing of matroska-formatted
containers does not work well--seeking is broken so bookmarks,
jumping, etc. do not work.

So, an option to set the container format/muxer has been added to
and this is set to mpegts by default.

Because we relied on defaults for the matroska container, we have made
some things explicit (like using libx264 for the video codec). The
preset is also now veryfast, rather than slow, which is a recommended
setting on the ffmpeg users' mailing list.

now, rather than hard-coded options.
2021-04-18 06:34:59 -05:00
Leo Butler 22319f14a3 a draft of split+scale+... transcoder 2021-01-21 20:33:41 -06:00
Leo Butler 084cc7f63f tag the recording record depending on success of updating db 2021-01-21 20:32:49 -06:00
Leo Butler f999148fc4 allow re-create-record-data to pass recording records unaltered 2021-01-21 20:31:28 -06:00
Leo Butler def854296e mythtv-make-concat-list: handle empty cut list
If cut list is empty, set it to ((0 0)), so that concat list ends up
being ((0 N)) where N is either the last i-frame number or

When fed to the concat filter in ffmpeg-split+transcode-recording, the
recording will be transcoded.
2021-01-21 20:24:25 -06:00
Leo Butler f3c0d86d71 filter out any recordings in the Deleted group
Do not transcode a recording in the Deleted group.
2021-01-07 20:28:10 -06:00
Leo Butler 61dc6756d6 ensure that I-frames have valid data
With the current ffprobe [1], time or frame numbers for an I-frame may be
output that are invalid (N/A).

[1] ffprobe version 3.4.8-0ubuntu0.2 Copyright (c) 2007-2020 the FFmpeg developers
2021-01-07 20:24:10 -06:00
Leo Butler ea76a163a8 add mythconverg-update-recordedmarkup-table-rollback
A function to rollback a transcoding. It assumes that the original
file has not been altered in any way.
2020-12-08 12:52:18 -06:00
Leo Butler a16b9aaa99 Skip an I-frame that does not have a numeric PTS
In some older video files, ffprobe returns N/A (and possibly other
non-numeric data) when it can't determine the PTS. These cause
problems and ruin a transcode.
2020-12-08 12:47:06 -06:00
Leo Butler bbb2c1ebf7 add a recording-filesize function 2020-12-08 12:46:49 -06:00
Leo Butler fba4b359fa add a write-to-file function for exporting stuff 2020-12-08 12:46:16 -06:00
Leo Butler 35d0099e40 Use duration (-t) not end time (-to) for inputs
In older versions of ffmpeg (incl. ffmpeg version 3.4.8-0ubuntu0.2 ),
using the end-time (-to) causes a syntax error, so we need to switch
to using the duration.
2020-12-08 12:42:46 -06:00
Leo Butler 6dca224ea2 use the system binaries for ffmpeg and ffprobe
The library mis-match on ubuntu 18.04 seems impossible to fix, so
revert to using the system binaries.

This makes including a subtitle stream impossible for now, but moving
to the concat *filter* had made that pretty much impossible anyway,
because ffmpeg (even in HEAD) does not set the right PTS when the
input is in matroska format.
2020-12-08 12:38:57 -06:00
Leo Butler e5270ae588 ensure that the start of next cut is after end of current cut 2020-10-23 13:25:12 -05:00
Leo Butler 306bd7c0ce correct the finding of nearest i-frames
the original code used >= or <= as the test, but the code actually
implemented > or <. This causes an ffmpeg error when there is only 1
i-frame between the lower and upper bound.
2020-07-27 17:33:47 -05:00
Leo Butler 88dcc5b470 add debugging print out in shell-command-to-string 2020-07-27 17:33:47 -05:00
Leo Butler 076164e4a0 clear cutlist commflagged bookmark and set transcoded 2020-07-27 17:33:47 -05:00
Leo Butler 0839a6be14 change csv-parser to ffprobe-out-parser
use #\page as the separator for ffprobe 'csv' output
2020-07-27 17:33:47 -05:00
Leo Butler 37a2c8df05 a guile scheme re-implementation
-use the concat filter rather than segment+concat muxers
-currently, do not create a separate subtitle stream from closed

-ffmpeg-myth-do-pending-jobs will look up recordings with a cutlist and
 run the transcoder (ffmpeg-myth-cut) over each
2020-07-27 17:33:47 -05:00