<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<meta name="Generator" content="Kopano WebApp v-5.0.0.223+1986.1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>RE: [mythtv-users] Transcode script that keeps show in Recordings</title>
</head>
<body>
<blockquote style="border-left-width: 2px; border-left-style: solid; border-left-color: #325fba; padding-left: 5px; margin: 0px 5px 1em;"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 10pt;">-----Original message-----<br /><span><strong>From:</strong> John Pilkington <johnpilk222@gmail.com></span><br /><span><strong>Sent:</strong> Friday 9th June 2023 9:34</span><br /><span><strong>To:</strong> mythtv-users@mythtv.org</span><br /><span><strong>Subject:</strong> Re: [mythtv-users] Transcode script that keeps show in Recordings</span><br /><br /></span>
<div>
<pre style="white-space: pre-wrap; word-wrap: break-word;">On 09/06/2023 08:00, Lists wrote:<br />> -----Original message-----<br />> *From:* Jay Harbeston <jharbestonus@gmail.com><br />> *Sent:* Thursday 8th June 2023 15:58<br />> *To:* Discussion about MythTV <mythtv-users@mythtv.org><br />> *Subject:* Re: [mythtv-users] Transcode script that keeps show in<br />> Recordings<br />> <br />> <br />> <br />> Can you do the following command on the file that has the<br />> audio go away? :<br />> <br />> ffprobe -i file.ts<br />> <br />> <br />> And post the results in a reply. I want to see how the audio<br />> streams get defined by ffmpeg.<br />> <br />> Jay<br />> <br />> <br />> Sadly I don't have any of those files available now, but when I<br />> was checking them the other day, there was no audio track<br />> reported by mediainfo or vlc player. When I was watching the<br />> encoding, I could see that audio was reported as zero bytes<br />> <br />> <br />> There may be a copy of the original file saved as file.ts.orig in<br />> your recordings directory if you didn't add the the dontremove flag<br />> on the ffcut command .<br />> <br />> Jay<br />> <br />> <br />> I'm just transcoding another file with your ffmpeg commands - this is <br />> the ff0.log contents:<br />> <br />> *dave@mythtv*:*/tmp/myth297314*$ tail -f ff0.log<br />> <br />> Stream #0:1[0x1100]: Audio: ac3 ([129][0][0][0] / 0x0081), 0 <br />> channels, fltp<br />> <br />> Output #0, mpegts, to '/tmp/myth297314/tmpfile0.ts':<br />> <br />> Metadata:<br />> <br />> encoder : Lavf59.27.100<br />> <br />> Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, <br />> bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 24 fps, 24 <br />> tbr, 90k tbn<br />> <br />> Stream mapping:<br />> <br />> Stream #0:0 -> #0:0 (copy)<br />> <br />> Press [q] to stop, [?] for help<br />> <br />> frame=130215 fps=5553 q=-1.0 Lsize= 5446811kB time=01:30:25.95 <br />> bitrate=8223.5kbits/s speed= 231x<br />> <br />> video:5298670kB audio:0kB subtitle:0kB other streams:0kB global <br />> headers:0kB muxing overhead: 2.795805%<br />> <br />> <br />> ffprobe on the original file for the above transcode looks like this:<br />> <br />> *dave@mythtv*:*/tmp/myth297314*$ ffprobe <br />> /media/myth/tv/81003_20230529172000.ts<br />> <br />> ffprobe version 5.1.2-3ubuntu1 Copyright (c) 2007-2022 the FFmpeg developers<br />> <br />> built with gcc 12 (Ubuntu 12.2.0-14ubuntu2)<br />> <br />> (Configuration details removed to reduce size of email message)<br />> <br />> <br />> [mpegts @ 0x55a29ff90bc0] start time for stream 1 is not set in <br />> estimate_timings_from_pts<br />> <br />> [mpegts @ 0x55a29ff90bc0] stream 1 : no TS found at start of file, <br />> duration not set<br />> <br />> [mpegts @ 0x55a29ff90bc0] Could not find codec parameters for stream 1 <br />> (Audio: ac3 ([129][0][0][0] / 0x0081), 0 channels, fltp): unspecified <br />> sample rate<br />> <br />> Consider increasing the value for the 'analyzeduration' (0) and <br />> 'probesize' (5000000) options<br />> <br />> Input #0, mpegts, from '/media/myth/tv/81003_20230529172000.ts':<br />> <br />> Duration: 01:42:11.58, start: 3.014378, bitrate: 8717 kb/s<br />> <br />> Program 1<br />> <br />> Stream #0:0[0x1011]: Video: h264 (High) ([27][0][0][0] / 0x001B), <br />> yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 24 fps, <br />> 24 tbr, 90k tbn<br />> <br />> Stream #0:1[0x1100]: Audio: ac3 ([129][0][0][0] / 0x0081), 0 <br />> channels, fltp<br />> <br />> <br />> And this is the ffprobe for the transcoded file:<br />> <br />> *dave@mythtv*:*/tmp/myth297314*$ ffprobe tmpfile0.ts<br />> <br />> ffprobe version 5.1.2-3ubuntu1 Copyright (c) 2007-2022 the FFmpeg developers<br />> <br />> built with gcc 12 (Ubuntu 12.2.0-14ubuntu2)<br />> <br />> <br />> <br />> Input #0, mpegts, from 'tmpfile0.ts':<br />> <br />> Duration: 01:30:25.67, start: 1.817000, bitrate: 8223 kb/s<br />> <br />> Program 1<br />> <br />> Metadata:<br />> <br />> service_name : Service01<br />> <br />> service_provider: FFmpeg<br />> <br />> Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), <br />> yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 24 fps, <br />> 24 tbr, 90k tbn<br />> <br />> <br />> <br />> <br />> Regards,<br />> <br />> Dave.<br /><br />I get that 'deja vu all over again' feeling. Perhaps try<br /><br />mythffmpeg -fflags +genpts -i inputfile -acodec copy -vcodec copy <br />-scodec copy -f mpegts outputfile<br /><br />and rebuild the seektable. Then run the script again.<br /><br />https://github.com/bennettpeter/android-MythTV-Leanfront/issues/54#issuecomment-1368201782<br /><br />https://github.com/MythTV/mythtv/issues/600<br /><br />HTH<br /><br />John P<br />_______________________________________________<br />mythtv-users mailing list<br />mythtv-users@mythtv.org<br />http://lists.mythtv.org/mailman/listinfo/mythtv-users<br />http://wiki.mythtv.org/Mailing_List_etiquette<br />MythTV Forums: https://forum.mythtv.org</pre>
</div>
</blockquote>
<p style="padding: 0; margin: 0;"><span style="font-size: 11pt; font-family: arial, helvetica, sans-serif;">Thanks John,</span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 11pt; font-family: arial, helvetica, sans-serif;"><br /></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 11pt; font-family: arial, helvetica, sans-serif;">Your mythffmpeg command line seems to do the trick - I can now cut the adverts form my recordings and rebuild the seektable after the transcode.</span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 11pt; font-family: arial, helvetica, sans-serif;"><br /></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 11pt; font-family: arial, helvetica, sans-serif;">I've been modifying Jay Harbeston's </span>ffcut.sh script, since when I first tried it, it didn't work at all with my h264 recordings - I also had to modify his sql commands, since they didn't work for me (as the user I ran the script as, in testing, does not have a mysql account), then I had to modify the ffmpeg commands for h264. My final task, since someone suggested that it isn't a good idea to directly modify the sql database from these scripts will be to use mythutil and mythcommflag in place of the sql commands.</p>
<p style="padding: 0; margin: 0;"><span style="font-size: 11pt; font-family: arial, helvetica, sans-serif;"><br /></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 11pt; font-family: arial, helvetica, sans-serif;">I'll be happy to share my version of the script, so long as Jay has no objections (I'll make sure I'll credit him in the script for the 99% of the work he did)</span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 11pt; font-family: arial, helvetica, sans-serif;"><br /></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 11pt; font-family: arial, helvetica, sans-serif;">Regards,</span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 11pt; font-family: arial, helvetica, sans-serif;">Dave.</span></p>
</body>
</html>