Media import (Not available in VIMP Light)
The media import plugin imports media files from a pre-configured local directory, via SCP/SSH or via FTP.
The import process can be started in the Media section of the VIMP backend by clicking the “Media Import” button.
The dialog offers four different options to import media into VIMP:
- XML (media import XML file): An XML file that contains all media information (e.g. location and meta data) can be uploaded by clicking the “browse” button.
- Directory (on the server): This option should be used, if XML files and/or media files are located on the VIMP webserver and shall be imported locally.
- FTP server: This option enables you to import XML and/or media files from an external FTP server.
- SSH server: This option enables you to import XML and/or media files from an external server that can be accessed via SSH.
Directory (on the server), FTP server and SSH server have two import options in each case:
- XML files: If this option is checked, the import will be carried out based on the provided XML file(s). XML files contain all information, like where the to be imported files are located or additional (meta) data (title, description, categories etc.).
- Media files: Use this method, if you didn’t create any XML files. Then all media files will be imported from the directory that you specify in the form. Media that have been imported this way contain the default values for title, description, user, visibility, etc. as you entered them in the media import configuration settings.
Important note: With this option, media will not be imported, if an XML file exists in the same directory, referring to media in the same folder.
Find a sample XML file in the following:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mediaimport PUBLIC "-//MEDIAIMPORT//DTD MEDIAIMPORT//EN" "http://www.vimp.com/mediaimport-1.3.dtd">
<mediaimport version="1.3">
<locations>
<location id="loc1" type="filesystem">
<path></path>
</location>
<location id="loc2" type="ftp">
<hostname></hostname>
<port></port>
<path></path>
<username></username>
<password></password>
<passive></passive>
<ssl></ssl>
</location>
</locations>
<media>
<medium location="loc1">
<title></title>
<description></description>
<username></username>
<publication></publication>
<categories>
<category></category>
</categories>
<tags>
<tag></tag>
</tags>
<metadata>
<title></title>
<description></description>
<keywords></keywords>
<author></author>
<copyright></copyright>
</metadata>
<!-- media permissions -->
<permissions>
<permission></permission>
</permissions>
<!-- /media permissions -->
<!-- channel direct upload -->
<channel></channel>
<!-- /channel direct upload -->
<!-- media fields -->
<fields>
<field name="required_field"></field>
</fields>
<!-- /media fields -->
<!-- chapters -->
<chapters>
<chapter xml:lang="de">
<name></name>
<description></description>
<timecode></timecode>
</chapter>
</chapters>
<!-- /chapters -->
<files>
<file type="source"></file>
<file type="transcoded"></file>
<file type="thumbnail"></file>
<html5>
<file type="mp4"></file>
<file type="m4v"></file>
<file type="ogv"></file>
<file type="webm"></file>
<file type="mp3"></file>
<file type="oga"></file>
<file type="wav"></file>
</html5>
<previews>
<file type="transcoded"></file>
<file type="thumbnail"></file>
<html5>
<file type="m4v"></file>
<file type="ogv"></file>
<file type="webm"></file>
<file type="mp3"></file>
<file type="oga"></file>
<file type="wav"></file>
</html5>
</previews>
</files>
</medium>
</media>
</mediaimport>
You can delete nodes that you don’t require. But please consider that the order of the nodes must be maintained at any time. For example, node title must be located before node description.
Within the locations node you define the locations where the media files shall be imported from. Locations can be local folders on the webserver or external servers and folders that can be accessed via FTP or SCP.
Add a “location” attribute to each medium that you define in the XML afterwards.
The locations node is only needed,
- if you choose the “XML” option in the import dialog and upload your XML file directly via the VIMP backend
- or if your media files are not located in the same folder as the XML file itself
- or, of course, if both applies.
Description of the XML-Nodes
<media> ... </media>
The media container contains one medium element for each medium that shall be imported.
<medium location="location-id"></medium>
The location attribute location="location-id" can be omitted, if there is no location element in the XML or if the video is located within the same folder as the XML itself.
The medium element is obligatory for each medium to be imported.
<title>Title of the medium</title>
The title element contains the title of the medium.
<username>moderator</username>
This element defines the username of the owner of the medium.
Possible values: username of the user that will be the owner.
<publication>public</publication>
This element defines, if the medium shall be published as public, private or hidden.
Possible values: public; private; hidden
<categories>
<category>Entertainment</category>
<category>Science</category>
<category>9</category>
<category>Animals</category>
</categories>
Each category requires a new category element within the categories node. The example above assigns the medium to four categories.
Possible values: category name in one of the installed languages (case insensitive) or category ID.
<tags>
<tag>Tag 1</tag>
<tag>second Tag</tag>
<tag>and tag 3</tag>
</tags>
Each tag requires a separate tag element within the tags container. The example adds three tags to the medium.
<metadata>
<title>Title of the medium</title>
<description>Description of the medium</description>
<keywords>keyword1, keyword2, keyword3</keywords>
<author>Name of the author</author>
<copyright>Copyright information</copyright>
</metadata>
Search engine meta tags will be added within the metadata container. The number of meta tags is limited to the pre-defined tags title, description, keywords, author and copyright.
<permissions>
<permission>anonymous</permission>
<permission>administrator</permission>
<permission>moderator</permission>
</permissions>
The permissions element defines the access permissions to the medium. Users belonging to the defined role will be able to access the medium in the frontend.
Possible values: name of the user role
If the permissions element will be omitted, the default roles will be used as defined at Backend -> Configuration -> Media permissions.
<channel>My Channel 1</channel>
<channel>mY ChaNNel 2</channel>
<channel>3</channel>
The channel element enables you to assign a medium to a certain channel directly during import.
Possible values: name of the channel in one of the installed languages (case insensitive) or channel ID.
If the channel element will be omitted, the medium will not be assigned to a channel.
<fields>
<field name="required_field">Value</field>
<field name="Field Name">Value</field>
</fields>
The field elements within the fields node contain values of the custom media fields (see Backend -> Media fields).
The attribute name must contain the unique field name (and not the display name). IDs cannot be used here.
chapters>
<chapter lang="de">
<name>Chapter 1</name>
<description>Chapter 1</description>
<timecode>00:00:05</timecode>
</chapter>
</chapters>
Chapters will be defined within the chapters container. Each chapter must be added by a separate chapter node, containing a “lang” attribute for the language (en = English, de = German, etc.).
The chapter node requires a name element for the title of the chapter, a description element and a timecode element (HH:MM:SS).
<files> ... </files>
The files node can be omitted, if the to be imported media file has the same file name as the XML file (except of the file extension).
If the XML file name is different to the media file name or if multiple media shall be imported with one XML file each medium node requires a files block.
See an example XML of all possible variations in the following:
<files>
<file type="source">abc.xyz</file>
<file type="transcoded">abc.xyz</file>
<file type="thumbnail">abc.xyz</file>
<html5>
<file type="m4v">abc.m4v</file>
<file type="ogv">abc.ogv</file>
<file type="webm">abc.webm</file>
<file type="mp3">abc.mp3</file>
<file type="oga">abc.oga</file>
<file type="wav">abc.wav</file>
</html5>
<previews>
<file type="source">abc.xyz</file>
<file type="thumbnail">abc.xyz</file>
<html5>
<file type="mp4">abc.mp4</file>
<file type="m4v">abc.m4v</file>
<file type="ogv">abc.ogv</file>
<file type="webm">abc.webm</file>
<file type="mp3">abc.mp3</file>
<file type="oga">abc.oga</file>
<file type="wav">abc.wav</file>
</html5>
</previews>
</files>
If you want to import the source file only, the following structure applies:
<files>
<file type="source">abc.xyz</file>
</files>
This code is sufficient, if imported files shall be transcoded by VIMP automatically as it is the case when you upload media regularly in the frontend.
If you want to import a source file and already existing additional formats without having them transcoded again, the files structure looks as follows:
<files>
<file type="source">abc.xyz</file>
<file type="transcoded">abc.mp4</file>
<file type="thumbnail">abc.xyz</file>
</files>
As soon as there is a file element with attribute „transcoded“, the status of the medium will be set to the status that has been configured at Backend -> Configuration -> Media Import Settings -> Default Status. Valid statuses are “legal” (medium is visible in the frontend immediately) or “verify” (medium must be verified by an administrator before it will be visible in the frontend).
<file type="source">abc.wmv</file>
Source medium. It can be transcoded into all required web formats.
<file type="transcoded">abc.mp4</file>
Transcoded format. mp4 videos can be played in HTML5 directly without preceding transcoding.
<file type="thumbnail">abc.jpg</file>
Thumbnail. Will be used as preview image and poster image within the player.
Additional formats:
<html5>
<file type="m4v">abc.m4v</file>
<file type="ogv">abc.ogv</file>
<file type="webm">abc.webm</file>
<file type="mp3">abc.mp3</file>
<file type="oga">abc.oga</file>
<file type="wav">abc.wav</file>
</html5>
Additional formats will be defined in the html5 node. For videos, type=”m4v” should be sufficient for all modern mobile devices.
With the video on demand extension enabled, required preview videos can be imported as well:
<previews>
<file type="transcoded">abc.mp4</file>
<file type="thumbnail">abc.jpg</file>
<html5>
<file type="m4v">abc.m4v</file>
<file type="ogv">abc.ogv</file>
<file type="webm">abc.webm</file>
<file type="mp3">abc.mp3</file>
<file type="oga">abc.oga</file>
<file type="wav">abc.wav</file>
</html5>
</previews>
As you can see, you have full control of all required formats. Alternatively, you can always just import the source files and let VIMP take care of the transcoding of the additional web formats.