Re: Apple Video Foundation (AVF) and .mpg files

2019-03-26 Thread Bryan Anderson via use-livecode
ffmpeg is your friend!

Here’s what you need…
https://www.ffmpeg.org/ffprobe.html  

ffprobe -show_format filename.mpg 
...will give you human readable output with lots of useful information 
including the codec used.

If you want to drill down further…
ffprobe -show_entries stream=format_name filename.mpg
… will give you a line that will look something like…
Stream #0:0: Video: mpeg1video, yuv420p(tv), 320x240 [SAR 1:1 DAR 4:3], 320 
kb/s, 29.97 fps, 29.97 tbr, 1200k tbn, 29.97 tbc


If the video file you want LiveCode to work with is not supported, you can use 
ffmpeg to convert it to something else with ffmpeg
https://www.ffmpeg.org/ffmpeg.html 

You can convert just about anything to anything else. It’s really powerful.
ffmpeg has a -progess switch that can be used to give a nice progress bar in 
LiveCode during conversion. 

Bryan
Exnihilo Media




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Apple Video Foundation (AVF) and .mpg files

2019-03-26 Thread JB via use-livecode
On OS X 10.11 you can use the shell command with afinfo

JB:desktop JB$ afinfo /Users/JB/Desktop/myFile.mp3
File:   /Users/JB/Desktop/myFile.mp3
File type ID:   MPG3
Num Tracks: 1

Data format: 2 ch,  44100 Hz, '.mp3' (0x) 0 bits/channel, 0 
bytes/packet, 1152 frames/packet, 0 byte
s/frame
no channel layout.
estimated duration: 244.166500 sec
audio bytes: 5859996
audio packets: 9347
bit rate: 192000 bits per second
packet size upper bound: 1052
maximum packet size: 627
audio data file offset: 39692
optimized
——

The above info was returned from a mp3 file using the terminal.

JB


> On Mar 26, 2019, at 1:32 PM, Paul Dupuis via use-livecode 
>  wrote:
> 
> Livecode 9.x.x uses Apple Video Foundation (AVF) for the LC Player object 
> under OSX.
> AVF supports MPEG-1 video but not MPEG-2 video.
> Both MPEG-1 and MPEG-2 use the .mpg file extenstion.
> 
> Question for any media geniuses on this list: Is there a way in LiveCode to 
> tell a MPEG-1 .mpg file from a MPEG-2.mpg file?
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Apple Video Foundation (AVF) and .mpg files

2019-03-26 Thread JB via use-livecode
If you use a shell with linux and maybe mac os since it is unix
and a lot of linux commands work you can try the solutions
on this site;

https://superuser.com/questions/595177/how-to-retrieve-video-file-information-from-command-line-under-linux

The above solutions will show you all kinds of info about the file 
including file type and data rate.

JB


> On Mar 26, 2019, at 1:32 PM, Paul Dupuis via use-livecode 
>  wrote:
> 
> Livecode 9.x.x uses Apple Video Foundation (AVF) for the LC Player object 
> under OSX.
> AVF supports MPEG-1 video but not MPEG-2 video.
> Both MPEG-1 and MPEG-2 use the .mpg file extenstion.
> 
> Question for any media geniuses on this list: Is there a way in LiveCode to 
> tell a MPEG-1 .mpg file from a MPEG-2.mpg file?
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


AW: Re: Apple Video Foundation (AVF) and .mpg files

2019-03-26 Thread Paul Dupuis via use-livecode

Thank you

On 3/26/2019 6:37 PM, Richmond via use-livecode wrote:
Looking at "Get Info" for the 2 movie files at the top of the page I 
referenced in my earlier message:


http://hubblesource.stsci.edu/sources/video/clips/details/images/centaur_1.mpg 



http://hubblesource.stsci.edu/sources/video/clips/details/images/centaur_2.mpg 



the two codecs are listed there.

So: the BIG question is where that sort of INFO is stored in a file 
and how LiveCode can access it and read it.


