MythTV / mythtv

The official MythTV repository
https://www.mythtv.org
GNU General Public License v2.0
705 stars 345 forks source link

mythtranscode (master branch) fails #588

Closed linuxdude42 closed 2 years ago

linuxdude42 commented 2 years ago

What steps will reproduce the bug?

Running mythtranscode on a file, it fails with the message avcodec_encode_video2 failed (-22). I am encoding with the command:

mythtranscode -i tv_recording.ts --mpeg2 -o o.ts

How often does it reproduce? Is there a required condition?

Every time

What is the expected behaviour?

Successful completion. The end of a run from the working fixes-32 mythtranscode:

.
.
2022-06-17 15:54:45.131729 N  MPEG2fixup::InitReplex(): High Definition input, increasing replex buffers
2022-06-17 15:54:45.149363 I  Mux rate: 17.86 Mbit/s
2022-06-17 15:54:52.025004 I  PES packet size mismatch
2022-06-17 15:54:52.025012 I  Packet corrupt (stream = 1, dts = 5953642473).
2022-06-17 15:54:52.036912 I  AVFrame.format is not set
2022-06-17 15:54:52.036915 I  AVFrame.width or height is not set
2022-06-17 15:54:52.043524 I  Inserting 2 I-Frames after #2 
2022-06-17 15:54:52.064425 I  Generating Keyframe Index
2022-06-17 15:54:52.064430 I  Opening o.ts
2022-06-17 15:54:52.066606 I  stream 1 : no PTS found at end of file, duration not set
2022-06-17 15:54:52.066608 I  stream 2 : no PTS found at end of file, duration not set
2022-06-17 15:54:52.066670 I  Input #0, mpeg, from 'fixes32.ts':
2022-06-17 15:54:52.066693 I    Duration: 05:07:10.14, start: 0.360000, bitrate: 851 kb/s
2022-06-17 15:54:52.066713 I      Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
2022-06-17 15:54:52.066714 I      Side data:
2022-06-17 15:54:52.066717 I        cpb: bitrate max/min/avg: 17000000/0/0 buffer size: 9781248 vbv_delay: N/A
2022-06-17 15:54:52.066726 I      Stream #0:1[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
2022-06-17 15:54:52.066734 I      Stream #0:2[0x81]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
2022-06-17 15:54:53.181794 I  DTS 79265428 < 1658741808 out of order
2022-06-17 15:54:53.181821 N  Transcode Completed
2022-06-17 15:54:53.188184 N  Transcoding tv_recording.ts done

What do you see instead?

.
.
2022-06-17 15:54:36.914345 N  MPEG2fixup::InitReplex(): High Definition input, increasing replex buffers
2022-06-17 15:54:36.931991 I  Mux rate: 17.86 Mbit/s
2022-06-17 15:54:43.052946 I  PES packet size mismatch
2022-06-17 15:54:43.052952 I  Packet corrupt (stream = 1, dts = 5953642473).
2022-06-17 15:54:43.062876 E  avcodec_encode_video2 failed (-22)
2022-06-17 15:54:43.065045 E  Transcoding tvrecording.ts failed

Additional information

Mythranscode does produce an output file, and it is almost the same size as the file produced by mythtranscode in fixes-32. Comparing the output of mediainfo on the two files, the only differences are in the duration (14:40 vs 14:37) and size (1.83GiB vs 1.82 GiB) fields.

This is not the same problem as #581. I am testing with those fixes included. This problem first appears with the two commits 54f4c8f9b7ece971e5811a8b8a7ebb17d223874c / 4685f07ab81c2dd02f4acff4acf6443579dd4429 that upgrade FFmpeg to version 4.4.1.

Jpilk commented 2 years ago

It works for me with a 2-stream input file. SMplayer plays the output

But tye build for el7 failed. I've added a comment to the commit

