9 Replies Latest reply: Nov 18, 2011 4:04 AM by sivacse24rep RSS

    how to get Meta tag information of a video

    sivacse24rep Community Member

      Hi,

       

      I want to read Meta tag information of a video file like Artist,Album,Year,etc....

       

      I tryed "onMetaData" for a video file.But i didnt get information like Artist,Album,Year,etc...

       

      The video file can be mp4,avi,mpg,mov. I dont want them to play in swf... I just want to load the file and show the meta tag information as text.

       

      For audio files i can get id3 information after loading the song.But is there any other way to get them with out loading the sound? Each  loading will take time to give the result.

       

      Can you help me:

      • How to read meta tag of a Video file
      • How to read mpg,avi meta tag
      • How to read mp3's meta tag with out loading
        • 1. Re: how to get Meta tag information of a video
          Andrei1 Community Member

          1. You cannot read anything in a file if you don't load it

          2. If there is nothing inserted into the file (Artist, etc.) - it will not be there. Someone has to provide this information while encoding video or sound

          3. There is no such thing as meta tag in videos or data. In videos info is provided by injecting XML strings, in mp3 ID3 is a vehicle to provide any information. None of these things are required and files may not have any information.

           

          So, make sure that you inject information into video when you encode it.

          • 2. Re: how to get Meta tag information of a video
            Andrei1 Community Member

            Oh, and as for file formats - Flash doesn't support all codecs but the majority of them. Here is the list of supported formats:

             

            http://kb2.adobe.com/cps/402/kb402866.html

            • 3. Re: how to get Meta tag information of a video
              sivacse24rep Community Member

              Hi Andrei,

               

              How to read "injected information of a video" from flash actionscript 3.0?(is it related to read cue points?) If you have any tutorial link please give me it will be helpful...

               

              And if possible Can you give me idea how to inject information into a video?

               

              Thanks a lot for the replay....

              • 4. Re: how to get Meta tag information of a video
                Andrei1 Community Member

                Info is injected into files at the time video is encoded - not in Flash.

                 

                Cue points are another type of information that is, again, injected/written into video file elsewhere with other software.

                 

                So, if data is present in the file, you can read it either onMeatData or onXMPData or from cue points.

                 

                Again, if data is not present - there is nothing you can do about it.

                • 5. Re: how to get Meta tag information of a video
                  sivacse24rep Community Member

                  Hi if you have any demo link to see the (onMeatData,onXMPData) function plz give me...

                   

                  Because i have a mp4 video file when i use the OnMetaData i only not able to fetch Artist,Album. But where as some other video player can able to fetch those information for the same mp4 file.

                   

                  Can you give me some sample code or demo link how to fetch useing onXMPdata?

                  • 6. Re: how to get Meta tag information of a video
                    Andrei1 Community Member

                    Show the code that you use to get metadata.

                    • 7. Re: how to get Meta tag information of a video
                      sivacse24rep Community Member

                      var nc:NetConnection = new NetConnection();

                      nc.connect(null);

                       

                      var ns:NetStream = new NetStream(nc);

                      ns.client = this;

                      ns.play("D:/1.mp4");

                       

                      var vid:Video = new Video();

                      vid.attachNetStream(ns);

                      addChild(vid);

                       

                      function onMetaData(infoObject:Object):void

                      {

                          var key:String;

                          for (key in infoObject)

                          {

                              trace(key + ": " + infoObject[key]);

                          }

                      }

                       

                       

                      //result:


                      width: 720

                      audiosamplerate: 44100

                      avcprofile: 77

                      audiochannels: 2

                      avclevel: 30

                      tags:

                      videocodecid: avc1

                      aacaot: 2

                      height: 400

                      videoframerate: 30

                      duration: 295.3

                      moovposition: 36

                      audiocodecid: mp4a

                      seekpoints: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

                      trackinfo: [object Object],[object Object],[object Object],[object Object]

                      • 8. Re: how to get Meta tag information of a video
                        Andrei1 Community Member

                        There is no artist or any other information in this video - so you cannot get it. Try onXMPData.

                         

                        Again, if nothing is injected into video file - you cannot get what doesn't exist.

                        • 9. Re: how to get Meta tag information of a video
                          sivacse24rep Community Member

                          Hi  Andrei,

                           

                          yes i tryed the onXMPData too... But no use...The video have it's own information.I check the same video under VLC player media information.

                          Here i attached a sample screenshot of the informationsamp.jpg.Those information able to read using onMetadata and as well as onXMPData.Both faild to read Title,Artist,etc., How to read the information?