[mythtv-users] Transcode script that keeps show in Recordings

Lists lists at the-pearsons.co.uk
Fri Jun 9 12:56:21 UTC 2023


-----Original message-----
From: John Pilkington <johnpilk222 at gmail.com>
Sent: Friday 9th June 2023 9:34
To: mythtv-users at mythtv.org
Subject: Re: [mythtv-users] Transcode script that keeps show in Recordings


On 09/06/2023 08:00, Lists wrote:
>     -----Original message-----
>     *From:* Jay Harbeston <jharbestonus at gmail.com>
>     *Sent:* Thursday 8th June 2023 15:58
>     *To:* Discussion about MythTV <mythtv-users at mythtv.org>
>     *Subject:* Re: [mythtv-users] Transcode script that keeps show in
>     Recordings
>
>
>
>             Can you do the following command on the file that has the
>             audio go away? :
>
>             ffprobe -i  file.ts
>
>
>             And post the results in a reply. I want to see how the audio
>             streams get defined by ffmpeg.
>
>             Jay
>
>
>         Sadly I don't have any of those files available now, but when I
>         was checking them the other day, there was no audio track
>         reported by mediainfo or vlc player. When I was watching the
>         encoding, I could see that audio was reported as zero bytes
>
>
>     There may be a copy of the original file saved as  file.ts.orig in
>     your recordings directory  if you didn't add the the dontremove flag
>     on the ffcut command .
>
>     Jay
>
>
> I'm just transcoding another file with your ffmpeg commands - this is
> the ff0.log contents:
>
> *dave at mythtv*:*/tmp/myth297314*$ tail -f ff0.log
>
>    Stream #0:1[0x1100]: Audio: ac3 ([129][0][0][0] / 0x0081), 0
> channels, fltp
>
> Output #0, mpegts, to '/tmp/myth297314/tmpfile0.ts':
>
>    Metadata:
>
>      encoder         : Lavf59.27.100
>
>    Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv,
> bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 24 fps, 24
> tbr, 90k tbn
>
> Stream mapping:
>
>    Stream #0:0 -> #0:0 (copy)
>
> Press [q] to stop, [?] for help
>
> frame=130215 fps=5553 q=-1.0 Lsize= 5446811kB time=01:30:25.95
> bitrate=8223.5kbits/s speed= 231x
>
> video:5298670kB audio:0kB subtitle:0kB other streams:0kB global
> headers:0kB muxing overhead: 2.795805%
>
>
> ffprobe on the original file for the above transcode looks like this:
>
> *dave at mythtv*:*/tmp/myth297314*$ ffprobe
> /media/myth/tv/81003_20230529172000.ts
>
> ffprobe version 5.1.2-3ubuntu1 Copyright (c) 2007-2022 the FFmpeg developers
>
>    built with gcc 12 (Ubuntu 12.2.0-14ubuntu2)
>
>   (Configuration details removed to reduce size of email message)
>
>
> [mpegts @ 0x55a29ff90bc0] start time for stream 1 is not set in
> estimate_timings_from_pts
>
> [mpegts @ 0x55a29ff90bc0] stream 1 : no TS found at start of file,
> duration not set
>
> [mpegts @ 0x55a29ff90bc0] Could not find codec parameters for stream 1
> (Audio: ac3 ([129][0][0][0] / 0x0081), 0 channels, fltp): unspecified
> sample rate
>
> Consider increasing the value for the 'analyzeduration' (0) and
> 'probesize' (5000000) options
>
> Input #0, mpegts, from '/media/myth/tv/81003_20230529172000.ts':
>
>    Duration: 01:42:11.58, start: 3.014378, bitrate: 8717 kb/s
>
>    Program 1
>
>    Stream #0:0[0x1011]: Video: h264 (High) ([27][0][0][0] / 0x001B),
> yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 24 fps,
> 24 tbr, 90k tbn
>
>    Stream #0:1[0x1100]: Audio: ac3 ([129][0][0][0] / 0x0081), 0
> channels, fltp
>
>
> And this is the ffprobe for the transcoded file:
>
> *dave at mythtv*:*/tmp/myth297314*$ ffprobe tmpfile0.ts
>
> ffprobe version 5.1.2-3ubuntu1 Copyright (c) 2007-2022 the FFmpeg developers
>
>    built with gcc 12 (Ubuntu 12.2.0-14ubuntu2)
>
>
>
> Input #0, mpegts, from 'tmpfile0.ts':
>
>    Duration: 01:30:25.67, start: 1.817000, bitrate: 8223 kb/s
>
>    Program 1
>
>      Metadata:
>
>        service_name    : Service01
>
>        service_provider: FFmpeg
>
>    Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B),
> yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 24 fps,
> 24 tbr, 90k tbn
>
>
>
>
> Regards,
>
> Dave.

I get that 'deja vu all over again' feeling.  Perhaps try

mythffmpeg -fflags +genpts -i inputfile -acodec copy -vcodec copy
-scodec copy -f mpegts outputfile

and rebuild the seektable.  Then run the script again.

https://github.com/bennettpeter/android-MythTV-Leanfront/issues/54#issuecomment-1368201782

https://github.com/MythTV/mythtv/issues/600

HTH

John P
_______________________________________________
mythtv-users mailing list
mythtv-users at mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org

Thanks John,



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.



I've been modifying Jay Harbeston's 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.



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)



Regards,

Dave.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20230609/d66af203/attachment.htm>


More information about the mythtv-users mailing list