[john@HPFed ~]$ mythtranscode --chanid 20002 --starttime 20220613095200 --mpeg2 --honorcutlist --loglevel debug 2022-06-19 13:19:22.288132 C mythtranscode version: HEAD [v33-Pre-3b849cc809] www.mythtv.org 2022-06-19 13:19:22.288138 C Qt version: compile: 5.15.2, runtime: 5.15.2 2022-06-19 13:19:22.288162 I Fedora Linux 35 (Thirty Five) (x86_64)

2022-06-19 13:19:25.464554 I Loading en_gb translation for module mythfrontend 2022-06-19 13:19:25.469294 D Setting 'Lossless transcoding' changed to 0 2022-06-19 13:19:25.469310 D Setting 'Resize video while transcoding' changed to 0 2022-06-19 13:19:25.469536 N Transcoding from /home/john/SGs/RecsSG4/20002_20220613095200.ts to /home/john/SGs/RecsSG4/20002_20220613095200.ts.tmp 2022-06-19 13:19:25.469542 I Honoring the cutlist while transcoding 2022-06-19 13:19:25.474582 I Opening /home/john/SGs/RecsSG4/20002_20220613095200.ts 2022-06-19 13:19:25.481063 I Input #0, mpegts, from '/home/john/SGs/RecsSG4/20002_20220613095200.ts': 2022-06-19 13:19:25.481075 I Duration: 00:00:31.67, start: 1.400000, bitrate: 2776 kb/s 2022-06-19 13:19:25.481119 I Stream #0:0[0x100]: Video: mpeg2video (Main), yuv420p(tv, top first), 704x576 [SAR 16:11 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc 2022-06-19 13:19:25.481123 I Side data: 2022-06-19 13:19:25.481131 I cpb: bitrate max/min/avg: 1412400/0/0 buffer size: 1835008 vbv_delay: N/A 2022-06-19 13:19:25.481157 I Stream #0:1[0x101]: Audio: mp2, 48000 Hz, stereo, fltp, 256 kb/s 2022-06-19 13:19:25.481914 I #0 PTS:00:00:01.752 Delta: 0.0ms queue: 4 2022-06-19 13:19:25.481924 I #1 PTS:00:00:01.736 Delta: 16ms queue: 2 2022-06-19 13:19:25.485531 I Del map found 0 at 42 (42) 2022-06-19 13:19:25.495246 I Mux rate: 1.70 Mbit/s 2022-06-19 13:19:25.583598 I Del map found 1 at 696 (696) 2022-06-19 13:19:25.650195 I Generating Keyframe Index 2022-06-19 13:19:25.650206 I Opening /home/john/SGs/RecsSG4/20002_20220613095200.ts.tmp 2022-06-19 13:19:25.654400 I Input #0, mpeg, from '/home/john/SGs/RecsSG4/20002_20220613095200.ts.tmp': 2022-06-19 13:19:25.654415 I Duration: 00:00:26.20, start: 0.296000, bitrate: 2820 kb/s 2022-06-19 13:19:25.654469 I Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first), 704x576 [SAR 16:11 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc 2022-06-19 13:19:25.654475 I Side data: 2022-06-19 13:19:25.654485 I cpb: bitrate max/min/avg: 3410800/0/0 buffer size: 1835008 vbv_delay: N/A 2022-06-19 13:19:25.654519 I Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16p, 256 kb/s 2022-06-19 13:19:25.676417 N Transcode Completed 2022-06-19 13:19:25.748374 N Transcoding /home/john/SGs/RecsSG4/20002_20220613095200.ts done 2022-06-19 13:19:25.748397 D PowerDBus: Releasing delay FD: 17 2022-06-19 13:19:25.748585 I PowerDBus: Closing interfaces 2022-06-19 13:19:26.223116 I Exiting

Jpilk commented 2 years ago

But here's what happens with an 'as received' recording - tennis on BBC 1 There's a 0 byte output file

