[MPlayer-dev-eng] [SURVEY] change mencoder's default ofilename extension?

Oded Shimon ods15 at ods15.dyndns.org
Tue Nov 29 19:23:34 CET 2005


On Tue, Nov 29, 2005 at 01:23:34PM +0100, Reimar at mplayerhq.hu wrote:
> Hi,
> On Mon, Nov 28, 2005 at 09:52:34PM +0200, Oded Shimon wrote:
> > I suggest a variant of this idea - 
> > keep everything the same, except:
> > a BIG FAT warning, when you use an output file extention which doesn't math 
> > the output file you're giving.
> 
> Good idea IMHO, just the implementation...
> 
> > +{
> > +	int i, n = 0;
> > +	for (i = 0; out_filename[i]; i++)
> > +		if (out_filename[i] == '.') n = i + 1;
> 
> better use strrchr and make sure it works with "file.avi.mpg" and "file"
> and things like that.

RTFS, it works great.
file.avi.mpg => "mpg"
file         => "file"
file.        => ""

using strrchr would not work with "file", but i could do it with strrchr if 
you preffer, i see no point in it though.

On Tue, Nov 29, 2005 at 12:15:20PM -0500, The Wanderer wrote:
> ...okay, now that I think about it, this doesn't even make sense as
> being related to the problem under discussion. The problem is not
> "people give a file extension with -o which doesn't match the container
> format they've requested" (although that is *a* problem), the problem is
> that "when people don't give a '-o' option at all, but *do* specify a
> non-AVI container format, the file extension is wrong".
>
> Unless you mean "giving no output file" to be semantically equivalent to
> "giving the output file 'test.avi'", I don't see how the two problems
> can be conaidered directly related. Yes, it would be good to fix both,
> but fixing the former would not by itself fix the latter.

I do consider them equivalent, and i think my patch fixes both problems.
Actually, I don't even consider the first one a problem. Someone does
'-of mpeg' and gets a 'test.avi', he knows it's an mpg file since he 
expliticly asked, especially now with the big loud warning, and can rename 
it to 'test.mpg' himself...

Only thing for me left undecided in the patch is the loud warning, I think 
it's not loud enough give mencoder's... verbosity. Maybe pad it with '\n' 
so it has it's own special line?.. I think that's noticable enough.


Regarding your other remark - having the muxer choose the file extention 
isn't feasible either. muxer_mpeg has several extentions ("mpg", "mpeg", 
"vob"), muxer_lavf has many many more possible extentions, and the idea 
involves changing user's input which imo is just wrong.

I'm doing the "\n" pad thing and committing in a few days.. speak now or 
forever hold your peace?

- ods15




More information about the MPlayer-dev-eng mailing list