Martchus / tageditor

A tag editor with Qt GUI and command-line interface supporting MP4/M4A/AAC (iTunes), ID3, Vorbis, Opus, FLAC and Matroska
GNU General Public License v2.0
696 stars 56 forks source link

Working with image file that contain colons ':' #120

Open octimis opened 3 weeks ago

octimis commented 3 weeks ago

The following MPV.conf setting is used to apply specific time stamp label format to video screen shots: screenshot-template="%F - [%P] (%#01n)"

I.e. Filename - [HH:MM:SS.MM] (1).jpg

Unfortunately tag editor will generate error: Error 03:57:28 setting tags: An IO error occurred when parsing the specified file "/Image/Directory/Without_File_Extension - [00": open failed: No such file or directory

[00, referring to the image file containing [HH, in its filename.

I have both paths enclosed in quotation. I'm on Ubuntu with bash terminal. The GUI works fine with such file names.

Escape character was no good:

"/path/to/image [00"\:"03"\:"03.193] (1).jpg"

This is an example of a command I executed:

tageditor set cover="/media/drive1/Example dir/image.jpg" \
-f "/media/drive1/Example dir/Video.mp4"

FFMpeg had no trouble with colons in the filename.

Martchus commented 3 weeks ago

Colons are used to specify the cover type and descriptions for tag formats supporting that, see the example on the README. I suppose I should add (or document if already implemented) a way of escaping here.

In your example command you're not using any colons, though. Is that just to show what you did in a generic way or do I misunderstand that colons are the problem? And I suppose colons are only problematic within the path of the cover (but not within the path of the file to be edited itself).

Martchus commented 3 weeks ago

Having to escape paths can actually be a bit annoying when scripting so I added an additional CLI argument to override the delimiter used to provide the cover type and description (see the added documentation of the commit referenced by GitHub for details). You'd simply set it to a character that won't occur in the path. This also makes things easier internally as I don't have to handle escaping.

I haven't tested it yet (except that the colon still works) but you can give it a try if you can build the tag editor from master.

octimis commented 3 weeks ago

Thanks for responding and attempting to fix the situation. I followed your suggestion here, and compiled C++ utilities.

I have relevant CPP files located in:


[c++utilitiesTargets.cmake]: 
./c++utilities/cpp-utilities-master/CMakeFiles/Export/share/c++utilities/cmake/
[3rdParty.cmake, BasicConfig]:
./c++utilities/cpp-utilities-master/cmake/module

For the command: --cover-type-delimiter I presume it would be appended to to:

tageditor set cover="/media/drive1/Example dir/image.jpg" -cover-type-delimiter\
-f "/media/drive1/Example dir/Video.mp4"

CMake Error at c++utilities/cpp-utilities-master/c++utilitiesConfig.cmake:131 (include): include could not find requested file: ...c++utilitiesTargets.cmake could not find requested file: 3rdParty could not find requested file: BasicConfig

img01

Martchus commented 3 weeks ago

Not sure what you did wrong. Probably c++utilities has not been installed where CMake tries to look for it. For building I strongly recommend to follow instructions on https://github.com/Martchus/tageditor?tab=readme-ov-file#building-this-straight and you probably want to add -DQT_PACKAGE_PREFIX:STRING=Qt6 at this point to use Qt 6. This way it is just a single build and there's no need to install anything.

And yes, -cover-type-delimiter needs to be appended but it also needs a value, e.g. -cover-type-delimiter '|' to change the delimiter to |. I suppose I could also support specifying no value in which case specifying a cover type and description will be impossible.