[john@HPFed ~]$ mythtranscode --chanid 20001 --starttime 20220619124400 --mpeg2 --honorcutlist --loglevel debug 2022-06-19 13:52:08.194340 C mythtranscode version: HEAD [v33-Pre-3b849cc809] www.mythtv.org 2022-06-19 13:52:08.194346 C Qt version: compile: 5.15.2, runtime: 5.15.2 2022-06-19 13:52:08.194371 I Fedora Linux 35 (Thirty Five) (x86_64)

2022-06-19 13:52:11.571457 D Setting 'Lossless transcoding' changed to 0 2022-06-19 13:52:11.571475 D Setting 'Resize video while transcoding' changed to 0 2022-06-19 13:52:11.571484 N Transcoding from /home/john/SGs/RecsSG4/20001_20220619124400.ts to /home/john/SGs/RecsSG4/20001_20220619124400.ts.tmp 2022-06-19 13:52:11.571491 I Honoring the cutlist while transcoding 2022-06-19 13:52:11.573885 I Opening /home/john/SGs/RecsSG4/20001_20220619124400.ts 2022-06-19 13:52:11.577515 I write_section_data: PID 0x1c21 CRC error 2022-06-19 13:52:11.577910 I write_section_data: PID 0x1c33 CRC error 2022-06-19 13:52:11.592737 I start time for stream 2 is not set in estimate_timings_from_pts 2022-06-19 13:52:11.592748 I start time for stream 4 is not set in estimate_timings_from_pts 2022-06-19 13:52:11.592754 I start time for stream 5 is not set in estimate_timings_from_pts 2022-06-19 13:52:11.592828 I write_section_data: PID 0x1c21 CRC error 2022-06-19 13:52:11.593442 I write_section_data: PID 0x1c21 CRC error 2022-06-19 13:52:11.593506 I write_section_data: PID 0x1c33 CRC error 2022-06-19 13:52:11.593997 I stream 2 : no TS found at start of file, duration not set 2022-06-19 13:52:11.594044 I Could not find codec parameters for stream 2 (Audio: mp3 (mp3float), 0 channels, fltp): unspecified frame size Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options 2022-06-19 13:52:11.594183 I Input #0, mpegts, from '/home/john/SGs/RecsSG4/20001_20220619124400.ts': 2022-06-19 13:52:11.594194 I Duration: 00:02:05.15, start: 23677.827567, bitrate: 3680 kb/s 2022-06-19 13:52:11.594245 I Stream #0:0[0x65]: Video: mpeg2video (Main), yuv420p(tv, top first), 704x576 [SAR 16:11 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc 2022-06-19 13:52:11.594249 I Side data: 2022-06-19 13:52:11.594257 I cpb: bitrate max/min/avg: 15000000/0/0 buffer size: 1835008 vbv_delay: N/A 2022-06-19 13:52:11.594283 I Stream #0:10x66: Audio: mp2, 48000 Hz, stereo, fltp, 256 kb/s 2022-06-19 13:52:11.594307 I Stream #0:20x6a: Audio: mp3, 0 channels, fltp 2022-06-19 13:52:11.594340 I Stream #0:30x69: Subtitle: dvb_subtitle 2022-06-19 13:52:11.594359 I Codec 0x17813 is not in the full list. 2022-06-19 13:52:11.594413 I Stream #0:4[0x1c21]: Data: unknown_codec 2022-06-19 13:52:11.594431 I Codec 0x17813 is not in the full list. 2022-06-19 13:52:11.594449 I Stream #0:5[0x1c33]: Data: unknown_codec 2022-06-19 13:52:11.594457 E Skipping audio stream: 2 2022-06-19 13:52:11.594462 E Skipping unsupported codec 3 on stream 3 2022-06-19 13:52:11.594465 E Skipping unsupported codec 2 on stream 4 2022-06-19 13:52:11.594469 E Skipping unsupported codec 2 on stream 5 2022-06-19 13:52:11.595948 I #0 PTS:06:34:38.857 Delta: 0.0ms queue: 23 2022-06-19 13:52:11.595958 I #1 PTS:06:34:38.835 Delta: 22.1333ms queue: 2 2022-06-19 13:52:11.603760 I Del map found 0 at 137 (137) 2022-06-19 13:52:11.608851 E avcodec_encode_video2 failed (-22) 2022-06-19 13:52:11.609142 E Transcoding /home/john/SGs/RecsSG4/20001_20220619124400.ts failed 2022-06-19 13:52:11.609161 D PowerDBus: Releasing delay FD: 17 2022-06-19 13:52:11.609177 I PowerDBus: Closing interfaces 2022-06-19 13:52:12.608599 I Exiting

