Apple Video Foundation (AVF) and .mpg files

Pi Digital sean at
Tue Mar 26 18:45:51 EDT 2019


If you break up the file into hex blocks you will find a stat block code somewhere. This will help:

0x000001B5 is pretty unique to mpeg2. The 0x000001B3 start code can also be found in mpeg1 but is unlikely to contain the 01B5 code. 

SideNote: MP4 is completely different as it is not a packetised elementary stream (PES) as mpeg1/2 are. MPEG4 Part 14, as it is known, is a ‘Digital Media Container Format’ and can hold various stream types in one file or container, commonly a h264/h265 encoded video stream and an mp3 or AAC encoded audio stream (and other streams where required, like captions, etc) held in sync with each other. MP4 Part 12 is essentially the same as the old QuickTime format. 
I hope this helps. 

Sean Cole
Pi Digital Prod Ltd

> On 26 Mar 2019, at 21:38, Richard Gaskin via use-livecode <use-livecode at> wrote:
> Paul Dupuis wrote:
> > My specific interest is: Is there a way to tell a MPEG-1 file from an
> > MPEG-2 file with the same .mpg extension?
> >
> > For example, does someone know a technique or have code to read the
> > first X bytes of the file and determine encoding from that OR use some
> > shell wizardry to tell the encoding?
> IIRC both MPEG-1 and MPEG-2, and their variants (streaming vs non-streaming, etc.) use the same magic number. :(
> Depending on which components may be installed in each target platform, a shell call may be the better bet.
> If lower-level APIs are needed there's always LC Builder.
> -- 
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> ____________________________________________________________________
> Ambassador at      
> _______________________________________________
> use-livecode mailing list
> use-livecode at
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:

More information about the use-livecode mailing list