Embeding a video in a KMZ file

928 views
Skip to first unread message

GTrek

unread,
Apr 21, 2013, 7:27:46 PM4/21/13
to kml-suppor...@googlegroups.com
Hi all,

I'm trying to embed a video (.MOV or .AVI etc) in a KMZ file to load into Google Earth and after a couple of days getting no where I think I have found out why but not how to fix it.

I can embed images in the KMZ (<img src="photo/DSC00023.jpg" />) that's easy but when I create a KMZ videoTest.kmz with the following code it fails:-

    <Placemark>
      <name>Video</name>
      <description>
        <![CDATA[
          <OBJECT ID="MediaPlayer" width="720" height="576" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" 
              CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
              STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">
            <param name="fileName" value="2013-04-20.mp4">
            <param name="autoStart" value="true">
            <param name="showControls" value="true">
            <param name="ShowStatusBar" value="true">
            <param name="ShowDisplay" VALUE="true">
            <embed type="application/x-mplayer2" src="2013-04-20.mp4" name="MediaPlayer" width="720" height="576" ShowControls="1" ShowStatusBar="1" ShowDisplay="1" autostart="1"> </embed>
          </object>
        ]]>
      </description>
      <Style>
        <BalloonStyle>
          <displayMode>default</displayMode>
          <text><b>$[name]</b><br/>$[description]</text>
        </BalloonStyle>
      </Style>
      <styleUrl>#POI_1</styleUrl>
      <LookAt>
        <longitude>-1.84723333</longitude>
        <latitude>52.56102778</latitude>
        <range>6000</range>
        <tilt>45</tilt>
        <heading>0</heading>
      </LookAt>
      <Point>
        <coordinates> -1.84723333,52.56102778,0.0</coordinates>
      </Point>
    </Placemark>

The KMZ loads OK and when I click on the placemark Media Player opens with a black blank screen, no video.

If I right click on the screen and select Properties the file location given is "C:\Users\john\Documents\Geotaged pictures\videoTest.kmz\2013-04-20.mp4" which is a fully qualified URL and obviously not what I wanted. It should be just 2013-04-20.mp4 to extract it from the KMZ file. If I create a file path (as above) it load the video and plays it. Odd ?.

Any body got any ideas ? My test file attached

I'm running Windows 7 x64.

John


videoTest.kmz

josh258

unread,
Apr 21, 2013, 10:10:02 PM4/21/13
to kml-suppor...@googlegroups.com
Hello John,
    I finally got it the video to work, though it was cumbersome. It seems that the video does not unpack unless you extract the files using a zip application. I used 7-zip to unpack the .kml, video, icons, etc. into a local folder. Running the .kml from that local folder worked. I found it much easier to host a .mp4 on the web and simply put the url in the Google Earth file. This reduced all the extra steps of extracting the files, but you might have reasons not to. Anyways, hoped this helped.

Josh 

GTrek

unread,
Apr 22, 2013, 5:46:44 AM4/22/13
to kml-suppor...@googlegroups.com

Hi Josh,

I can see what you have done here that’s the only way I managed to get it to work and that's my problem this needs to be easy. When viewing images from place marks I don't need to extract the image file first GE does that for me. What I'm trying to achieve is the same effect but with a video file.

 As you say, uploading the video to a web server is another solution but not the best in this occasion.

 Regards

 John

 
Reply all
Reply to author
Forward
0 new messages