Jpilk commented 2 years ago

Hmm. With the 'el7' build now installed, a 2-stream sample with 2 internal switchpoints defined succeeds with just --mpeg2 but fails when --honorcutlist is added.

[john@HP_Box ~]$ mythtranscode --chanid 11156 --starttime 20220610125600 --honorcutlist --mpeg2 --loglevel debug 2022-06-19 19:41:12.577904 C mythtranscode version: HEAD [v33-Pre-eb60f4f103] www.mythtv.org 2022-06-19 19:41:12.577912 C Qt version: compile: 5.9.7, runtime: 5.9.7 2022-06-19 19:41:12.577942 I Scientific Linux 7.9 (Nitrogen) (x86_64)

2022-06-19 19:41:14.241741 I Del map found 0 at 203 (203) 2022-06-19 19:41:14.247040 E avcodec_encode_video2 failed (-22) 2022-06-19 19:41:14.247350 E Transcoding /home/john/SGs/RcSG2/11156_20220610125600.ts failed

Jpilk commented 2 years ago

I tried the F35 build using the --mpeg2 --honorcutlist options on a full-length 2-stream postprocessed recording. The .ts.tmp output file is fine, and plays the right content. It's MPEG2-PS, from MPEG2-TS. But afterwards the seektable of the original file had been trashed, with the editor showing only a short section from the beginning. It's ok after mythcommflag -rebuild

I don't know if the PortChecker stuff is affecting any of this.

[john@HPFed ~]$ mythtranscode --chanid 20009 --starttime 20220616222300 --honorcutlist --mpeg2 --loglevel debug 2022-06-20 12:28:11.855328 C mythtranscode version: HEAD [v33-Pre-3b849cc809] www.mythtv.org 2022-06-20 12:28:11.855334 C Qt version: compile: 5.15.2, runtime: 5.15.2 2022-06-20 12:28:11.855359 I Fedora Linux 35 (Thirty Five) (x86_64)

