Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > New and alternative a/v containers

Reply
 
Thread Tools Search this Thread Display Modes
Old 15th June 2007, 13:24   #181  |  Link
Zenitram
Registered User
 
Join Date: Aug 2002
Location: France, Paris
Posts: 657
Quote:
Originally Posted by JoeBG View Post
Hi,

I want to use the commandline tool to get variables for the stream length or the aspect ratio but I always fail.

For example: I have a AC3 stream and I want to have the lenght of it. Can someone give me a working commandline - many thanks.
For AC3 :
Command : MediaInfo --Inform=General;%PlayTime% FileName.ac3
Command : MediaInfo --Inform=Audio;%PlayTime% FileName.avi
Result : 1256960 (in milliseconds)
Command : MediaInfo --Inform=Audio;%PlayTime/String% FileName.avi
Result : 20mn 56s

Note : during the verification of the command, I noticed that lenght in the audio part (MediaInfo --Inform=Audio;%PlayTime%) for an AC3 file is lacking. I will correct this.

For AspectRatio :
Command : MediaInfo.exe --Inform=Video;%AspectRatio% FileName.avi
Result : 1.777
Command : MediaInfo.exe --Inform=Video;%AspectRatio/String% FileName.avi
Result : 16/9

Command : MediaInfo --Info-Parameters
Result : list the available parameters (between %)
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo
Zenitram is offline   Reply With Quote
Old 16th June 2007, 09:17   #182  |  Link
JoeBG
stupid
 
JoeBG's Avatar
 
Join Date: Sep 2004
Location: Cologne
Posts: 638
First of all thanks for your help.

Here the results from my test.

I used the following commandline:
mediainfo --Inform=Video;%AspectRatio% C:\files\****\Daten\VTS_01_1.VOB

The result is the same as if I would have used
mediainfo --Inform C:\files\****\Daten\VTS_01_1.VOB

=> mediainfo.exe shows all informations and ignores *Video;%AspectRatio%*

I do have the same result with AC3 streams. mediainfo.exe shows always all informations and not the selected ones.

Maybe Im doing it wrong, but I used exactly your commandlines

Herewith my versions of mediainfo.exe and mediainfo.dll
__________________
cu

Joe
------------------------
freedom is just another word for nothing left to loose

Last edited by JoeBG; 16th June 2007 at 09:21.
JoeBG is offline   Reply With Quote
Old 16th June 2007, 10:17   #183  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,356
You do have to use the command-line version; the command-line commands don't work with the GUI. (They have the same name, which makes it unnecessarily confusing. I always rename mine mediainfo-cli.exe. Even nicer would be if the GUI recognized cli commands and emulated it, removing the need for two executables...)
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. ~ Ed Howdershelt
foxyshadis is offline   Reply With Quote
Old 16th June 2007, 10:31   #184  |  Link
JoeBG
stupid
 
JoeBG's Avatar
 
Join Date: Sep 2004
Location: Cologne
Posts: 638
Quote:
Originally Posted by foxyshadis View Post
You do have to use the command-line version; the command-line commands don't work with the GUI. (They have the same name, which makes it unnecessarily confusing. I always rename mine mediainfo-cli.exe. Even nicer would be if the GUI recognized cli commands and emulated it, removing the need for two executables...)
I do use the commandline version
__________________
cu

Joe
------------------------
freedom is just another word for nothing left to loose
JoeBG is offline   Reply With Quote
Old 16th June 2007, 10:56   #185  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,356
Weird then, because the commands work on any files I can find. (With the exception of the error Zenitram already found.)
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. ~ Ed Howdershelt
foxyshadis is offline   Reply With Quote
Old 16th June 2007, 11:06   #186  |  Link
Zenitram
Registered User
 
Join Date: Aug 2002
Location: France, Paris
Posts: 657
Quote:
Originally Posted by JoeBG View Post
=> mediainfo.exe shows all informations and ignores *Video;%AspectRatio%*

Maybe Im doing it wrong, but I used exactly your commandlines
I tested *your* version of MediaInfo on my files, and it works
Maybe a problem with your OS, your localization, I don't know.
I don't know what to do more
I propose you contact me at zen@mediaarea.net for giving me an access to your computer, and I will do more tests.

