<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 3, 2021 at 10:35 AM Stephen Worthington <<a href="mailto:stephen_agent@jsw.gen.nz">stephen_agent@jsw.gen.nz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, 2 Feb 2021 16:02:15 -0800, you wrote:<br>
<br>
>I had been using the lossless_cut python scripts to cut commercials out of<br>
>my H264 recordings for some time with MythTV v30 under Ubuntu 16 from the<br>
>mythbuntu repos.<br>
><br>
>I recently upgraded to Ubuntu 18 and Mythtv v31, and I see that the<br>
>preference there is for python3. I see a couple of possible solution paths.<br>
><br>
>1. Adapt the scripts to use Python3 and the respective MythTV bindings.<br>
><br>
>2. Build the MythTV python bindings against python2 and get them installed<br>
>and used.<br>
><br>
>3. Install a packaged version of the bindings built against python2.<br>
><br>
>Has anyone taken any of these paths successfully?<br>
><br>
>I haven't found any other free (as in beer) toolsets that let me cut<br>
>commercials out and preserve the subtitle tracks. So Windows or Linux<br>
>recommendations there are also welcome.<br>
><br>
>Thank you all in advance.<br>
>-Ray<br>
<br>
The preference for Python 3 comes from MythTV v31, not from Ubuntu 18.<br>
It is apparently still possible to compile MythTV v31+ for Python 2<br>
but that option is unloved - it is not available in packages. Ubuntu<br>
18 has Python 2 as the system default if you have upgraded from an<br>
older Ubuntu. I am not sure what it installs as a default on a clean<br>
install, but I suspect that is also Python 2.<br>
<br>
Since Python 2 is on life support at best, there is no option about<br>
having to upgrade to Python 3 at some point. My recommendation would<br>
be to get it over with by doing it now. I have updated all my MythTV<br>
Python programs to Python 3 with my v31 upgrade and found it was not<br>
too difficult. But I was writing my Python 2 with Python 3 in mind<br>
(using the future library). What I found was that after running the<br>
2to3 conversion program and fixing the #! line, the things that were<br>
still needing fixing were all in the file I/O where you now need to<br>
explicitly choose whether you are reading the data as binary or as<br>
Unicode text. Frequently, all that needed doing was to just add a 'b'<br>
character in the open() call to make the I/O binary and that fixed all<br>
the other consequential problems. Note that I had already installed<br>
Python 3, so you will also need to do that first if it is not already<br>
installed. I have also since upgraded to 20.04 where Python 3 is the<br>
default.<br><br></blockquote><div><br></div><div>Maybe this forum post is of interest?</div><div><a href="https://forum.mythtv.org/viewtopic.php?f=36&t=2955&p=14235">https://forum.mythtv.org/viewtopic.php?f=36&t=2955&p=14235</a></div><div><br></div><div><br> </div></div></div>