2022-06-20 12:28:15.241186 N Transcoding from /home/john/SGs/RecsSG4/20009_20220616222300.ts to /home/john/SGs/RecsSG4/20009_20220616222300.ts.tmp 2022-06-20 12:28:15.241193 I Honoring the cutlist while transcoding 2022-06-20 12:28:15.245876 I Opening /home/john/SGs/RecsSG4/20009_20220616222300.ts 2022-06-20 12:28:15.251947 I Input #0, mpegts, from '/home/john/SGs/RecsSG4/20009_20220616222300.ts': 2022-06-20 12:28:15.251959 I Duration: 00:59:08.20, start: 1.400000, bitrate: 2446 kb/s 2022-06-20 12:28:15.252005 I Stream #0:0[0x100]: Video: mpeg2video (Main), yuv420p(tv, top first), 704x576 [SAR 16:11 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc 2022-06-20 12:28:15.252010 I Side data: 2022-06-20 12:28:15.252017 I cpb: bitrate max/min/avg: 8762800/0/0 buffer size: 1835008 vbv_delay: N/A 2022-06-20 12:28:15.252043 I Stream #0:1[0x101]: Audio: mp2, 48000 Hz, stereo, fltp, 256 kb/s 2022-06-20 12:28:15.252446 I #0 PTS:00:00:01.440 Delta: 0.0ms queue: 1 2022-06-20 12:28:15.252456 I #1 PTS:00:00:01.424 Delta: 16ms queue: 2 2022-06-20 12:28:17.052018 I Del map found 0 at 19160 (19160) 2022-06-20 12:28:17.061823 I Mux rate: 9.17 Mbit/s 2022-06-20 12:28:17.235307 I Del map found 1 at 20284 (20284) 2022-06-20 12:28:18.295008 D PortChecker::checkPort(): host 192.168.1.254 port 49468 timeLimit 5000 linkLocalOnly 0 2022-06-20 12:28:18.795521 D PortChecker::checkPort(): socket state 2 2022-06-20 12:28:19.295770 D PortChecker::checkPort(): socket state 3 2022-06-20 12:28:23.495849 I Generating Keyframe Index 2022-06-20 12:28:23.495870 I Opening /home/john/SGs/RecsSG4/20009_20220616222300.ts.tmp 2022-06-20 12:28:23.528846 I Input #0, mpeg, from '/home/john/SGs/RecsSG4/20009_20220616222300.ts.tmp': 2022-06-20 12:28:23.528863 I Duration: 00:00:45.00, start: 0.376000, bitrate: 2706 kb/s 2022-06-20 12:28:23.528915 I Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first), 704x576 [SAR 16:11 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc 2022-06-20 12:28:23.528922 I Side data: 2022-06-20 12:28:23.528932 I cpb: bitrate max/min/avg: 1507600/0/0 buffer size: 1835008 vbv_delay: N/A 2022-06-20 12:28:23.528967 I Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16p, 256 kb/s 2022-06-20 12:28:23.655437 N Transcode Completed 2022-06-20 12:28:23.856024 N Transcoding /home/john/SGs/RecsSG4/20009_20220616222300.ts done 2022-06-20 12:28:23.856046 D PowerDBus: Releasing delay FD: 19 2022-06-20 12:28:23.856067 I PowerDBus: Closing interfaces 2022-06-20 12:28:24.360894 I Exiting [john@HPFed ~]$ ionice -c3 mythcommflag -q --rebuild --file 20009_20220616222300.ts MythTV Commercial Flagger, building seek table for: The Sky at Night - Martin Rees is perhaps Britain's most renowned cosmologist Rebuild started at Mon Jun 20 12:53:14 2022 Rebuild completed at Mon Jun 20 12:53:31 2022

linuxdude42 commented 2 years ago

How are you checking the seektable of the original file?

Jpilk commented 2 years ago

Play it in Myth and enter the editor (e). Define cutpoints, save and exit. Run mythtranscode as above,. Play and reenter the editor. It's different - or was for me.

Running the 'mythcommflag --rebuild' (while in a non-playback-mode screen) restored things.

rcrdnalor commented 2 years ago

Please define the term " 2-stream postprocessed recording. " What kind of "post-processing" was applied to the recording ?

Jpilk commented 2 years ago

Demux with ProjectX, remux to TS, overwrite, update DB. I do it with almost all my recordings. It has only 2 streams and doesn't give all the warnings that the unprocessed recordings do.

Re your earlier query. I ran mytharchive native mode before and after the mythtranscode, now at 33.Pre.459.g8f99b9a786 The .ts.xml file before is 416 KiB, after is 7.5 KiB. The Editor finds EoF at 44.88s but playback goes on, and the --rebuild restores the full length.

I can't get GitHub preview to show contrasting snippets; this is 'after'

<channel callsign="BBC FOUR" chanid="20009" name="BBC FOUR" channum="9"/>
<recordedmarkup>
    <mark data="0" type="-3" mark="0"/>
    <mark data="0" type="0" mark="19159"/>
    <mark data="0" type="1" mark="20283"/>
    <mark data="0" type="12" mark="0"/>
    <mark data="704" type="30" mark="0"/>
    <mark data="576" type="31" mark="0"/>
    <mark data="25000" type="32" mark="0"/>
    <mark data="3548160" type="33" mark="0"/>
    <mark data="88704" type="34" mark="0"/>