Quote:
Originally Posted by foxyshadis View Post
Weird then, because the commands work on any files I can find. (With the exception of the error Zenitram already found.)
Yes, weird... Sometimes, I hate programming

Quote:
Originally Posted by foxyshadis View Post
You do have to use the command-line version; the command-line commands don't work with the GUI. (They have the same name, which makes it unnecessarily confusing. I always rename mine mediainfo-cli.exe. Even nicer would be if the GUI recognized cli commands and emulated it, removing the need for two executables...)
I already tested to have different names, GUI users want a short name rather than mediainfo-gui, CLI users too, so impossible to have all people happy (and you are the first user I know who use both! )
But yes, the GUI version will parse CLI options in the future.
(but I didn't plan my software would become so used and this is my first program, I must work a lot to have a all people happy, with a good programming, and whith the time I have...)
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo
Zenitram is offline   Reply With Quote
Old 16th June 2007, 16:44   #187  |  Link
JoeBG
stupid
 
JoeBG's Avatar
 
Join Date: Sep 2004
Location: Cologne
Posts: 638
Quote:
Originally Posted by Zenitram View Post
I tested *your* version of MediaInfo on my files, and it works
Maybe a problem with your OS, your localization, I don't know.
I used a bat-file in my tests. When I type everything in my cmd-box without using a batchfile everything works for me too. Very strange everything

My plan is to use the variable %PlayTime% for further actions in DOS. But I think I cannot use it as %PlayTime% for further calculations isnt it?
__________________
cu

Joe
------------------------
freedom is just another word for nothing left to loose

Last edited by JoeBG; 16th June 2007 at 16:50.
JoeBG is offline   Reply With Quote
Old 9th October 2007, 08:52   #188  |  Link
mihakase
Registered User
 
Join Date: Apr 2007
Posts: 3
The current syntax to get particular parameters using Inform is a little odd in Linux. Bash interprets the semicolon as the end of a command/line and tries to execute whatever comes after it.

Workaround is currently:
MediaInfo --Inform=xxx\;%param% file.ext
mihakase is offline   Reply With Quote
Old 9th October 2007, 09:21   #189  |  Link
Zenitram
Registered User
 
Join Date: Aug 2002
Location: France, Paris
Posts: 657
Quote:
Originally Posted by mihakase View Post
The current syntax to get particular parameters using Inform is a little odd in Linux. Bash interprets the semicolon as the end of a command/line and tries to execute whatever comes after it.

Workaround is currently:
MediaInfo --Inform=xxx\;%param% file.ext
the ";" is useful because I use internaly CSV format (semi-colomn, as in Europe...).
I don't plan to change this soon.
You can use a file too:
MediaInfo --Inform=file://SpecFile file.ext
And SpecFile contains "xxx;%param%"

If I add an option for accepting commas too, will it be better?
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo
Zenitram is offline   Reply With Quote
Old 9th October 2007, 09:33   #190  |  Link
mihakase
Registered User
 
Join Date: Apr 2007
Posts: 3
Commas would be nice. I personally don't mind the semicolon but I figured the behaviour was worth noting anyway.

On a side note, I'm looking through mediainfo lib's source; trying to figure out how it gets an FLV's dimensions since I kind of need to implement that in php. It would probably help if I were a bit more competent though... no go as of yet.
mihakase is offline   Reply With Quote
Old 9th October 2007, 11:18   #191  |  Link
Zenitram
Registered User
 
Join Date: Aug 2002
Location: France, Paris
Posts: 657
Quote:
Originally Posted by mihakase View Post
On a side note, I'm looking through mediainfo lib's source; trying to figure out how it gets an FLV's dimensions since I kind of need to implement that in php. It would probably help if I were a bit more competent though... no go as of yet.
In PHP, it will be diffucult to call MediaInfo library (written in C/C++), why don't you use mediainfo command line?
I heard about several user who call mediainfo from PHP without problems.
./mediainfo --Inform=Video;%Width% %Height% for example.
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo
Zenitram is offline   Reply With Quote
Old 9th October 2007, 15:36   #192  |  Link
GrofLuigi
Member of a Library
 
Join Date: Oct 2002
Posts: 463
On another note, since many programs use MediaInfo dll now, can it be placed in a path directory to avoid multiple copies and for better updating? (On Windows)

Will that affect these programs (I guess only their authors would know)?

GL
GrofLuigi is offline   Reply With Quote
Old 9th October 2007, 15:40   #193  |  Link
Zenitram
Registered User
 
Join Date: Aug 2002
Location: France, Paris
Posts: 657
Quote:
Originally Posted by GrofLuigi View Post
On another note, since many programs use MediaInfo dll now, can it be placed in a path directory to avoid multiple copies and for better updating? (On Windows)

Will that affect these programs (I guess only their authors would know)?

GL
How DLL works on Windows:
- Search in the .exe directory
- Search in the path

If you delete yourself the .dll in the porgram directory, the program will search in the path.

this is not a problem from the DLL, but from any third-party programs mainteners.

For MediaInfo (the GUI), the status of MediaInfo.dll is not "stable", so I prefer to not force updating. After, others do what they want.

When MediaInfo.dll is more stable, I may propose to install in a shared directory. Not now. (the version 0.x, not 1.x ;-) )
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo
Zenitram is offline   Reply With Quote
Old 22nd November 2007, 18:37   #194  |  Link
ficofico
Registered User
 
