Understanding, and using, P2 Filenames
(it’s less complicated and more powerful than you may think!)
by Barry Green

Among the frequently-asked question from new P2 users is: “what’s with these filenames? Why are they just random, and isn’t there some way that I can have sequential filenames for each clip?”

Before reading further, check out this display from P2 Viewer. Wouldn’t you like all your clips to look like this, fresh from the camera?

 

As with most systems, a little understanding of how the system works can make for a more enjoyable experience working with the system. And, by taking advantage of a little-known feature in the P2 cameras, you can actually make the whole filename process work out so much easier and better than ever before!

Before we start, let’s first examine how the P2 system names the files that it creates on the card. Here’s a screenshot of a sample P2 directory, from P2 Viewer:

 

When you look at those filenames, they sure do look random, don’t they? The thing is: they’re not. At least, not entirely. The last two characters in the filename are random, yes, but the first four characters are actually a sequential number. Let’s look at those filenames in a slightly different way: I’ll highlight the first four digits, and you’ll see that actually each clip has been sequentially numbered, starting at 0001:

 

Once you separate the first four digits from the last two, it becomes a lot easier to see the pattern. Each clip’s name consists of four numerically increasing digits (i.e., a unique “number”), and then each clip has two “random” digits or letters assigned at the end. Sometimes those “random” digits are numbers, and that’s what can make the filename system seem so confusing (for example, look at clips 0001, 0002, 0003, and 0006: in their “random” digits, they all have a number, so it looks like clip 1 could be read as clip “19”, clip 2 could be read as clip “23”, etc, and that can cause confusion.) If you want to properly interpret the clip name you need to keep a sharp eye to distinguish between the first four characters in the name (which will always be numbers) and the last two “random” characters (which could be letters, but could also be numbers).

Once you learn to distinguish between the first four numbers and the last two characters, the naming system begins to make a lot more sense; each time you create a new clip, the filename is made of the next available number and a couple of random characters to try to ensure that the filename is unique. It’s not absolutely guaranteed that the filename will be unique, but considering that the last two characters have a potential pool of 36 individual characters to draw upon (the 26 letters and 10 digits), that gives 36x36 unique combinations, or about 1296 different possibilities. The odds of ending up with the same first four characters are already low (since they’re numerically ascending on each card), but even if you did end up with the same first four characters, the randomly-assigned last two characters means the odds against the system creating an absolutely identical filename are about 1 in 1,296. So while it’s not guaranteed, the possibility of having identical filenames on different cards is quite remote.

Let’s call the first four digits of the filename the “File Number” since those digits always represent a numerical value. How is the File Number determined? Usually by the LASTCLIP.TXT file. If your card has a LASTCLIP.TXT file on it, then the File Number for the next clip is set by reading that LASTCLIP.TXT file.

If we examine the LASTCLIP.TXT file on the P2 card shown above (the Karate footage), using Microsoft’s WordPad text editor, we find that the LASTCLIP.TXT file has three lines of text:

0011D0
1.0
12

This is fairly easy to decipher: the “0011D0” is the name of the last clip on that card (which is where the “LASTCLIP.TXT” file gets its name from; it contains the name of the last recorded clip!) The second line, “1.0” is: well, I don’t know what it is, it’s some manner of version number, but on every single card I’ve examined it always says “1.0”, so for the time being let’s ignore it. And the third line, which says “12”, is the number of the next file that will be created on this card. If I record a new clip onto this card, I know that the first four digits of the file name (the File Number) are going to be “0012”.

One last thing about the file names: the MXF “Op-Atom” file system splits recordings into their component parts (or “atoms”); audio is stored separately from video, which is stored separately from the icon, etc. All the different types of clips share the same root file name (meaning, for a clip with a base name of “0001XQ”, the video file will be “0001XQ.mxf” and the icon will be “0001XQ.bmp”), but the audio files get two additional digits at the end of their filename to signify which audio channel they represent. So for two channels of audio, the audio files will use the same base name but the left channel gets assigned a “00” and the right channel becomes “01”; for four channels of audio the next two channels get “02” and “03” on their file name; that means that the fourth audio channel of our above-named example would actually be “0001XQ03.mxf” – the same base name, but with the addition of “00” through “03” to identify the individual audio channels.

Which is all fine and dandy, but I can hear you out there – “Isn’t this overly complex? Can’t I just get filenames that MEAN SOMETHING to me? And can’t I just have automatically-incrementing file numbers the way I want them?”

Wouldn’t it be nice to be able to assign a clip name of, say, “Scene 1, Take: ” and then have the system automatically assign a “1” or “2” or “3” for every take you shoot? Can you do that?

Yes you can.

USER CLIP NAME
The key to controlling your filename destiny is to use the P2 metadata and take advantage of the User Clip Name field. This field is used by certain popular nonlinear editors (such as Avid and EDIUS); when you take advantage of the User Clip Name you actually control the name to the file that will be seen by your editor. This capability has always existed in European and PAL HVX200s, but was not initially available in the US version; any HVX200 with upgraded firmware now has the option to use the full capability of the User Clip Name. If you want to take advantage of this feature but your HVX is still running version 1.03 of the firmware, you’ll want to go to the Panasonic website at https://eww.pavc.panasonic.co.jp/pro-av/support/cs/csregistp2m/ep2main/ to get the latest firmware update.

So what’s new in the firmware update for clip naming? Mainly the implementation of the USER CLIP NAME field. There’s always been a User Clip Name field, but in the original HVX it was always assigned to be the same value as the Global Clip ID – which means it was always some huge incomprehensible 64-character random name such as “060A2B340101010501010D43130000007C1E8E9B013805D60080458210AC921D” (and yes, that’s an actual User Clip Name from one of my clips!) Clearly this is of little to no value for an end user who’s trying to organize his/her clips to conform to a human-readable filename. You’ve always had the ability to go into P2 Viewer or P2 Log and change that user clip name to a human-readable value, but I don’t know how many of us have bothered to do that for every clip we’ve shot.

Fortunately, the newer firmware makes User Clip Name so much more useful. With the new firmware, you can use P2 Viewer or P2 Log to assign a “base name” to your clips, and then the camera will attach a number value to that clip, and it’ll increment that number for every time it records a clip. What this means is, you can assign a base name like “Scene 5 Take ”, and it’ll add “0001”, “0002”, “0003” to the first three clips you make. I mean, this is what we’ve always had:

Wouldn’t you rather see this?

A little more useful? Easier to organize? It’s available to you now, if you take advantage of the User Clip Name field of the metadata.

How To Use The User Clip Name Field

Some software is MXF-aware and understands and uses the User Clip Name field. Examples include Avid XPress Pro HD, Grass Valley EDIUS Broadcast, and Panasonic’s own P2 Viewer program. (as an aside to the reader: if you know of other programs that use it, please let us know and we’ll update this article).

Like I said before, the first thing you need to do is make sure that your camera is running the proper firmware so that it can take advantage of the Type 2 metadata. Go into your P2 thumbnail screen and look for the Meta Data -> User Clip Name menu option. If yours looks like this, then you’re good to go:

(if you don’t have this option, update your camera’s firmware).

Assuming you have this option, be sure to select Type 2. If you use Type 1, the system will plug in that 64-bit Global Clip ID field into the User Clip Name, which defeats the purpose of the rest of this article! Make sure you set the User Clip Name to Type 2.

There are a few other things you need to do. First, create a metadata file on an SD memory card that has the base User Clip Name that you want to use. You can create that metadata file using P2 Viewer; use Tool->Metadata Upload, then click the checkbox for User Clip Name and enter the base file name that you want to use:

Then use the File menu and choose “Save to SD Card” (which of course requires that your computer has an SD card reader, and that you have an SD card loaded in it!)

You can also do this same basic functionality in P2 Log. Or, you could always just create a text file from any text file editor, even the one on your cell phone or PDA; the contents of the text file would need to look something like this:

Creating and saving the file from P2 Viewer is probably the simplest way to do it, but certainly not the only way. It’s easy to create the text file from a text editor, but a tad tricky to save it on your SD card if you’re not using P2 Viewer: you have to make sure you use the right type of file name, and that you save it in the right directory. If you don’t follow both of these steps the camera won’t be able to find it on your SD card. The filename for a P2 metadata file has to be MTDT00.P2 or MTDT01.P2, etc., you can assign any 2-digit number to the last two digits, but the base file name has to be MTDTxx.P2. And this is the directory you have to save it to (assuming that your SD card was loaded in a card reader identified as drive J:)

Once you have a P2 metadata file on an SD card, plug that SD card into your HVX200 and load it, using the following thumbnail menu options:

(in this example my P2 metadata file was named MTDT02.P2, so that’s the file I’ve got set to load).

There’s one more step you have to take before you’re ready to start using the new base filename for your User Clip Name: you have to tell the system to attach your loaded metadata to the clips. Do that by choosing Meta Data->Record->On.

Once you’ve loaded the metadata you can double-check to see it’s there by going into the Meta Data->Property menu and looking at the values, like this:

On that screen it shows you the loaded User Clip Name (in this example it’s “Scene 1 Take”) and it shows you the value of the automatically-incrementing counter (in this shot, it’s already at “0004”). Finally, it shows you the actual data that will be recorded (the “REC DATA”, which shows “Scene 1 Take 0004”). And there’s a menu option to reset the counter back to 1.

When you’ve assigned this data, now all clips will automatically have your User Clip Name (along with the counter value) attached to your clips. If you want to start the count back over at 1, you have to come into the Meta Data->Property screen and choose the User Clip Name field, then choose “Count Reset”. The only inconvenience in the system is: how do you change the User Clip Name base name? You’d have to edit that text on the SD card to change it, and then re-load the data using Meta Data->Load. If you’re diligent and make sure to take those steps, you’ll have the power of the new User Clip Name feature at your disposal!

Now, for clarification: the User Clip Name does not change the name of the files that get recorded. It’s still going to record the actual file name as something like “0001QD.mxf”. But in the clip’s metadata it will also record this new “Scene 1 Take 0004” custom user clip name. So when managing your file data you’d have to use a program (such as P2 Log, P2 Viewer, or Avid or EDIUS) that knows how to interpret the User Clip Name.

In P2 Viewer it’s simple; go to the “Tool->Customize” menu and choose the Icon View tab, and select “User Clip Name”:

In EDIUS, when you import the files using the P2 Select tool, it defaults to use the User Clip Name (although you can override that to use the ClipName or your own custom prefix too).

Notice how EDIUS displays the ClipName field (the icon and clip name such as 0025J2) and then it also has the UserClipName field. And in the options in the bottom center of the screen we’ve selected UserClipName as how the clips should import to the bin. With this setting all the files in the bin will show up with the custom name we’ve assigned (i.e., “Scene 1 Take 0003”) instead of the actual file name (such as “0027GC”).

It’s just as easy to do it in Avid as well; Avid has an option to display the User Clip Name instead of the Clip Name in its bin.

In summary, P2 naming is a lot easier to understand than it may first appear (it’s really just four characters that form a number, and then two random digits). But judicious and persistent maintenance of the User Clip Name can make working with P2 files in post so much more intuitive and easy to read, see, and understand. There’s a little bit of burden placed on you (to keep the UserClipName loaded and fresh and current) but if you do so, the benefits are obvious to be seen.

Discuss this in the Forum