</recordedmarkup>
<recordedseek>
    <mark type="9" offset="14" mark="0"/>
    <mark type="9" offset="194574" mark="22"/>
    <mark type="9" offset="346126" mark="44"/>
    <mark type="9" offset="798734" mark="69"/>
    <mark type="9" offset="1247246" mark="94"/>
    <mark type="9" offset="1669134" mark="118"/>
    <mark type="9" offset="2091022" mark="142"/>
    <mark type="9" offset="2609166" mark="171"/>
    <mark type="9" offset="3346446" mark="196"/>
    <mark type="9" offset="4057102" mark="220"/>
    <mark type="9" offset="4763662" mark="244"/>
    <mark type="9" offset="5412878" mark="268"/>
    <mark type="9" offset="6148110" mark="291"/>
    <mark type="9" offset="6371342" mark="316"/>
linuxdude42 commented 2 years ago

After your earlier comment about transcode working with the --honorcutlist argument but failing without, I added a cutlist to a recording for testing with/without that argument. I have transcoded that recording several times now, both with/without the --honorcutlist argument and with both fixes-32/master, and when I go back into the editor the cutpoints are still where I originally placed them.

Jpilk commented 2 years ago

The output from a similarly simplified input file looks fine now, and here shows some frame-type conversion, which may be a good thing. The seektable of the original is still changed, and with this file the second switchpoint did not survive. After rebuild the editor showed keyframes at 202 and 2329; the Del map values below are 1 frame higher.

[john@HP_Box ~]$ mythtranscode --chanid 11156 --starttime 20220610125600 --honorcutlist --mpeg2 --loglevel debug 2022-06-20 23:45:22.156824 C mythtranscode version: HEAD [v33-Pre-8f99b9a786] www.mythtv.org

2022-06-20 23:45:23.817831 I Honoring the cutlist while transcoding 2022-06-20 23:45:23.826000 I Opening /home/john/SGs/RcSG2/11156_20220610125600.ts 2022-06-20 23:45:23.832890 I Input #0, mpegts, from '/home/john/SGs/RcSG2/11156_20220610125600.ts': 2022-06-20 23:45:23.832905 I Duration: 00:02:06.24, start: 1.400000, bitrate: 3027 kb/s 2022-06-20 23:45:23.832957 I Stream #0:0[0x100]: Video: mpeg2video (Main), yuv420p(tv, top first), 704x576 [SAR 16:11 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc 2022-06-20 23:45:23.832961 I Side data: 2022-06-20 23:45:23.832969 I cpb: bitrate max/min/avg: 4658000/0/0 buffer size: 1835008 vbv_delay: N/A 2022-06-20 23:45:23.832993 I Stream #0:1[0x101]: Audio: mp2, 48000 Hz, stereo, fltp, 256 kb/s 2022-06-20 23:45:23.833519 I #0 PTS:00:00:01.440 Delta: 0.0ms queue: 1 2022-06-20 23:45:23.833531 I #1 PTS:00:00:01.424 Delta: 16ms queue: 2 2022-06-20 23:45:23.844695 I Del map found 0 at 203 (203) 2022-06-20 23:45:23.853941 I Converting frame #1 from B to I 2022-06-20 23:45:23.858890 I Converting frame #2 from B to I 2022-06-20 23:45:23.864142 I Converting frame #3 from P to I 2022-06-20 23:45:23.873119 I Mux rate: 4.99 Mbit/s 2022-06-20 23:45:24.132735 I Del map found 1 at 2330 (2330) 2022-06-20 23:45:24.431279 I Generating Keyframe Index 2022-06-20 23:45:24.431291 I Opening /home/john/SGs/RcSG2/11156_20220610125600.ts.tmp 2022-06-20 23:45:24.434443 I Input #0, mpeg, from '/home/john/SGs/RcSG2/11156_20220610125600.ts.tmp': 2022-06-20 23:45:24.434461 I Duration: 00:01:25.12, start: 0.376000, bitrate: 2999 kb/s 2022-06-20 23:45:24.434539 I Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first), 704x576 [SAR 16:11 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc 2022-06-20 23:45:24.434545 I Side data: 2022-06-20 23:45:24.434557 I cpb: bitrate max/min/avg: 2624000/0/0 buffer size: 1835008 vbv_delay: N/A 2022-06-20 23:45:24.434588 I Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16p, 256 kb/s 2022-06-20 23:45:24.512289 N Transcode Completed

Jpilk commented 2 years ago

My tests above showed that the current version worked with a 2-stream input and a single segment. I've now tried it on a raw recording and a cutlist with multiple segmants separated by ads. It worked well and quickly and the cuts (at keyframes) are smooth and in the right places.

After doing this I restored the seektable, checked the cutpoints, and ran my usual script - which also tells me where the cuts are. That workedd too - although the following mythcommflag --rebuild was, as sometimes happens, slow; around 600 fps rather than ~3000.

TTBOMK the stream count in the input didn't change. SkyArts on DVB-T is a low-resolution channel without interactive-tv, but it looks to me as if the problem may be fixed.

[john@HPFed ~]$ mythtranscode --chanid 20011 --starttime 20220621130800 --honorcutlist --mpeg2 --loglevel debug 2022-06-21 15:24:34.362126 C mythtranscode version: HEAD [v33-Pre-02247cfba9] www.mythtv.org 2022-06-21 15:24:34.362132 C Qt version: compile: 5.15.2, runtime: 5.15.2 2022-06-21 15:24:34.362158 I Fedora Linux 35 (Thirty Five) (x86_64)

2022-06-21 15:24:37.770552 D Setting 'Lossless transcoding' changed to 0 2022-06-21 15:24:37.770569 D Setting 'Resize video while transcoding' changed to 0 2022-06-21 15:24:37.770579 N Transcoding from /home/john/SGs/RecsSG1/20011_20220621130800.ts to /home/john/SGs/RecsSG1/20011_20220621130800.ts.tmp 2022-06-21 15:24:37.770586 I Honoring the cutlist while transcoding 2022-06-21 15:24:37.772235 I Opening /home/john/SGs/RecsSG1/20011_20220621130800.ts 2022-06-21 15:24:37.783338 I start time for stream 2 is not set in estimate_timings_from_pts 2022-06-21 15:24:37.783735 I PES packet size mismatch 2022-06-21 15:24:37.783745 I Packet corrupt (stream = 1, dts = 125476395). 2022-06-21 15:24:37.784147 I stream 2 : no TS found at start of file, duration not set 2022-06-21 15:24:37.784185 I Could not find codec parameters for stream 2 (Audio: mp3 (mp3float), 0 channels, fltp): unspecified frame size Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options 2022-06-21 15:24:37.784407 I Input #0, mpegts, from '/home/john/SGs/RecsSG1/20011_20220621130800.ts': 2022-06-21 15:24:37.784418 I Duration: 00:52:36.94, start: 93681.707856, bitrate: 1293 kb/s 2022-06-21 15:24:37.784463 I Stream #0:0[0xaa1]: Video: mpeg2video (Main), yuv420p(tv, progressive), 544x576 [SAR 32:17 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc 2022-06-21 15:24:37.784468 I Side data: 2022-06-21 15:24:37.784476 I cpb: bitrate max/min/avg: 15000000/0/0 buffer size: 1835008 vbv_delay: N/A 2022-06-21 15:24:37.784501 I Stream #0:10xaa2: Audio: mp2, 48000 Hz, stereo, fltp, 128 kb/s 2022-06-21 15:24:37.784584 I Stream #0:20xaa4: Audio: mp3, 0 channels, fltp 2022-06-21 15:24:37.784609 I Stream #0:30xaa3: Subtitle: dvb_subtitle 2022-06-21 15:24:37.784617 E Skipping audio stream: 2 2022-06-21 15:24:37.784622 E Skipping unsupported codec 3 on stream 3 2022-06-21 15:24:37.785893 I #0 PTS:26:01:22.647 Delta: 0.0ms queue: 26 2022-06-21 15:24:37.785902 I #1 PTS:26:01:22.643 Delta: 3.38889ms queue: 2 2022-06-21 15:24:38.115764 I Del map found 0 at 6883 (6883) 2022-06-21 15:24:38.121096 I Mux rate: 15.38 Mbit/s 2022-06-21 15:24:40.705591 I Del map found 1 at 30179 (30179) 2022-06-21 15:24:40.960772 I Del map found 0 at 35342 (35342) 2022-06-21 15:24:43.979708 I Del map found 1 at 51058 (51058) 2022-06-21 15:24:45.538471 I Del map found 0 at 56177 (56177) 2022-06-21 15:24:47.660645 I Del map found 1 at 75458 (75458) 2022-06-21 15:24:47.844139 I PES packet size mismatch 2022-06-21 15:24:47.844155 I Packet corrupt (stream = 1, dts = 125476395). 2022-06-21 15:24:47.874943 I Generating Keyframe Index 2022-06-21 15:24:47.874952 I Opening /home/john/SGs/RecsSG1/20011_20220621130800.ts.tmp 2022-06-21 15:24:47.877415 I Input #0, mpeg, from '/home/john/SGs/RecsSG1/20011_20220621130800.ts.tmp': 2022-06-21 15:24:47.877427 I Duration: 00:38:51.84, start: 0.283389, bitrate: 1184 kb/s 2022-06-21 15:24:47.877470 I Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, progressive), 544x576 [SAR 32:17 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc 2022-06-21 15:24:47.877475 I Side data: 2022-06-21 15:24:47.877483 I cpb: bitrate max/min/avg: 15000000/0/0 buffer size: 1835008 vbv_delay: N/A 2022-06-21 15:24:47.877509 I Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16p, 128 kb/s 2022-06-21 15:24:48.738468 D PortChecker::checkPort(): host 192.168.1.67 port 9000 timeLimit 5000 linkLocalOnly 0 2022-06-21 15:24:48.960392 N Transcode Completed 2022-06-21 15:24:49.127406 N Transcoding /home/john/SGs/RecsSG1/20011_20220621130800.ts done 2022-06-21 15:24:49.127429 D PowerDBus: Releasing delay FD: 17 2022-06-21 15:24:49.127448 I PowerDBus: Closing interfaces 2022-06-21 15:24:49.238963 D PortChecker::checkPort(): socket state 2 2022-06-21 15:24:49.739267 D PortChecker::checkPort(): socket state 3 2022-06-21 15:24:49.742934 I Exiting [john@HPFed ~]$