Join Date: Nov 2006
Posts: 146
edit, sorry

Last edited by ficofico; 23rd November 2007 at 23:32.
ficofico is offline   Reply With Quote
Old 25th November 2007, 22:11   #195  |  Link
vlada
Registered User
 
Join Date: Apr 2003
Location: Czech Republic
Posts: 752
I was using MediaInfo in my PHP-GTK application from command line. No I decided to move a little further and switch to Python. I heard somewhere it should be possible to use a C/C++ dll in Python. Does anyone have any idea (or code sample) how to use the mediainfo.dll in Python?
vlada is offline   Reply With Quote
Old 26th November 2007, 02:30   #196  |  Link
Thunderbolt8
Registered User
 
Join Date: Sep 2006
Posts: 2,161
would it be possible that mediainfo could give the length of both, audio and video stream inside a container file? dont know which of these 2 is meant with the general "length" info of the file.

Last edited by Thunderbolt8; 26th November 2007 at 02:33.
Thunderbolt8 is offline   Reply With Quote
Old 27th November 2007, 23:57   #197  |  Link
vlada
Registered User
 
Join Date: Apr 2003
Location: Czech Republic
Posts: 752
I made Python load MediaInfo.dll through ctypes. But when I try to call the function result = lib.MediaInfo_Open("video.avi"), then Python complains there are not enough parameters for the function. What other parameters should be there?

Sorry for probably stupid questions, I'm just a beginner.
vlada is offline   Reply With Quote
Old 28th November 2007, 03:56   #198  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,356
You have to use:

handle=lib.MediaInfo_New();
result=lib.MediaInfo_Open(handle,"video.avi")
MediaInfo_Delete(handle)

now.
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. ~ Ed Howdershelt
foxyshadis is offline   Reply With Quote
Old 29th November 2007, 15:09   #199  |  Link
vlada
Registered User
 
Join Date: Apr 2003
Location: Czech Republic
Posts: 752
I've already tried this, but it gives me the same error:



Any ideas what's wrong?
vlada is offline   Reply With Quote
Old 2nd December 2007, 22:27   #200  |  Link
vlada
Registered User
 
Join Date: Apr 2003
Location: Czech Republic
Posts: 752
A friend of mine wrote a Python wrapper for the .dll so it is solved. I didn't have the time to dive into the code yet, I just verified it works. If anyone's interested in it, let me know.

Anyway I have another problem. I'm not sure if MediaInfo is supposed to handle elemantary streams, but I think it usually does. I have a h.264 stream demuxed from AVCHD camcorder. MediaInfo 0.7.5.5 reports it as an AC3 audio. A sample can be downloaded here (7 MB).
vlada is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 20:12.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.