trouver: Création d'Alias ​​SOFTLINKS MPEG pour JVC Everio fichiers MOD TOD

My JVC camcorders record in MOD and TOD file formats, which are non-standard video formats that cannot be directly played on most computers or networked media players. This post describes how to use the Linux 'find' command to create an MPEG alias to the TOD or MOD file so that the video can be played without post-processing.

My home video collection exceeds 1,500 files representing about one terabyte of storage. I am unwilling to dutifully follow JVC's recommendation of using their bundled software to convert their non-standard file formats to MPEG for playback on my media player. While the JVC Everio hard disk drive camcorder records excellent high-definition video, their choice of file formats is very unfortunate. Heureusement, the VNC media player can be configured to play TOD and MOD files directly on a Mac or PC. Cependant, la situation est plus difficile si vous gardez vos fichiers vidéo sur un périphérique NAS et souhaitez diffuser de la vidéo à votre téléviseur.

Cette approche a été testée sur un Netgear ReadyNAS NV dispositif, mais devrait fonctionner avec n'importe quel appareil de stockage en utilisant Linux comme Synology, Qnap and Buffalo Technology. Playback has been tested networked media players such as Patriot Box Office (maintenant appelée noyau) et Micca EP950.

Comment ça marche?

Pour chaque fichier de la TOD ou extension de fichier MOD, créer un lien symbolique avec un "mpg" extension de fichier qui pointe vers le fichier original.

A softlink is preferred to a hardlink to avoid duplicating files during copying. The softlink is a small text file (in the 10s of bytes range) that points to the target file. A hardlink is actually be another name for the target file (it references the same inode as the target), resulting in the entire file being moved when I backup the videos to another hard disk drive.

The softlink filename will be the target's filename with ".mpg" appended.

Find Command

trouver . -type f -name *.TOD -execdir ln -s {} {}.mpg \;

The above command works if the trouver version supports the execdir directive. It won't work on the ReadyNas NV+, which uses the older trouver Version 4.1.7.

For creating backup copies of the home videos, it is important that the mpg links are pointing to the TOD files using relative paths. While it is possible to replace the execdir directive with the plain exec and the '.' with the full path to the current directory, this will create symlinks with absolute paths that are device specific. Par exemple, the directory '/c/Videos' is only valid on the ReadyNas, not the backup hard disk drive. A more complex command is needed.

trouver . -type f -name *.TOD -exec sh -c ' \
dir=$(dirname {}) ;\
base=$(basename {}) ;\
echo $dir - $base ; \
cd $dir ;\
pwd ;\
ln -s $base $base.mpg' \;

Le echo et pwd commands above are for debugging, to confirm that the correct paths are being used. I also create the dir et base variables for clarity. The above command can be condensed into something more cryptic by removing the debugging and variable statements.

The above command replicates the execdir directive for older versions of trouver found in appliances like NAS devices.

Synology Update

The same softlink approach works on Synology DS1512+ NAS connected to a Patriot Box Office player. In addition to the .mpg extension, une .m2ts works equally well. (ToDo reminder: Add a synology task to automatically create softlinks for new TOD files.)

December 15th, 2012 Publié par Jon Jaroker Classé dans: Bash

Soyez le premier à laisser un commentaire. Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont marqués *