What is odd, in LiveCode 9.0.3 at least, is that if those 2 clips are 
imported into a stack neither the
Project Browser or the Application Overview will show a Property 
Inspector for either clip.


LiveCode 7.1.4 will open a proeprty inspector for both of these clips 
but offers no helpful information.


The $60,000 question has to be: can LiveCode read a file's metadata?

Richmonds-Mac-mini:~ richmond$ mdls 
/Users/richmond/Desktop/videoFormats/centaur_1.mpg

kMDItemCodecs  = (
    "MPEG-1 Video"
)

Richmonds-Mac-mini:~ richmond$ mdls 
/Users/richmond/Desktop/videoFormats/centaur_2.mpg

kMDItemCodecs  = (
    "MPEG-2 Video"
)

Richmond.

On 26.03.19 23:28, Paul Dupuis via use-livecode wrote:

Richmond,

I good suggestion. Thank you. However, looking at an identical video 
clip encoded as MPEG-1 and as MPEG-2 in a test editor shows lots of 
gibberish and no obvious text tags to tell the encoding.


Unfortunately, I don't have time to research byte level binary 
encoding differences between MPEG-1 and MPEG-2, which is why I was 
hoping some LiveCode media guru had already done this and would share.


It was a good idea to try though.



On 3/26/2019 5:17 PM, Richmond via use-livecode wrote:

I suppose if you open an .mpg file as a TEXT file it should
contain standard markers as to whether it is encoded as MPEG-1 or 
MPEG-2.


Useful samples here: http://hubblesource.stsci.edu/sources/video/clips/

Richmond.

On 26.03.19 22:32, Paul Dupuis via use-livecode wrote:
Livecode 9.x.x uses Apple Video Foundation (AVF) for the LC Player 
object under OSX.

AVF supports MPEG-1 video but not MPEG-2 video.
Both MPEG-1 and MPEG-2 use the .mpg file extenstion.

Question for any media geniuses on this list: Is there a way in 
LiveCode to tell a MPEG-1 .mpg file from a MPEG-2.mpg file?



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Apple Video Foundation (AVF) and .mpg files

2019-03-26 Thread Pi Digital via use-livecode
Hi

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

https://en.m.wikipedia.org/wiki/Elementary_stream

0x01B5 is pretty unique to mpeg2. The 0x01B3 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 
>  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
> 
> ambassa...@fourthworld.comhttp://www.FourthWorld.com
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Apple Video Foundation (AVF) and .mpg files

2019-03-26 Thread Richmond via use-livecode

This:

on mouseUp
   get the metadata of object ID 1003
   put it into fld "f1"
end mouseUp

and this:

on mouseUp
   get the metadata of videoClip "centaur_1.mpg"
   put it into fld "f1"
end mouseUp

don't work.

Richmond.

On 27.03.19 0:37, Richmond wrote:
Looking at "Get Info" for the 2 movie files at the top of the page I 
referenced in my earlier message:


http://hubblesource.stsci.edu/sources/video/clips/details/images/centaur_1.mpg

http://hubblesource.stsci.edu/sources/video/clips/details/images/centaur_2.mpg

the two codecs are listed there.

So: the BIG question is where that sort of INFO is stored in a file 
and how LiveCode can access it and read it.


What is odd, in LiveCode 9.0.3 at least, is that if those 2 clips are 
imported into a stack neither the
Project Browser or the Application Overview will show a Property 
Inspector for either clip.


LiveCode 7.1.4 will open a proeprty inspector for both of these clips 
but offers no helpful information.


The $60,000 question has to be: can LiveCode read a file's metadata?

Richmonds-Mac-mini:~ richmond$ mdls 
/Users/richmond/Desktop/videoFormats/centaur_1.mpg

kMDItemCodecs  = (
    "MPEG-1 Video"
)

Richmonds-Mac-mini:~ richmond$ mdls 
/Users/richmond/Desktop/videoFormats/centaur_2.mpg

kMDItemCodecs  = (
    "MPEG-2 Video"
)

Richmond.

On 26.03.19 23:28, Paul Dupuis via use-livecode wrote:

Richmond,

I good suggestion. Thank you. However, looking at an identical video 
clip encoded as MPEG-1 and as MPEG-2 in a test editor shows lots of 
gibberish and no obvious text tags to tell the encoding.


Unfortunately, I don't have time to research byte level binary 
encoding differences between MPEG-1 and MPEG-2, which is why I was 
hoping some LiveCode media guru had already done this and would share.


It was a good idea to try though.



On 3/26/2019 5:17 PM, Richmond via use-livecode wrote:

I suppose if you open an .mpg file as a TEXT file it should
contain standard markers as to whether it is encoded as MPEG-1 or 
MPEG-2.


Useful samples here: http://hubblesource.stsci.edu/sources/video/clips/

Richmond.

On 26.03.19 22:32, Paul Dupuis via use-livecode wrote:
Livecode 9.x.x uses Apple Video Foundation (AVF) for the LC Player 
object under OSX.

AVF supports MPEG-1 video but not MPEG-2 video.
Both MPEG-1 and MPEG-2 use the .mpg file extenstion.

Question for any media geniuses on this list: Is there a way in 
LiveCode to tell a MPEG-1 .mpg file from a MPEG-2.mpg file?



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Apple Video Foundation (AVF) and .mpg files

2019-03-26 Thread Richmond via use-livecode
Looking at "Get Info" for the 2 movie files at the top of the page I 
referenced in my earlier message:


http://hubblesource.stsci.edu/sources/video/clips/details/images/centaur_1.mpg

http://hubblesource.stsci.edu/sources/video/clips/details/images/centaur_2.mpg

the two codecs are listed there.

So: the BIG question is where that sort of INFO is stored in a file and 
how LiveCode can access it and read it.


What is odd, in LiveCode 9.0.3 at least, is that if those 2 clips are 
imported into a stack neither the
Project Browser or the Application Overview will show a Property 
Inspector for either clip.


LiveCode 7.1.4 will open a proeprty inspector for both of these clips 
but offers no helpful information.


The $60,000 question has to be: can LiveCode read a file's metadata?

Richmonds-Mac-mini:~ richmond$ mdls 
/Users/richmond/Desktop/videoFormats/centaur_1.mpg

kMDItemCodecs  = (
    "MPEG-1 Video"
)

Richmonds-Mac-mini:~ richmond$ mdls 
/Users/richmond/Desktop/videoFormats/centaur_2.mpg

kMDItemCodecs  = (
    "MPEG-2 Video"
)

Richmond.

On 26.03.19 23:28, Paul Dupuis via use-livecode wrote:

Richmond,

I good suggestion. Thank you. However, looking at an identical video 
clip encoded as MPEG-1 and as MPEG-2 in a test editor shows lots of 
gibberish and no obvious text tags to tell the encoding.


Unfortunately, I don't have time to research byte level binary 
encoding differences between MPEG-1 and MPEG-2, which is why I was 
hoping some LiveCode media guru had already done this and would share.


It was a good idea to try though.



On 3/26/2019 5:17 PM, Richmond via use-livecode wrote:

I suppose if you open an .mpg file as a TEXT file it should
contain standard markers as to whether it is encoded as MPEG-1 or 
MPEG-2.


Useful samples here: http://hubblesource.stsci.edu/sources/video/clips/

Richmond.

On 26.03.19 22:32, Paul Dupuis via use-livecode wrote:
Livecode 9.x.x uses Apple Video Foundation (AVF) for the LC Player 
object under OSX.

AVF supports MPEG-1 video but not MPEG-2 video.
Both MPEG-1 and MPEG-2 use the .mpg file extenstion.

Question for any media geniuses on this list: Is there a way in 
LiveCode to tell a MPEG-1 .mpg file from a MPEG-2.mpg file?



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Apple Video Foundation (AVF) and .mpg files

2019-03-26 Thread Richard Gaskin via use-livecode

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
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Apple Video Foundation (AVF) and .mpg files

2019-03-26 Thread Paul Dupuis via use-livecode

Richmond,

