tags 507054 confirmed upstream
thanks

Petter Reinholdtsen wrote...

> I've recently processed a lot of video files, and one of the source
> formats is *.m2t.  File failed to recognize it, so I had a hard time
> figuring it out, but it seem to be a mpeg transport format commonly
> used by HDV-cameras.
> 
> This is how one such file is described by ffmpeg:
> 
>   Input #0, mpegts, from 'tor_21042005_start.m2t':
>     Duration: 00:01:14.72, start: 2.840000, bitrate: 26045 kb/s
>     Program 100
>       Stream #0.0[0x810]: Video: mpeg2video, yuv420p, 1440x1080 [PAR 4:3 DAR 
> 16:9], 25000 kb/s, 25.00 tb(r)
>       Stream #0.1[0x814]: Audio: mp2, 48000 Hz, stereo, 384 kb/s

> Running 'file tor_21042005_start.m2t' just return 'data' as the
> format for the same file.

This took a while. Video formats are a nightmare, luckily somebody told me
about tsinfo (in the tstools package).

So, the bad news: That video has a bit unusual beginning, file(1) has
an old pattern that assumes the first mpeg transport stream packet
contains the Program Association Table (PAT), your example does not.
Chopping off the packets before the PAT yields:

$ dd if=20050421-tor-start.m2t bs=188 skip=147 | file -
/dev/stdin: MPEG transport stream data

Better than 'data'. While I could relax that check a little (and I
will do that anyway), file(1) should also print the stream information
in a way tsinfo and ffmpeg to. That requires techniques to walk along
the packets to identify the required PATs and also Program Map Tables
(PMTs). I don't see how this could be done in file(1) at the moment,
but a future version might change that since there are other file
formats that need an "iterator" for improved identification, too.
Don't hold your breath, though.

    Christoph

Attachment: signature.asc
Description: Digital signature

Reply via email to