I record programs over the air with an HDHR3 box and the videos land in my recordings directory as MPEG2 with suffix .ts which are large. I wrote a custom transcoder using HandBrakeCLI to convert them from 1080p MPEG2 to 720p H264 which reduces filesize to below 25% of the original.
However I discovered continuous mythpreviewgen processes running which were trying and failing to generate the preview PNG files from these MKV files.
I attempted to manually run it with:
Code: Select all
mythpreviewgen --size 0x0 --chanid 10501 --starttime 20191011003000 --outfile ./preview.png --verbose all
Code: Select all
020-01-04 19:00:02.925028 I avformatdecoder.cpp:473:AvFormatDecoder AFD: PlayerFlags: 0x30100, AudioReadAhead: 100 msec
2020-01-04 19:00:02.925274 I avformatdecoder.cpp:1010:InitByteContext AFD: Buffer size: 32768 streamed 0 seekable 1
2020-01-04 19:00:02.944829 I avformatdecoder.cpp:2175:ScanStreams AFD: Stream #0, has id 0x0 codec id H264, type Video, bitrate 0 at 0x5740c0
2020-01-04 19:00:02.944837 I avformatdecoder.cpp:2175:ScanStreams AFD: Stream #1, has id 0x0 codec id AAC, type Audio, bitrate 0 at 0x5750c0
2020-01-04 19:00:02.944842 I avformatdecoder.cpp:2219:ScanStreams AFD: codec AAC has 2 channels
2020-01-04 19:00:02.944844 I avformatdecoder.cpp:2278:ScanStreams AFD: Looking for decoder for AAC
2020-01-04 19:00:02.945272 I avformatdecoder.cpp:2767:OpenAVCodec AFD: Opened codec 0x698f00, id(AAC) type(Audio)
2020-01-04 19:00:02.945309 I avformatdecoder.cpp:2426:ScanStreams AFD: Audio Track #1, of type (Normal) is A/V stream #1 (id=0x0) and has 2 channels in the Eng
lish language(6647399).
2020-01-04 19:00:02.945315 I avformatdecoder.cpp:2175:ScanStreams AFD: Stream #2, has id 0x0 codec id AC3, type Audio, bitrate 384000 at 0x593400
2020-01-04 19:00:02.945318 I avformatdecoder.cpp:2219:ScanStreams AFD: codec AC3 has 6 channels
2020-01-04 19:00:02.945320 I avformatdecoder.cpp:2278:ScanStreams AFD: Looking for decoder for AC3
2020-01-04 19:00:02.945660 I avformatdecoder.cpp:2767:OpenAVCodec AFD: Opened codec 0x5d1800, id(AC3) type(Audio)
2020-01-04 19:00:02.945671 I avformatdecoder.cpp:2426:ScanStreams AFD: Audio Track #2, of type (Normal) is A/V stream #2 (id=0x0) and has 6 channels in the Eng
lish language(6647399).
2020-01-04 19:00:02.945676 I avformatdecoder.cpp:2175:ScanStreams AFD: Stream #3, has id 0x0 codec id Unknown Codec ID, type Subtitle, bitrate 0 at 0x5942c0
2020-01-04 19:00:02.945682 I avformatdecoder.cpp:2235:ScanStreams AFD: subtitle codec (Subtitle)
2020-01-04 19:00:02.945684 I avformatdecoder.cpp:2278:ScanStreams AFD: Looking for decoder for Unknown Codec ID
2020-01-04 19:00:02.945712 I avformatdecoder.cpp:2767:OpenAVCodec AFD: Opened codec 0x5fb180, id(Unknown Codec ID) type(Subtitle)
2020-01-04 19:00:02.945717 I avformatdecoder.cpp:2379:ScanStreams AFD: Subtitle track #1 is A/V stream #3 and is in the English language(6647399).
2020-01-04 19:00:02.945719 I avformatdecoder.cpp:2441:ScanStreams AFD: Trying to select best video track
2020-01-04 19:00:02.945744 I avformatdecoder.cpp:2474:ScanStreams AFD: Selected track #0 (id 0x0 codec id H264, type Video, bitrate 500000 at 0x5740c0)
2020-01-04 19:00:02.948152 I avformatdecoder.cpp:2655:ScanStreams AFD: Using 1 CPUs for decoding
2020-01-04 19:00:02.948156 I avformatdecoder.cpp:1616:InitVideoCodec AFD: InitVideoCodec() 0x59ad40 id(H264) type (Video).
2020-01-04 19:00:02.948176 I avformatdecoder.cpp:1458:normalized_fps AFD: Selected FPS is 29.97 (avg 29.97 codec 0 container 1000 estimated 29.97)
2020-01-04 19:00:02.948212 I avformatdecoder.cpp:2667:ScanStreams AFD: Using ffmpeg for video decoding
2020-01-04 19:00:02.948447 I avformatdecoder.cpp:2767:OpenAVCodec AFD: Opened codec 0x59ad40, id(H264) type(Video)
2020-01-04 19:00:02.948485 I avformatdecoder.cpp:4770:AutoSelectAudioTrack AFD: Trying to select audio track (w/lang)
2020-01-04 19:00:02.949782 I avformatdecoder.cpp:4909:AutoSelectAudioTrack AFD: Selected track 2: English AC3 5.1ch (A/V Stream #2)
2020-01-04 19:00:02.949789 I avformatdecoder.cpp:5663:SetupAudioStream AFD: Audio data is planar
2020-01-04 19:00:02.949797 I avformatdecoder.cpp:5712:SetupAudioStream AFD: Initializing audio parms from audio track #2
2020-01-04 19:00:02.949808 I avformatdecoder.cpp:5717:SetupAudioStream AFD: Audio format changed
2020-01-04 19:00:02.961410 I avformatdecoder.cpp:350:myth_av_log Input #0, matroska,webm, from '/mnt/videos/mythtv/10501_20191011003000.mkv':
2020-01-04 19:00:02.961419 I avformatdecoder.cpp:350:myth_av_log Metadata:
2020-01-04 19:00:02.961426 I avformatdecoder.cpp:350:myth_av_log creation_time : 2019-10-11T01:02:03.000000Z
2020-01-04 19:00:02.961430 I avformatdecoder.cpp:350:myth_av_log ENCODER : Lavf58.20.100
2020-01-04 19:00:02.961438 I avformatdecoder.cpp:350:myth_av_log Duration: 00:30:58.12, start: 0.426000, bitrate: 2195 kb/s
2020-01-04 19:00:02.961518 I avformatdecoder.cpp:350:myth_av_log Stream #0:0: Video: h264 (Main), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9],
500 kb/s, 29.97 fps, 29.97 tbr, 1k tbn, 180k tbc (default)
2020-01-04 19:00:02.961521 I avformatdecoder.cpp:350:myth_av_log Metadata:
2020-01-04 19:00:02.961525 I avformatdecoder.cpp:350:myth_av_log DURATION : 00:30:58.115000000
2020-01-04 19:00:02.961552 I avformatdecoder.cpp:350:myth_av_log Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp (default)
2020-01-04 19:00:02.961554 I avformatdecoder.cpp:350:myth_av_log Metadata:
2020-01-04 19:00:02.961557 I avformatdecoder.cpp:350:myth_av_log title : Stereo
2020-01-04 19:00:02.961560 I avformatdecoder.cpp:350:myth_av_log DURATION : 00:30:57.642000000
2020-01-04 19:00:02.961582 I avformatdecoder.cpp:350:myth_av_log Stream #0:2(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
2020-01-04 19:00:02.961584 I avformatdecoder.cpp:350:myth_av_log Metadata:
2020-01-04 19:00:02.961587 I avformatdecoder.cpp:350:myth_av_log title : Surround
2020-01-04 19:00:02.961590 I avformatdecoder.cpp:350:myth_av_log DURATION : 00:30:57.653000000
2020-01-04 19:00:02.961610 I avformatdecoder.cpp:350:myth_av_log Stream #0:3(eng): Subtitle: ass
2020-01-04 19:00:02.961612 I avformatdecoder.cpp:350:myth_av_log Metadata:
2020-01-04 19:00:02.961615 I avformatdecoder.cpp:350:myth_av_log DURATION : 00:30:57.086000000
2020-01-04 19:00:02.961618 I avformatdecoder.cpp:1360:OpenFile AFD: Position map found
2020-01-04 19:00:02.961623 I avformatdecoder.cpp:1363:OpenFile AFD: Successfully opened decoder for file: "/mnt/videos/mythtv/10501_20191011003000.mkv". novide
o(0)
2020-01-04 19:00:03.003311 I avformatdecoder.cpp:683:DoFastForward AFD: DoFastForward(18880 (0), do discard frames)
2020-01-04 19:00:03.003554 I avformatdecoder.cpp:806:SeekReset AFD: SeekReset(18858, 22, do flush, do discard)
2020-01-04 19:00:03.003826 I avformatdecoder.cpp:840:SeekReset AFD: SeekReset() flushing
2020-01-04 19:00:03.007811 E avformatdecoder.cpp:350:myth_av_log [h264 @ 0x7f20604332c0] Missing reference picture, default is 0
2020-01-04 19:00:03.007820 E avformatdecoder.cpp:350:myth_av_log [h264 @ 0x7f20604332c0] co located POCs unavailable
2020-01-04 19:00:03.011952 E avformatdecoder.cpp:350:myth_av_log [h264 @ 0x7f20604332c0] Missing reference picture, default is 0
2020-01-04 19:00:03.011959 E avformatdecoder.cpp:350:myth_av_log [h264 @ 0x7f20604332c0] co located POCs unavailable
2020-01-04 19:00:03.015423 E avformatdecoder.cpp:350:myth_av_log [h264 @ 0x7f20604332c0] reference picture missing during reorder
2020-01-04 19:00:03.015428 E avformatdecoder.cpp:350:myth_av_log [h264 @ 0x7f20604332c0] reference picture missing during reorder
2020-01-04 19:00:03.015450 E avformatdecoder.cpp:350:myth_av_log [h264 @ 0x7f20604332c0] reference picture missing during reorder
2020-01-04 19:00:03.015456 E avformatdecoder.cpp:350:myth_av_log [h264 @ 0x7f20604332c0] Missing reference picture, default is 0
2020-01-04 19:00:03.015462 E avformatdecoder.cpp:350:myth_av_log [h264 @ 0x7f20604332c0] Missing reference picture, default is 0
2020-01-04 19:00:03.015466 E avformatdecoder.cpp:350:myth_av_log [h264 @ 0x7f20604332c0] Missing reference picture, default is 0
2020-01-04 19:00:03.021105 E avformatdecoder.cpp:350:myth_av_log [h264 @ 0x7f20604332c0] Missing reference picture, default is 0
2020-01-04 19:00:03.025542 E avformatdecoder.cpp:350:myth_av_log [h264 @ 0x7f20604332c0] mmco: unref short failure
2020-01-04 19:00:03.033709 E avformatdecoder.cpp:350:myth_av_log [h264 @ 0x7f20604332c0] reference picture missing during reorder
2020-01-04 19:00:03.033731 E avformatdecoder.cpp:350:myth_av_log [h264 @ 0x7f20604332c0] Missing reference picture, default is 65540
2020-01-04 19:00:03.044481 E avformatdecoder.cpp:350:myth_av_log [h264 @ 0x7f20604332c0] mmco: unref short failure
2020-01-04 19:00:03.128318 E avformatdecoder.cpp:5311:GetFrame decoding error End of file (-541478725)
2020-01-04 19:00:03.153320 E avformatdecoder.cpp:5311:GetFrame decoding error End of file (-541478725)
2020-01-04 19:00:03.163220 E avformatdecoder.cpp:5311:GetFrame decoding error End of file (-541478725)
2020-01-04 19:00:03.174267 E avformatdecoder.cpp:5311:GetFrame decoding error End of file (-541478725)
.
. ## About 500 of these "GetFrame decoding error End of file" messages
.
2020-01-04 19:00:08.182935 E avformatdecoder.cpp:5311:GetFrame decoding error End of file (-541478725)
2020-01-04 19:00:08.192763 E avformatdecoder.cpp:5311:GetFrame decoding error End of file (-541478725)
2020-01-04 19:00:08.203576 E avformatdecoder.cpp:350:myth_av_log [buffer @ 0x7f205f76c0e0] Value -0.562500 for parameter 'pixel_aspect' out of range [0 - 1.797
69e+308]
2020-01-04 19:00:08.203597 E avformatdecoder.cpp:350:myth_av_log [buffer @ 0x7f205f76c0e0] Value -0.562500 for parameter 'pixel_aspect' out of range [0 - 1.797
69e+308]
2020-01-04 19:00:08.203632 E avformatdecoder.cpp:350:myth_av_log [buffer @ 0x7f205f76c0e0] Value -0.562500 for parameter 'pixel_aspect' out of range [0 - 1.797
69e+308]
2020-01-04 19:00:08.203649 E avformatdecoder.cpp:350:myth_av_log [buffer @ 0x7f205f76c0e0] Value -0.562500 for parameter 'pixel_aspect' out of range [0 - 1.797
69e+308]
2020-01-04 19:00:08.203655 E avformatdecoder.cpp:350:myth_av_log [buffer @ 0x7f205f76c0e0] Error setting option pixel_aspect to value -9/16.
2020-01-04 19:00:08.203660 E avformatdecoder.cpp:350:myth_av_log [Parsed_buffer_0 @ 0x7f205f732c80] Error applying options to the filter.
2020-01-04 19:00:08.203672 E avformatdecoder.cpp:350:myth_av_log [AVFilterGraph @ 0x7f205f76bf60] Error initializing filter 'buffer' with args 'video_size=1280
x720:pix_fmt=0:time_base=1/1:pixel_aspect=-9/16'
But the question remains, why can't mythpreviewgen extract the PNG from my MKV file?
The command used to transcode is:
Code: Select all
HandBrakeCLI --preset-import-file /mnt/videos/mythtv/MY_Presets.json -Z "OTA 5.1 Audio" -i $FILE --subtitle 1,2,3 -o $MKVFILE
Code: Select all
[
{
"ChildrenArray": [
{
"AudioCopyMask": [
"copy:aac",
"copy:ac3"
],
"AudioEncoderFallback": "ac3",
"AudioList": [
{
"AudioBitrate": 128,
"AudioEncoder": "aac",
"AudioMixdown": "dpl2",
"AudioSamplerate": "auto",
"AudioTrackDRCSlider": 0.0,
"AudioTrackGainSlider": 0.0
},
{
"AudioBitrate": 640,
"AudioCompressionLevel": -1.0,
"AudioDitherMethod": "auto",
"AudioEncoder": "copy:ac3",
"AudioMixdown": "none",
"AudioNormalizeMixLevel": false,
"AudioSamplerate": "auto",
"AudioTrackQualityEnable": false,
"AudioTrackQuality": -1.0,
"AudioTrackGainSlider": 0.0,
"AudioTrackDRCSlider": 0.0
}
],
"ChapterMarkers": true,
"Default": false,
"FileFormat": "mkv",
"Folder": false,
"Mp4HttpOptimize": false,
"Mp4iPodCompatible": false,
"PictureAutoCrop": true,
"PictureBottomCrop": 0,
"PictureLeftCrop": 0,
"PictureRightCrop": 0,
"PictureTopCrop": 0,
"PictureDeblock": 0,
"PictureDeinterlaceCustom": "",
"PictureDeinterlaceFilter": "off",
"PictureDeinterlacePreset": "default",
"PictureDenoiseCustom": "",
"PictureDenoiseFilter": "off",
"PictureDetelecine": "off",
"PictureDetelecineCustom": "",
"PictureHeight": 720,
"PictureKeepRatio": true,
"PictureModulus": 2,
"PicturePAR": "loose",
"PictureWidth": 1280,
"PresetDescription": "Davids Preset for OTA with 5.1 audio",
"PresetName": "David OTA 5.1 Audio",
"Type": 0,
"UsesPictureFilters": true,
"UsesPictureSettings": 1,
"VideoAvgBitrate": 2500,
"VideoEncoder": "x264",
"VideoFramerate": "30",
"VideoFramerateMode": "pfr",
"VideoGrayScale": false,
"VideoLevel": "3.1",
"VideoOptionExtra": "",
"VideoPreset": "medium",
"VideoProfile": "main",
"VideoQualitySlider": 22.0,
"VideoQualityType": 2,
"VideoTune": "",
"VideoTurboTwoPass": false,
"VideoTwoPass": false,
"x264Option": "",
"x264UseAdvancedOptions": false
},
{
"AudioCopyMask": [
"copy:aac",
"copy:ac3"
],
"AudioEncoderFallback": "ac3",
"AudioList": [
{
"AudioBitrate": 128,
"AudioEncoder": "aac",
"AudioMixdown": "dpl2",
"AudioSamplerate": "auto",
"AudioTrackDRCSlider": 0.0,
"AudioTrackGainSlider": 0.0
},
{
"AudioBitrate": 640,
"AudioCompressionLevel": -1.0,
"AudioDitherMethod": "auto",
"AudioEncoder": "copy:ac3",
"AudioMixdown": "none",
"AudioNormalizeMixLevel": false,
"AudioSamplerate": "auto",
"AudioTrackQualityEnable": false,
"AudioTrackQuality": -1.0,
"AudioTrackGainSlider": 0.0,
"AudioTrackDRCSlider": 0.0
}
],
"ChapterMarkers": true,
"Default": false,
"FileFormat": "mp4",
"Folder": false,
"Mp4HttpOptimize": false,
"Mp4iPodCompatible": false,
"PictureAutoCrop": true,
"PictureBottomCrop": 0,
"PictureLeftCrop": 0,
"PictureRightCrop": 0,
"PictureTopCrop": 0,
"PictureDeblock": 0,
"PictureDeinterlaceCustom": "",
"PictureDeinterlaceFilter": "off",
"PictureDeinterlacePreset": "default",
"PictureDenoiseCustom": "",
"PictureDenoiseFilter": "off",
"PictureDetelecine": "off",
"PictureDetelecineCustom": "",
"PictureHeight": 720,
"PictureKeepRatio": true,
"PictureModulus": 2,
"PicturePAR": "loose",
"PictureWidth": 1280,
"PresetDescription": "Davids Preset for OTA with 5.1 audio",
"PresetName": "David OTA 5.1 Audio MP4",
"Type": 0,
"UsesPictureFilters": true,
"UsesPictureSettings": 1,
"VideoAvgBitrate": 2500,
"VideoEncoder": "x264",
"VideoFramerate": "30",
"VideoFramerateMode": "pfr",
"VideoGrayScale": false,
"VideoLevel": "3.1",
"VideoOptionExtra": "",
"VideoPreset": "medium",
"VideoProfile": "main",
"VideoQualitySlider": 22.0,
"VideoQualityType": 2,
"VideoTune": "",
"VideoTurboTwoPass": false,
"VideoTwoPass": false,
"x264Option": "",
"x264UseAdvancedOptions": false
}
],
"Folder": true,
"PresetName": "Davids Presets",
"Type": 0
}
]