You are not logged in.
I try to use mediainfo CLi.
I'm not able to use the template feature.
The usual command is:
mediainfo --Output=[xxx;]Text FileName.mp4The command for using a template is:
mediainfo --Output=file://$HOME/.config/mediainfo/template.txt *.mkvBut it never uses the template.
I realized that when I use mediainfo without a template, I always have to use quotation marks for the output option,
mediainfo --Output="Video;%Duration%" *.mp4otherwise it does not work. But in the help docs and in every forum they use no quotation marks for the output options.
If I try to call the template, mediainfo reacts like there is no output option at all, it doesn't matter if I use quotation marks or not.
Now I suspect that the Output Option are somehow misinterpreted and therefore the template is not called.
I don't know what to do?
John
Last edited by john-soda (2018-01-23 14:00:59)
Offline
If you didn't put the quotes there, it would be interpreted by the shell (not Konsole¹) as follows:
mediainfo --Output=Video
%Duration% *.mp4That is because the shell treats the semicolon (;) as a command separator (you can put multiple commands on the same line separated by semicolons).
I don't know what the first command on its own does, but probably not what you expect it to do. And for the second command, the leading % has a special meaning as well, and the shell will try to do some background job handling with it (and fail).
Unfortunately, I don't know mediainfo or what you mean exactly with "templates" (and you haven't put any links to "every forum" or the "help docs"), but if I read the following description right,
mediainfo --Output=[xxx;]Text FileName.mp4then it takes exactly one .mp4 file as argument, whereas you specify potentially multiple (or zero) files with your wildcard *.mp4 (and I don't know what effect that has). Maybe try narrowing down your issue by executing the command with a single file .mp4 file.
_____
¹ Konsole is a terminal emulator, i.e. a program that imitates a text terminal, providing a user interface to the text-based applications running inside. One of those applications is the shell, a command line interpreter where you execute commands.
Offline
If you didn't put the quotes there, it would be interpreted by the shell (not Konsole¹) as follows:
mediainfo --Output=Video %Duration% *.mp4That is because the shell treats the semicolon (;) as a command separator (you can put multiple commands on the same line separated by semicolons).
I thought the shell interprets everything after
-- as an Option and everything after
--Option= as the argument of the option until a blank follows.
But, thank you very much for explaining it to me!
I don't know what the first command on its own does, but probably not what you expect it to do. And for the second command, the leading % has a special meaning as well, and the shell will try to do some background job handling with it (and fail).
Unfortunately, I don't know mediainfo or what you mean exactly with "templates"
A template means, a file where all output arguments are listed and their formatting.
(and you haven't put any links to "every forum" or the "help docs"), but if I read the following description right,
with help docs I meant
mediainfo -hand
mediainfo --Help-OutputWith forum I meant Mediainfo Sourceforge Discussion and Stackoverflow
mediainfo --Output=[xxx;]Text FileName.mp4then it takes exactly one .mp4 file as argument, whereas you specify potentially multiple (or zero) files with your wildcard *.mp4 (and I don't know what effect that has). Maybe try narrowing down your issue by executing the command with a single file .mp4 file.
I tried it before with only one specific file without wildcards.
_____
¹ Konsole is a terminal emulator, i.e. a program that imitates a text terminal, providing a user interface to the text-based applications running inside. One of those applications is the shell, a command line interpreter where you execute commands.
Offline
OK, I guess I can see more or less how it works.
So now your issue is that if you specify a template file, it is ignored?
Could you please post the command you run? (also, check that the template file actually exists and the path is correct)
Offline
OK, I guess I can see more or less how it works.
So now your issue is that if you specify a template file, it is ignored?
Correct!
Could you please post the command you run? (also, check that the template file actually exists and the path is correct)
mediainfo --Output="file://home/john-soda/try1.txt" *.mp4mediainfo --Output=file://home/john-soda/try1.txt *.mp4Tried both.
File exists. Path is correct. Permissions are 777.
the content of try1.txt is the code from this post
Developer himself
Thanks very much for your help!
Last edited by john-soda (2018-01-23 13:52:03)
Offline
OK problem solved. I have to add a third /.
It works with following command
mediainfo --Output=file:///home/john-soda/try1.txt *.mp4Thanks very much for your help!!!
Where can I learn more about the shell syntax? Do you have a link for me maybe?
Last edited by john-soda (2018-01-23 14:03:26)
Offline
If you actually used $HOME as you indicated in your previous posts, it would have the third slash (as $HOME starts with a slash).
This is why we expect that, in support threads, you post your complete command and output.
As to learning about your shell, google. But for bash, this is probably the best you could find:
http://mywiki.wooledge.org/BashGuide
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline