Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lossless transcode in GUI aborts in 35/fixes #1063

Open
white-haired-uncle opened this issue Mar 15, 2025 · 7 comments
Open

Lossless transcode in GUI aborts in 35/fixes #1063

white-haired-uncle opened this issue Mar 15, 2025 · 7 comments

Comments

@white-haired-uncle
Copy link

  • Platform:
    Linux mythbackend 6.5.0-35-generic #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 7 09:00:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

  • MythTV version:

v35.0-12-g30ba688773

  • Package version:

  • Component:

What steps will reproduce the bug?

Attempt to transcode a file using lossless option.

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

Every time so far.

What is the expected behaviour?

Worked fine in v35-Pre-331-g41b921c949

What do you see instead?

Mar 15 15:36:56 mythbackend mythtranscode: mythtranscode[4422]: N CoreContext mythtranscode.cpp:557 (main) Transcoding from /mythdata/recorded1/26606_20250315154300.ts to /mythdata/recorded1/26606_20250315154300.ts.tmp
Mar 15 15:36:56 mythbackend mythtranscode: mythtranscode[4422]: E CoreContext transcode.cpp:174 (TranscodeFile) AVFormat mode not set.
Mar 15 15:36:56 mythbackend mythtranscode: mythtranscode[4422]: E CoreContext mythtranscode.cpp:735 (main) Transcoding /mythdata/recorded1/26606_20250315154300.ts failed
Mar 15 15:36:56 mythbackend mythtranscode: mythtranscode[4422]: N CoreContext mythtranscode.cpp:1106 (CompleteJob) Deleting /mythdata/recorded1/26606_20250315154300.ts.tmp

Additional information

Based on the comments, a glance at the removed code, and the fact that I have to --enable-libmp3lame for lossless transcode support, I'd suspect 5e83f17.

Removing Nupple would be a bit annoying since I still have old recordings, but I think editing nuv has been broken for some time anyway. Breaking lossless transcode is huge -- one of the best features of myth is the ability to cut commercials/credits/etc.

@white-haired-uncle
Copy link
Author

white-haired-uncle commented Mar 15, 2025

3789c9c works correctly, and 5e83f17 fails

MythTV Version : v35-Pre-753-g5e83f178e1
MythTV Branch : (HEAD detached at 5e83f178e1)
Network Protocol : 91
Library API : 35.20220913-1
QT Version : 5.15.3
Options compiled in:
 linux profile use_hidesyms using_alsa using_oss using_pulse using_pulseoutput using_backend using_bindings_perl using_bindings_python using_bindings_php using_dvb using_firewire using_frontend using_hdhomerun using_satip using_vbox using_ceton using_joystick_menu using_libcrypto using_gnutls using_libdns_sd using_libxml2 using_lirc using_mheg using_opengl using_egl using_qtwebkit using_qtscript using_qtdbus using_taglib using_v4l2 using_v4l2prime using_x11 using_system_libbluray using_system_libudfread using_systemd_notify using_systemd_journal using_drm using_bindings_perl using_bindings_python using_bindings_php using_freetype2 using_mythtranscode using_opengl using_egl using_drm using_vaapi using_nvdec using_vdpau using_ffmpeg_threads using_mheg using_libass using_libxml2 using_libmp3lame

@rcrdnalor
Copy link
Contributor

How do you invoke lossless transcode?
Neither nupple video support nor mp3 is needed to do a lossless transcode.
I assume your input videos are based on "mpeg2video" and "mp2" streams.

@white-haired-uncle
Copy link
Author

How do you invoke lossless transcode?

Normally I use the FE GUI to launch my "Lossless" transcode profile after watching/editing a recording I want to keep. Long ago there was a GUI option to set lossless in the profile which was later removed, but the flag is still in the db and it still works(/worked).

You can also use the -m option to mythtranscode.

Neither nupple video support nor mp3 is needed to do a lossless transcode.

This is from my build notes. I don't know how old is it. I kind of remember it to be (or have been) true.

mythbackend$ ./configure --enable-libmp3lame # Needed for lossless transcode

And while I haven't looked very closely at it, this sure seems to imply that MP3 is required for lossless:

5e83f17#diff-b464b8c19c5242ae85ba9c392c29c1db41fba89f4343582cb1758326245f37b6L628-L632

        if (get_bool_option(m_recProfile, "transcodelossless"))
        {
            vidsetting = encodingType;
            audsetting = "MP3";
        }

I assume your input videos are based on "mpeg2video" and "mp2" streams.

Almost all of them should be mpeg2video, save the old nupples.

mythbackend$ ffprobe -hide_banner /export/video/24407_20250316170000.ts 
[mpegts @ 0x625edae91280] PES packet size mismatch
[mpegts @ 0x625edae91280] Packet corrupt (stream = 1, dts = 959996561).
Input #0, mpegts, from '/export/video/24407_20250316170000.ts':
  Duration: 00:59:57.97, start: 7069.348456, bitrate: 1978 kb/s
  Program 1 
  Stream #0:0[0x91]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 704x480 [SAR 40:33 DAR 16:9], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Side data:
      cpb: bitrate max/min/avg: 5853600/0/0 buffer size: 1835008 vbv_delay: N/A
  Stream #0:1[0x94](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s

@rcrdnalor
Copy link
Contributor

rcrdnalor commented Mar 17, 2025

Yes, this is related to commit 5e83f17
Since I do not record mpeg2 videos based on the codec "mpeg2video", please check if the lossless transcode process itself works. Please post the output of the terminal

mythtranscode  --chanid 26606 --starttime 20250315154300 --honorcutlist --mpeg2 -o "video_cutted.mpg"

You may change the 'chanid' and 'starttime' options, but the recording needs valid cutpoints.

@white-haired-uncle
Copy link
Author

white-haired-uncle commented Mar 18, 2025

Interesting. On the test system I can successfully transcode even with 5e83f17.

I suspect the key difference between test and "production" is that on test I didn't --enable-libmp3lame. Let's see if that's the difference.... Hmm, no, at least not on the test system, it works with 5e83f17 and --enable-libmp3lame. That's disappointing. I wonder why prod fails. Ubuntu 22 vs 24, and launching mythtranscode via GUI vs CLI, and I suppose it could be something odd about the recording but I've never seen this particular error before. More testing..... Hmm, when I tested prod originally, did create a cutlist or just a quick recording?

P.S. A very small mpeg2video recording and the corresponding (otherwise empty) mythconverg:
https://mega.nz/folder/wis2GbCJ#OY2aJXHqTTI32QEYJJClAA

@rcrdnalor
Copy link
Contributor

Mythranscode for lossless conversion of mpeg2 files is invoked differently from the GUI and the command line.
The command line call should work for both versions you mentioned in the ticket.

Before 5e83f17 , the GUI only worked if you do the "transcodelossless" quirk and had
configured "--enable-libmp3lame" when building MythTV.
After 5e83f17 , the quirk for the GUI does not work anymore, no matter if "libmp3lame" is enabled or not.

I am interested in the terminal logs when you transcode a video, not the video itself.
Please post them.

Most users circumvent the lack of setting the hidden option "transcodelossless" in the 'mpeg2' profile by
defining a user job with

nice mythtranscode --jobid %JOBID% --mpeg2 --honorcutlist %VERBOSEMODE%

See the wiki User_Jobs for the parameter or Setup_General (search for "Transcoder command")
if you like to overrule the GUI version of transcode.

@white-haired-uncle
Copy link
Author

Okay, that's kind of weird, but a user job works. Thanks. On the bright side, now I can completely disable transcode jobs so that if I accidentally hit the wrong profile I don't trash a recording.

transcode1.txt

@white-haired-uncle white-haired-uncle changed the title Lossless transcode aborts in 35/fixes Lossless transcode in GUI aborts in 35/fixes Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants