[mythtv-users] mythrename.pl linking .mpg as .nuv

Rich West Rich.West at wesmo.com
Tue Nov 20 02:05:56 UTC 2007

Jon Larson wrote:
> Jay R. Ashworth wrote:
>> On Mon, Nov 19, 2007 at 11:02:05AM -0800, Jon Larson wrote:
>>> I've got three boxes all running Knoppixmyth R5F27. All three run the 
>>> same version of mythrename.pl, but one box spits out links with .nuv 
>>> extensions even though all media files are .mpg.
>>> I've done a little searching on this and it has been suggested that this 
>>> is dependent on the results of the 'file -b' command in mythrename, so I 
>>> copied the results from a couple tests:
>>> PC with NUV links:
>>> AVPC1:~# file --v
>>> file-4.19
>>> AVPC1:~# file -b /mnt/AVPC1/tv/1004_20071106160900.mpg 2>/dev/null
>>> MPEG sequence, v2, program multiplex
>>> PC with MPG links:
>>> AVPC2:~# file --v
>>> file-4.19
>>> AVPC2:~# file -b /mnt/AVPC2/tv/1004_20071106180900.mpg 2>/dev/null
>>> MPEG sequence, v2, program multiplex
>>> Since these seem identical, I'm not sure what else could make these PCs 
>>> behave differently. Any further troubleshooting suggestions would be 
>>> appreciated.
>> Perhaps you have different versions of the perl script on the different
>> boxen somehow?  .nuv's were created by older versions of myth for MPEG2
>> files from, say, Hauppauge cards.
>> Cheers,
>> -- jra
> I just don't see what is making the mythrename script believe that 
> these files are NUVs. As for different copies of mythrename, I've 
> checked all the boxen and mythrename appears thus on each one:
> # $Date: 2006-02-27 23:40:08 -0800 (Mon, 27 Feb 2006) $
> # $Revision: 9198 $
> Jon

I had (have) this same issue 

The script is just trying to be intelligent by renaming the extensions.  
IMHO, it's trying to be "Microsoft intelligent", but that's for another 
discussion :).  The script is performing the "file" command on the file 
to determine what type of file it is so as to set the proper extension.  
A slightly corrupted mpg file will be renamed to a .nuv file as that 
seems to be the fall back.

>     # Figure out the suffix
>         my $out    = `file -b $safe_file 2>/dev/null`;
>         my $suffix = ($out =~ /mpe?g/i) ? '.mpg' : '.nuv';

Personally, I think it should use the suffix of the file as it is rather 
than even touching the suffix.  That eliminates the unnecessary code and 
prevents this (annoying) problem all together.

On the up side, mythtv will play the file regardless of the extension, 
so it really isn't doing any harm.


More information about the mythtv-users mailing list