Jpilk commented 2 years ago

It works in 'buntu too.

john@6710b:~$ mythtranscode --chanid 1001 --starttime 20171122165400 --mpeg2 --honorcutlist --loglevel debug 2022-06-22 11:08:34.918673 C mythtranscode version: master [v33.0~master.202206220411.02247cfba9~ubuntu20.04.1] www.mythtv.org 2022-06-22 11:08:34.918754 C Qt version: compile: 5.12.8, runtime: 5.12.8 2022-06-22 11:08:34.963676 I Ubuntu 20.04.4 LTS (x86_64)

Then I tried the same options with h264, to see what happened...

2022-06-22 10:47:55.425396 W Warning: partial frame found! 2022-06-22 10:47:55.425517 W Warning: partial frame found! 2022-06-22 10:47:55.425620 W Warning: partial frame found! 2022-06-22 10:47:55.425792 W Warning: partial frame found! 2022-06-22 10:47:55.425816 E Found end of file without finding any frames 2022-06-22 10:47:55.426071 E Transcoding /home/john/SGs/RecsSG1/1204_20180329093100.ts failed

kmdewaal commented 2 years ago

I think that transcoding h264 has never worked. I suggest to create a separate issue for that and to close this one as transcoding mpeg2 appears to be fixed, also for me.

Jpilk commented 2 years ago

Perhaps I should clarify. I tried ' --honorcutlist --mpeg2 ' on an h264-encoded recording, expecting it to fail but having no idea how that would be made apparent. No disaster seen.