Extension Edit

Locked
User avatar
Zarxrax
Joined: Sun Apr 01, 2001 6:37 pm
Contact:
Org Profile

Post by Zarxrax » Wed Aug 17, 2005 11:39 am

trythil wrote: file(1)

For example:

Code: Select all

trythil@nevrast /mnt/usb/video/amv/MultiEditor $ file DDR4
DDR4: RIFF (little-endian) data, AVI, 512 x 384, 29.97 fps, video: DivX 5, audio: MPEG-1 Layer 3 (stereo, 48000 Hz)
It's correct more often than some extension is, because it actually analyzes unique characteristics of files. It's fast, too.
So you mean to say... you actually have to exert some amount of effort in order to find out what the file type is? Wheras by having a file extension, you can determine the file type by simply looking at the filename.

Also, when you have file extensions, you are able to give files the same name, but different extensions.
Say for example I am doing an avisynth script, and I have a video source, an audio source, a subtitle source, and whatever else I can have. If I name them all the same thing with different extensions, I can write my script quickly and easily. If I have to come up with unique names for them all though, then while I'm writing my script, I will have to stop and think "ok, my audio source, let me check what I named that... now these subtitles, what did I names those?"

User avatar
risk one
Joined: Sun Oct 13, 2002 4:47 pm
Org Profile

Post by risk one » Wed Aug 17, 2005 12:18 pm

Zarxrax wrote: So you mean to say... you actually have to exert some amount of effort in order to find out what the file type is? Wheras by having a file extension, you can determine the file type by simply looking at the filename.

Also, when you have file extensions, you are able to give files the same name, but different extensions.
Say for example I am doing an avisynth script, and I have a video source, an audio source, a subtitle source, and whatever else I can have. If I name them all the same thing with different extensions, I can write my script quickly and easily. If I have to come up with unique names for them all though, then while I'm writing my script, I will have to stop and think "ok, my audio source, let me check what I named that... now these subtitles, what did I names those?"
You're free to add your own extensions on *nix. You can also suffix your files with an underscore and an extension of five letters if you prefer. The point is that the system looks at the file itself, so your avs files won't be opened by your word processor because of some weird conflict. That's really the whole point; filenames are for the user, not for the system and an extension is part of the file name.
trythil wrote:Modern environments can determine that automatically. A good, long-standing example: Mac OS has been doing that for a decade or so.
Funny you should say that, because a while ago I was trying to get my brother's mac to play an avi that had lost it's extension somewhere along the line. I opened it in about every player I could find, but it was only until I gave it an extension again and doubleclicked it, that quicktime knew what to do with it. I wonder if this has to do with the way avi files are constructed or with OSX/Quicktime.

I will say this for extensions; I'm used to them. No matter how hard I try to accept the *nix world's conceptual correctness, a filename without an extension just looks naked and silly.
ImageImage

trythil
is
Joined: Tue Jul 23, 2002 5:54 am
Status: N͋̀͒̆ͣ͋ͤ̍ͮ͌ͭ̔̊͒ͧ̿
Location: N????????????????
Org Profile

Post by trythil » Wed Aug 17, 2005 1:05 pm

Zarxrax wrote:
trythil wrote: file(1)

For example:

Code: Select all

trythil@nevrast /mnt/usb/video/amv/MultiEditor $ file DDR4
DDR4: RIFF (little-endian) data, AVI, 512 x 384, 29.97 fps, video: DivX 5, audio: MPEG-1 Layer 3 (stereo, 48000 Hz)
It's correct more often than some extension is, because it actually analyzes unique characteristics of files. It's fast, too.
So you mean to say... you actually have to exert some amount of effort in order to find out what the file type is? Wheras by having a file extension, you can determine the file type by simply looking at the filename.
No, you can still use extensions if you really think they're necessary. I'm pointing out an alternative method that doesn't rely on such things.

HeavyMetal
Joined: Sat Jan 24, 2004 9:45 pm
Org Profile

Post by HeavyMetal » Wed Aug 17, 2005 8:25 pm

Yes? No?

There are good reasons to rename extensions all the time. For example .txt to .avs. Just text, but works differently.

Anyway I know what extensions do and why. But here is the thing.

Media Player Classic - does not work for shit (file conflict I think, but even still I don't like its interface)

I can get just about anything to play in Winamp to include Realmedia.

Interesting note I actually did get a .txt to play in MPC once.

Anyway I was wondering for the sake of video header info, data loss, data corruption if the extension swap is okay. It does work on my system just fine, but what of others. It is really about the structure of the video data being interfered with.

.rmvb and .rm are similar, so I thought it may work without problems.

I was more or less worried that people would not know what to do with a Real Media Variable Bitrate file. I think I may be missing a file or something, but they just don't work. Not even in Realplayer.

As for extension themselves.
File extensions are still important today. An extension is to a file like a CSS file is to HTML. That data does not change, but it gives a heads up to the structure of the data and how to apply it. However, in an OS based more on raw data the use of extensions is diminished.

Oh well, I can always use matroska, theora, MP4 with Xvid, or something. I get more compression out of Xvid anway. I am just strange enough to like RM, of course I use RM alternative so that could explain why.

User avatar
Zarxrax
Joined: Sun Apr 01, 2001 6:37 pm
Contact:
Org Profile

Post by Zarxrax » Wed Aug 17, 2005 8:44 pm

If it is a file intended for people besides yourself, I would say you should never ever ever change the extension to something that it is not. This could only serve to confuse people by telling them its one type of file when its really another.

If you are intending on releasing an amv in rm format, I would highly recommand against that because people hate rm... its a bitch because it hardly works in any players.

trythil
is
Joined: Tue Jul 23, 2002 5:54 am
Status: N͋̀͒̆ͣ͋ͤ̍ͮ͌ͭ̔̊͒ͧ̿
Location: N????????????????
Org Profile

Post by trythil » Thu Aug 18, 2005 5:02 am

HeavyMetal wrote: As for extension themselves.
File extensions are still important today. An extension is to a file like a CSS file is to HTML.
No. That simile doesn't work at all.

A stylesheet defines how an object is...well, stylized. (I say "an object" because it doesn't have to be an (X)HTML document. SVG, for instance, makes use of CSS for styling components in the document, like paths and text.)

A file extension...doesn't do that. It can be used as an (unreliable) hint for parsing file structure, but it does not provide a set of rules for stylizing content. That is entirely up to the program reading a file.

The primary difference is really one of guarantees. With a correct CSS renderer, you can have certain guarantees that, given (say) a correct XHTML document and a correct stylesheet, your document will have certain style characteristics.

Now let's say I give you a file with an extension of mod. What is this? There's at least three potentially correct, and hugely different, ways to parse this file based only on the extension:

- It's a ProTracker/FastTracker/etc. music module
- It's some fragment out of a Windows 3.1 page file
- It's an XHTML v1.1 XML module

Such ambiguity does not arise in stylesheets. There's incorrect rendering, as popularized by IE, and perhaps rules that are something of a mess (like CSS2 was), but you still know that there's one standard. Not many.

Anyway. It is impossible to unambiguously determine what this file is without (1) the filename and/or (2) looking inside of it. So why have extensions at all? Sure, they can make things a little faster if you're familiar with the system, but so can any modern environment.

To answer another point in this thread:
Yes, there do exist programs that rely solely on extensions to determine file type. They're broken.

HeavyMetal
Joined: Sat Jan 24, 2004 9:45 pm
Org Profile

Post by HeavyMetal » Wed Aug 24, 2005 2:29 pm

Sorry for the delay. My internet service upgraded and by upgraded I mean stopped working because the program is crap.

The CSS and HTML was a rough idea, not written in stone. I don't think most would know of SVG. It is not really a ready made thing in most browsers.

The idea was that say .avi has header info in one place, while .asf has it in another. You can tell some of the data structure from the extension. But go ahead and try to open bizzare formats in various programs if you want. I have gotten one or two to work, but mostly I get the wonderful :roll: bonk that Windows makes

Well Z in the past I have gotten good compression from .rm. It is EASY to play if you are not using something like Windows Media Player. I use Winamp myself. But I get better compression from Xvid these days. So it does not matter.

Locked

Return to “Video & Audio Help”