52 Commits (master)

Author SHA1 Message Date
Leo Butler d7c65c65d1 correct typo 1 year ago
Leo Butler f20aa31a72 ffmpeg-myth1, ffmpeg-myth0 update
ffmpeg-myth1: check the recording basename of the rec and tr-rec, if
they are equal, don't schedule a deletion

ffmpeg-myth0: institute an error handler around ffmpeg-myth1

ffmpeg-myth-do-pending-jobs: institute job control to prevent a collision
1 year ago
Leo Butler 599e269e67 myth-move-and-symlink-watched-files
Move a watched, transcoded file from recordings directory to watched-recordings.
1 year ago
Leo Butler 1e8a1d861f myth-merge-two-recordings now outsources to finding the next or
or previous recording on the same channel, that may overlap or abut
the current one.

To avoid error in the concatenation, we drop unknown streams and data streams.
1 year ago
Leo Butler 9ce8047004 set autoexpire=0, preserve=1 for transcoded files
We should set the duration, too.
1 year ago
Leo Butler 292714e85f change the default to #t for scale?
in ffmpeg-split+scale+transcode-recording
1 year ago
Leo Butler 19205b6847 remove any data streams when using concat muxer
the scte_35 data stream can cause an ffmpeg error
2 years ago
Leo Butler e7f256468e add wildcard to end of expired filename
To ensure that associated pngs, etc, are also deleted.
2 years ago
Leo Butler b5cead5760 add / separator to pathnames 2 years ago
Leo Butler d88a8b9e9e use the new code in ffmpeg-myth.scm to cull old files 2 years ago
Leo Butler 3cb6c612e3 revert to slow preset, add code for cleaning up transcoded files
ltbtranscodedtobedeleted table in mythconverg has been added:

CREATE TABLE `ltbtranscodedtobedeleted` (
  `basename` varchar(256) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `expirydate` datetime NOT NULL,
2 years ago
MYTH-MERGE-TWO-RECORDINGS takes a recording chanid and starttime and
finds the next recording on that same chanid and uses the concat muxer
to merge the two files. The recording information is updated in

We should check for compatibility, but don't at the moment.

FFMPEG-REMUX-TO-H264-TS remuxes a recording into an mpegts
container. The name is somewhat wrong, because it does not transcode
to h264, but the main use is in converting matroska to mpegts
containers, and all my mkvs use h264-encoded video.
2 years ago
Leo Butler 23d4e73ed6 improve RECORDING-NEW-FILE-NAME
With the new file endings, we need to split file names at #\. and pick
up the beginning (e.g. 1031_20210405000300) and add
ending (e.g. h264.ts) but drop any middle parts.
2 years ago
Leo Butler bbb8b1a094 don't use ext, so remove it 2 years ago
Leo Butler d97779eacd update the list of file endings 2 years ago
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.
2 years ago
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.
2 years ago
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.
2 years ago
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.
2 years ago
Leo Butler 265905ff90 start jobs with the greatest niceness 2 years ago
Leo Butler 22319f14a3 a draft of split+scale+... transcoder 2 years ago
Leo Butler 084cc7f63f tag the recording record depending on success of updating db 2 years ago
Leo Butler f999148fc4 allow re-create-record-data to pass recording records unaltered 2 years ago
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.
2 years ago
Leo Butler f3c0d86d71 filter out any recordings in the Deleted group
Do not transcode a recording in the Deleted group.
2 years ago
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
2 years ago
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.
3 years ago
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.
3 years ago
Leo Butler bbb2c1ebf7 add a recording-filesize function 3 years ago
Leo Butler fba4b359fa add a write-to-file function for exporting stuff 3 years ago
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.
3 years ago
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.
3 years ago
Leo Butler c844f0303c allow command-line option to set up job 3 years ago
Leo Butler e5270ae588 ensure that the start of next cut is after end of current cut 3 years ago
Leo Butler 832580ea6a constants for the recordedmarkup table in scheme 3 years ago
Leo Butler d3e1e370e5 mythconverg schema for v28 3 years ago
Leo Butler 9de80e032d A kludge to deal with problematic library upgrades
The release upgrade from 16.04 to 18.04 was not seamless.

LD_LIBRARY_PATH= ld ffmpeg.git/ffmpeg

ld: warning: libcdio_paranoia.so.1, needed by //usr/lib/x86_64-linux-gnu/libavdevice-ffmpeg.so.58, not found (try using -rpath or -rpath-link)
ld: warning: libcdio_cdda.so.1, needed by //usr/lib/x86_64-linux-gnu/libavdevice-ffmpeg.so.58, not found (try using -rpath or -rpath-link)
ld: warning: libbluray.so.1, needed by //usr/lib/x86_64-linux-gnu/libavformat-ffmpeg.so.58, not found (try using -rpath or -rpath-link)
ld: warning: libx265.so.79, needed by //usr/lib/x86_64-linux-gnu/libavcodec-ffmpeg.so.58, not found (try using -rpath or -rpath-link)
3 years ago
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.
3 years ago
Leo Butler 88dcc5b470 add debugging print out in shell-command-to-string 3 years ago
Leo Butler 076164e4a0 clear cutlist commflagged bookmark and set transcoded 3 years ago
Leo Butler 0839a6be14 change csv-parser to ffprobe-out-parser
use #\page as the separator for ffprobe 'csv' output
3 years ago
Leo Butler f37ec47ee1 set PATH variable 3 years ago
Leo Butler 4335a8d9dd a cron job launcher for ffmpeg-myth.scm 3 years ago
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
3 years ago
Leo Butler 0137380569 a start at using elisp+comint-mode
abandoned in favour of scheme
3 years ago
Leo Butler 5fafa809e0 clean up transcoded files
TODO: use the db to find these files
3 years ago
Leo Butler 81912155c1 core sh scripts for transcoding to h264 in mkv 3 years ago
Leo Butler 763f589be1 scripts to remove cut or skip lists
Uses the concat muxer
3 years ago
Leo Butler 131e2fa645 a job launcher
passes most settings through environment variables
3 years ago
Leo Butler 64766508f0 cron script to clean up files
clean files that have been transcoded
3 years ago