[mythtv-users] How to raise priority of ticket 13459?

Stephen Worthington stephen_agent at jsw.gen.nz
Tue Nov 12 01:29:42 UTC 2019


On Tue, 12 Nov 2019 07:42:33 +0800, you wrote:

>
>
>> On 11 Nov 2019, at 8:00 pm, mythtv-users-request at mythtv.org wrote:
>> 
>> And going to a .mkv file extension is not a good idea, as there is a
>> fair bit of code in and around MythTV that assumes that all recording
>> files are going to be .nuv, .mpg or .ts file extensions.  It does not
>> matter if the contents of the file are different from what is implied
>> by the extension, but only those three extensions are supported for
>> recording files.
>
>
>Does this imply that there is a way to specify the output container? My samsung tv chokes on .ts and if I ever want something for the tv I need to transcode.

Just change the name of the file to something the TV will accept and
see what happens.

The recordings that mythbackend makes from digital TV sources (DVB-T,
DVB-S, ATSC, ...) are MPEG2 transport stream containers, with the
streams inside simply copies of the streams that were broadcast.  For
a long time, the recording files were stored with a .mpg extension,
which normally is for MPEG2 program stream files, not MPEG2 transport
stream files.  When mythbackend finally fixed this by changing to
using a .ts extension, the content of the files was not changed at
all.

The difference between transport streams and program streams are not
huge, but TVs are strange in what they do and do not accept.  It is
possible to convert a transport stream file to a program stream file
without transcoding the streams inside the file.

The word "transcoding" gets misused a fair bit.  It actually means
running the data in the streams inside a multimedia file through a new
codec and re-encoding the data using that codec.  The input stream is
run through a decoder (from the old codec) to decompress it and
produce the full data for each frame, using the codec for that stream.
Then the full frame data is sent to the output codec's encoder for
compression using that codec.  Uncompressing the input stream does not
lose any of the data in the input stream, but when the output codec is
the "lossy" type, the compression through that loses data that is
present in the input data to that codec.  So the output from a lossy
codec is *always* lower quality than its input.  So every time a
stream is transcoded using a lossy codec, it gets degraded.  Hence it
is never a good idea to transcode anything using a lossy codec if it
can be avoided.  The best idea to retain as much quality as possible
is to only ever use one lossy codec on a multimedia stream.  So if you
want H.265 encoding of a video that you already have an H.264 version
of, you go back to the original (hopefully uncompressed) master
recording and compress that with H.265.  If you use the H.264 version
as the source, the H.265 output from that will be worse than the H.264
version, despite H.265 being a better codec.

There are other things you can do to multimedia files that are not
"transcoding".  Video files come in many different container formats,
such as AVI, MPEG1, MPEG2 program stream, MPEG2 transport stream, MP4,
MKV.  Each of these container formats has different ways of storing
the streams inside, and each container format only supports certain
types of streams.  For example, the MPEG1 format can not contain any
video streams other than the MPEG1 video stream format (and note that
the same name "MPEG1" is used for the container format and the video
stream format, but they are two completely different things).  Later
container formats tend to support more stream formats, and MKV
containers can support virtually any stream format.  You can convert
the container format of a multimedia file without having to transcode
the streams inside it.  This can involve changing the stream data to
match the new container format, but it does not involve "transcoding"
where the data is run through a decoder and encoder.  It just involves
the changing format the data is presented in, not its content.  People
tend to still call this conversion process "transcoding", when it does
not actually involve transcoding at all.

For your particular problem with your TV, the first thing to do is to
just change the .ts file extension and see if that is all the TV is
having a problem with.  It often is.  If the TV can still not play the
files, then try converting from an MPEG2 transport stream to an MPEG2
program stream.  Only if that does not work try actual transcoding.
Most TVs will list what they accept somewhere in their manual. Working
out exactly what is meant by the usually sparse information provided
can take a fair bit of detective work though.  Often TVs say something
like "AVCHD", for example, which means that the TV will accept MPEG2
transport streams, but with certain constraints so that only a subset
of all MPEG2 transport stream files that match the AVCHD constraints
will be playable.  And they are usually very picky about the file
extensions they will accept and will not play a file with what they
consider to be the "wrong" extension even if it is actually a format
they can play.  This is quite unlike software video players like VLC
and MythTV, where the content of the file is all that matters and the
file extension is usually completely ignored.


More information about the mythtv-users mailing list