I good suggestion. Thank you. However, looking at an identical video 
clip encoded as MPEG-1 and as MPEG-2 in a test editor shows lots of 
gibberish and no obvious text tags to tell the encoding.


Unfortunately, I don't have time to research byte level binary encoding 
differences between MPEG-1 and MPEG-2, which is why I was hoping some 
LiveCode media guru had already done this and would share.


It was a good idea to try though.



On 3/26/2019 5:17 PM, Richmond via use-livecode wrote:

I suppose if you open an .mpg file as a TEXT file it should
contain standard markers as to whether it is encoded as MPEG-1 or MPEG-2.

Useful samples here: http://hubblesource.stsci.edu/sources/video/clips/

Richmond.

On 26.03.19 22:32, Paul Dupuis via use-livecode wrote:
Livecode 9.x.x uses Apple Video Foundation (AVF) for the LC Player 
object under OSX.

AVF supports MPEG-1 video but not MPEG-2 video.
Both MPEG-1 and MPEG-2 use the .mpg file extenstion.

Question for any media geniuses on this list: Is there a way in 
LiveCode to tell a MPEG-1 .mpg file from a MPEG-2.mpg file?



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Apple Video Foundation (AVF) and .mpg files

2019-03-26 Thread Paul Dupuis via use-livecode

I have a list of all the formats AVF supports and doesn't support.

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?



On 3/26/2019 5:05 PM, Rick Harrison via use-livecode wrote:

I also supports .mp4 which is MPEG-4 if that helps.

Rick


On Mar 26, 2019, at 4:32 PM, Paul Dupuis via use-livecode 
 wrote:

Livecode 9.x.x uses Apple Video Foundation (AVF) for the LC Player object under 
OSX.
AVF supports MPEG-1 video but not MPEG-2 video.
Both MPEG-1 and MPEG-2 use the .mpg file extenstion.

Question for any media geniuses on this list: Is there a way in LiveCode to 
tell a MPEG-1 .mpg file from a MPEG-2.mpg file?


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Apple Video Foundation (AVF) and .mpg files

2019-03-26 Thread Richmond via use-livecode

I suppose if you open an .mpg file as a TEXT file it should
contain standard markers as to whether it is encoded as MPEG-1 or MPEG-2.

Useful samples here: http://hubblesource.stsci.edu/sources/video/clips/

Richmond.

On 26.03.19 22:32, Paul Dupuis via use-livecode wrote:
Livecode 9.x.x uses Apple Video Foundation (AVF) for the LC Player 
object under OSX.

AVF supports MPEG-1 video but not MPEG-2 video.
Both MPEG-1 and MPEG-2 use the .mpg file extenstion.

Question for any media geniuses on this list: Is there a way in 
LiveCode to tell a MPEG-1 .mpg file from a MPEG-2.mpg file?



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Apple Video Foundation (AVF) and .mpg files

2019-03-26 Thread Rick Harrison via use-livecode
I also supports .mp4 which is MPEG-4 if that helps.

Rick

> On Mar 26, 2019, at 4:32 PM, Paul Dupuis via use-livecode 
>  wrote:
> 
> Livecode 9.x.x uses Apple Video Foundation (AVF) for the LC Player object 
> under OSX.
> AVF supports MPEG-1 video but not MPEG-2 video.
> Both MPEG-1 and MPEG-2 use the .mpg file extenstion.
> 
> Question for any media geniuses on this list: Is there a way in LiveCode to 
> tell a MPEG-1 .mpg file from a MPEG-2.mpg file?
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Apple Video Foundation (AVF) and .mpg files

2019-03-26 Thread Paul Dupuis via use-livecode
Livecode 9.x.x uses Apple Video Foundation (AVF) for the LC Player 
object under OSX.

AVF supports MPEG-1 video but not MPEG-2 video.
Both MPEG-1 and MPEG-2 use the .mpg file extenstion.

Question for any media geniuses on this list: Is there a way in LiveCode 
to tell a MPEG-1 .mpg file from a MPEG-2.mpg file?



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode