Dorian Fevrier's blog - Mot-clé - dossiersJe m’appelle FEVRIER Dorian, je suis infographiste 3D passionné par mon métier, l’informatique en général, l’internet, la programmation et l’évolution de tout ce petit monde. Vous trouverez sur ce blog des tutoriaux, mes coups de cœurs, avis, etc.2024-01-02T23:48:05+01:00FEVRIER Dorianurn:md5:695d9c73474c33ce3dab043823509c4bDotclearMediaInfo: Lire les informations des fichiers vidéo et audio en ligne de commande. (Part 1)urn:md5:223559d7b59df02bc7e7a0df3650c17a2009-11-28T18:07:00+01:002013-07-26T22:38:01+02:00NarannScript et codedossiersfichiersfrligne de commandemediainfoproductionpythonquicktime<p><img src="https://www.fevrierdorian.com/blog/public/billets/mediainfo/MediaInfo001.png" alt="MediaInfo001.png" style="float:left; margin: 0 1em 1em 0;" title="MediaInfo001.png, nov. 2009" height="150" width="150" />Ce fut la colle de la semaine: "Comment lister le nombre d'image des fichiers Quicktime d'un dossier"...</p>
<p>Mine de rien, récupérer ce genre de données est récurent lors d'une prod mais il n'est pas aisé de trouver des informations sur "comment procéder". Vous pouvez faire <del>votre guignol</del> comme moi, à savoir, essayer de trouver des informations sur le header d'un fichier Quicktime mais, d'une, je n'ai pas trouvé, et si bien même j'avais réussi, j'aurai été incapable de le coder (j'ai essayé parce que je suis un dur à cuire mais nan... J'ai pas réussi... :baffed: ). Je vous propose une solution que j'ai trouvé, qui n'est surement pas la meilleur, mais que je vais garder de coté tant elle s'adapte à beaucoup de type de fichiers. Mon secret c'eeeesssttt <del>Starlight!</del> <a href="http://downloads.sourceforge.net/mediainfo/MediaInfo_CLI_0.7.25_Windows_i386.zip">MediaInfo CLI</a>!</p> <p>Ce tuto ce décomposera en deux parties. La première (celle ci) vous expliquera comment récupérer le nombre d'image d'un seul fichier Quicktime avec MediaInfo CLI. La seconde partie utilisera Python pour afficher les images de tout les fichiers Quicktime d'un dossier.</p>
<h5>Sommaire</h5>
<p>Le tuto étant un peu long, je vous propose un petit sommaire:</p>
<ul>
<li><a href="https://www.fevrierdorian.com/blog/post/2009/10/20/MediaInfo%3A-Lire-les-informations-des-fichiers-vid%C3%A9o-et-audio-en-ligne-de-commande.#mediaInfo_donne_des_infos_sur_des_medias">MediaInfo, donne des infos sur?... Des Medias...</a></li>
<li><a href="https://www.fevrierdorian.com/blog/post/2009/10/20/MediaInfo%3A-Lire-les-informations-des-fichiers-vid%C3%A9o-et-audio-en-ligne-de-commande.#finger_in_the_nose">Finger in the nose?</a></li>
<li><a href="https://www.fevrierdorian.com/blog/post/2009/10/20/MediaInfo%3A-Lire-les-informations-des-fichiers-vid%C3%A9o-et-audio-en-ligne-de-commande.#cherche_nb_image_quicktime">A la recherche du nombre d'image d'un fichier Quicktaaaaaïïïïme</a></li>
<li><a href="https://www.fevrierdorian.com/blog/post/2009/10/20/MediaInfo%3A-Lire-les-informations-des-fichiers-vid%C3%A9o-et-audio-en-ligne-de-commande.#on_avance">On avance!</a></li>
<li><a href="https://www.fevrierdorian.com/blog/post/2009/10/20/MediaInfo%3A-Lire-les-informations-des-fichiers-vid%C3%A9o-et-audio-en-ligne-de-commande.#presque">Presque</a></li>
<li><a href="https://www.fevrierdorian.com/blog/post/2009/10/20/MediaInfo%3A-Lire-les-informations-des-fichiers-vid%C3%A9o-et-audio-en-ligne-de-commande.#les_liens">Les liens</a></li>
</ul>
<h5>MediaInfo, donne des infos sur?... Des Medias... <a name="mediaInfo_donne_des_infos_sur_des_medias"></a></h5>
<p>MediaInfo, comme son nom ne l'indique absolument pas, permet de lire les metatags d'un grand nombre de type de fichier. Les types supportés étant relativement nombreux, je ne vais pas tous vous les lister (Vous pouvez toutefois y accéder <a href="http://mediainfo.sourceforge.net/fr/Support/Formats" hreflang="en">ici</a>).</p>
<p>De base le logiciel à une interface graphique (GUI) mais il dispose également d'une interface en ligne de commande (Command Line Interface, CLI) et c'est précisément celle ci qui nous interesse.</p>
<p>En effet, il est assez fréquent d'avoir un programme qui vous permet de faire des choses intéressantes mais uniquement en passant par l'interface graphique. Vous ne pouvez donc pas exploiter ses informations de manière automatisé (Quicktime Player si tu nous regarde: :IFuckTheWorld: ).</p>
<h5>Finger in the nose? <a name="finger_in_the_nose"></a></h5>
<p>Pas tant que ça. En effet, MediaInfo CLI récupère un grand nombre d'informations mais dispose d'un system de "trie" pour isoler les informations qui nous intéressent. Nous allons donc voir comment obtenir le nombre d'image d'un fichier Quicktime. C'est partie!</p>
<h5>A la recherche du nombre d'image d'un fichier Quicktaaaaaïïïïme <a name="cherche_nb_image_quicktime"></a></h5>
<p>Le premier reflexe quand on utilise une CLI, c'est de lui donner le fichier en argument.</p>
<pre>
C:\MediaInfo_CLI_0.7.23_Windows_i386\MediaInfo.exe C:\MediaInfo_CLI_0.7.23_Windows_i386\E05P005.mov
General
Complete name : C:\MediaInfo_CLI_0.7.23_Windows_i386\E05P005.mov
Format : MPEG-4
Format profile : QuickTime
Codec ID : qt
File size : 457 MiB
Duration : 3s 80ms
Overall bit rate : 1 244 Mbps
Encoded date : UTC 2009-11-25 08:34:33
Tagged date : UTC 2009-11-25 08:35:17
Writing library : Apple QuickTime
Video
ID : 1
Format : raw
Codec ID : raw
Duration : 3s 80ms
Bit rate mode : Constant
Bit rate : 1 244 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 fps
Bits/(Pixel*Frame) : 24.000
Stream size : 457 MiB (100%)
Title : Module de gestion vidéo / Gestionnaire d'alias Apple
Encoded date : UTC 2009-11-25 08:34:33
Tagged date : UTC 2009-11-25 08:35:17</pre>
<p>Comme vous pouvez le voir, ce n'est pas trop ce qu'on attendait... Donc, non ce n'est pas tout pourris en revanche le réflexe qui consiste à mettre le fichier en argument à la première utilisation, oui...</p>
<p>Le "bon" réflexe était donc:</p>
<pre>
C:\MediaInfo_CLI_0.7.23_Windows_i386\MediaInfo.exe -h
MediaInfo Command line,
MediaInfoLib - v0.7.23
Usage: "MediaInfo [-Options...] FileName1 [Filename2...]"
Options:
--Help, -h Display this help and exit
--Help-Inform Display help for Inform= option
--Help-AnOption Display help for "AnOption"
--Version Display MediaInfo version and exit
--Full , -f Full information Display (all internal tags)
--Output=HTML Full information Display with HTML tags
--Output=XML Full information Display with XML tags
--Inform=... Template defined information Display
--Info-Parameters Display list of Inform= parameters
--Language=raw Display non-translated unique identifiers (internal text)
--LogFile=... Save the output in the specified file
</pre>
<p>On est pas plus avancé mais vous aurez surement remarqué le "flag" --Full, -f.
On recommence:</p>
<pre>
C:\MediaInfo_CLI_0.7.23_Windows_i386\MediaInfo.exe -f C:\MediaInfo_CLI_0.7.23_Windows_i386\E05P005.mov
General
Count : 259
Count of stream of this kind : 1
Kind of stream : General
Kind of stream : General
Stream identifier : 0
Count of video streams : 1
Video_Format_List : raw
Video_Format_WithHint_List : raw
Codecs Video : RGB
Complete name : C:\MediaInfo_CLI_0.7.23_Windows_i386\E05P005.mov
Folder name : C:\MediaInfo_CLI_0.7.23_Windows_i386
File name : E05P005
File extension : mov
Format : MPEG-4
Format : MPEG-4
Format/Extensions usually used : mp4 m4v m4a m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v
Format profile : QuickTime
Codec ID : qt
Codec ID/Url : http://www.apple.com/quicktime/download/standalone.html
Codec : MPEG-4
Codec : MPEG-4
Codec/Extensions usually used : mp4 m4v m4a m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v
File size : 479077948
File size : 457 MiB
File size : 457 MiB
File size : 457 MiB
File size : 457 MiB
File size : 456.9 MiB
Duration : 3080
Duration : 3s 80ms
Duration : 3s 80ms
Duration : 3s 80ms
Duration : 00:00:03.080
Overall bit rate : 1244358306
Overall bit rate : 1 244 Mbps
Stream size : 76348
Stream size : 74.6 KiB (0%)
Stream size : 75 KiB
Stream size : 75 KiB
Stream size : 74.6 KiB
Stream size : 74.56 KiB
Stream size : 74.6 KiB (0%)
Proportion of this stream : 0.00016
Encoded date : UTC 2009-11-25 08:34:33
Tagged date : UTC 2009-11-25 08:35:17
File creation date : UTC 2009-11-19 12:49:28.322
File creation date (local) : 2009-11-19 13:49:28.322
File last modification date : UTC 2009-11-25 08:35:25.545
File last modification date (loc : 2009-11-25 09:35:25.545
Writing library : Apple QuickTime
Writing library : Apple QuickTime
Writing library/Name : Apple QuickTime
Video
Count : 146
Count of stream of this kind : 1
Kind of stream : Video
Kind of stream : Video
Stream identifier : 0
ID : 1
ID : 1
Format : raw
Codec ID : raw
Codec : raw
Codec : RGB
Codec/Family : RGB
Codec/Info : Full Frames (Uncompressed)
Codec/Url : http://www.apple.com/quicktime/download/standalone.html
Codec/CC : raw
Duration : 3080
Duration : 3s 80ms
Duration : 3s 80ms
Duration : 3s 80ms
Duration : 00:00:03.080
Bit rate mode : CBR
Bit rate mode : Constant
Bit rate : 1244160000
Bit rate : 1 244 Mbps
Width : 1920
Width : 1 920 pixels
Height : 1080
Height : 1 080 pixels
Pixel aspect ratio : 1.000
Display aspect ratio : 1.778
Display aspect ratio : 16:9
Rotation : 0.000
Frame rate mode : CFR
Frame rate mode : Constant
Frame rate : 25.000
Frame rate : 25.000 fps
Frame count : 77
Bits/(Pixel*Frame) : 24.000
Stream size : 479001600
Stream size : 457 MiB (100%)
Stream size : 457 MiB
Stream size : 457 MiB
Stream size : 457 MiB
Stream size : 456.8 MiB
Stream size : 457 MiB (100%)
Proportion of this stream : 0.99984
Title : Module de gestion vidéo / Gestionnaire d'alias Apple
Encoded date : UTC 2009-11-25 08:34:33
Tagged date : UTC 2009-11-25 08:35:17</pre>
<p>Il est lààààà!!!! Je le vois!!!!!!! :bravo:</p>
<p>Donc oui, il est présent sur la ligne:</p>
<pre>
Frame count : 77</pre>
<p>Maintenant l'objectif va être de faire en sorte que le programme ne renvois QUE cette ligne... Avec Linux, un petit grep et on en parle plus :hehe: mais voila, on est sous Windows alors on prie pour que l'auteur du soft ait déjà intégré ça dans sont programme... Et oui! C'est le cas! Il est possible d'isoler une information spécifique. Le tout, c'est d'y arriver...</p>
<h5>On avance! <a name="on_avance"></a></h5>
<p>Je ne vais pas vous faire poireauter plus longtemps, le flag qui permet d'afficher une information précise est "--Inform=..." le tout est de trouver le nom de ce qu'on souhaite afficher (Et non, il ne suffit pas d'écrire "Frame count"... Mais presque :sourit: ).</p>
<p>Pour lister les différentes infos qu'il est possible d'afficher:</p>
<pre>
C:\MediaInfo_CLI_0.7.23_Windows_i386\MediaInfo.exe --Info-Parameters C:\MediaInfo_CLI_0.7.23_Windows_i386\E05P005.mov
General
Count : Number of objects available in this stream
StreamCount : Number of streams of this kind available
StreamKind : Stream type name
StreamKind/String : Stream type name
StreamKindID : Number of the stream (base=0)
StreamKindPos : When multiple streams, number of the stream (base=1)
Inform : Last **Inform** call
ID : The ID for this stream in this file
ID/String : The ID for this stream in this file
UniqueID : The unique ID for this stream, should be copied with stream copy
MenuID : The menu ID for this stream in this file
MenuID/String : The menu ID for this stream in this file
GeneralCount : Number of general streams
VideoCount : Number of video streams
AudioCount : Number of audio streams
TextCount : Number of text streams
ChaptersCount : Number of chapters streams
ImageCount : Number of image streams
MenuCount : Number of menu streams
Video_Format_List : Video Codecs in this file, separated by /
Video_Format_WithHint_Lis : Video Codecs in this file with popular name (hint), separated by /
Video_Codec_List : Deprecated, do not use in new projects
Video_Language_List : Video languagesin this file, full names, separated by /
Audio_Format_List : Audio Codecs in this file,separated by /
Audio_Format_WithHint_Lis : Audio Codecs in this file with popular name (hint), separated by /
Audio_Codec_List : Deprecated, do not use in new projects
Audio_Language_List : Audio languages in this file separated by /
Text_Format_List : Text Codecs in this file, separated by /
Text_Format_WithHint_List : Text Codecs in this file with popular name (hint),separated by /
Text_Codec_List : Deprecated, do not use in new projects
Text_Language_List : Text languages in this file, separated by /
Chapters_Format_List : Chapters Codecs in this file, separated by /
Chapters_Format_WithHint_ : Chapters Codecs in this file with popular name (hint), separated by /
Chapters_Codec_List : Deprecated, do not use in new projects
Chapters_Language_List : Chapters languages in this file, separated by /
Image_Format_List : Image Codecs in this file, separated by /
Image_Format_WithHint_Lis : Image Codecs in this file with popular name (hint), separated by /
Image_Codec_List : Deprecated, do not use in new projects
Image_Language_List : Image languages in this file, separated by /
Menu_Format_List : Menu Codecsin this file, separated by /
Menu_Format_WithHint_List : Menu Codecs in this file with popular name (hint),separated by /
Menu_Codec_List : Deprecated, do not use in new projects
Menu_Language_List : Menu languages in this file, separated by /
CompleteName : Complete name (Folder+Name+Extension)
FolderName : Folder name only
FileName : File name only
FileExtension : File extension only
Format : Format used
Format/String : Deprecated, do not use in new projects
Format/Info : Info about this Format
Format/Url : Link to a description of this format
Format/Extensions : Known extensions of this format
Format_Version : Version of this format
Format_Profile : Profile of the Format
Format_Settings : Settings needed for decoder used
CodecID : Codec ID (found in some containers)
CodecID/Info : Info about this codec
CodecID/Hint : A hint/popular name for this codec
CodecID/Url : A link to more details about this codec ID
CodecID_Description : Manual description given by the container
Interleaved : If Audio and video are muxed
Codec : Deprecated, do not use in new projects
Codec/String : Deprecated, do not use in new projects
Codec/Info : Deprecated, do not use in new projects
Codec/Url : Deprecated, do not use in new projects
Codec/Extensions : Deprecated, do not use in new projects
Codec_Settings : Deprecated, do not use in new projects
Codec_Settings_Automatic : Deprecated, do not use in new projects
FileSize : File size in bytes
FileSize/String : File size (with measure)
FileSize/String1 : File size (with measure, 1 digit mini)
FileSize/String2 : File size (with measure, 2 digit mini)
FileSize/String3 : File size (with measure, 3 digit mini)
FileSize/String4 : File size (with measure, 4 digit mini)
Duration : Play time of the stream in ms
Duration/String : Play time in format : XXx YYy only, YYy omited if zero
Duration/String1 : Play time in format : HHh MMmn SSs MMMms, XX omited if zero
Duration/String2 : Play time in format : XXx YYy only, YYy omited if zero
Duration/String3 : Play time in format : HH:MM:SS.MMM
Duration_Start
Duration_End
OverallBitRate_Mode : Bit rate mode of all streams (VBR, CBR)
OverallBitRate_Mode/Strin : Bit rate mode of all streams (Variable, Constant)
OverallBitRate : Bit rate of all streams in bps
OverallBitRate/String : Bit rate of all streams (with measure)
OverallBitRate_Minimum : Minimum Bit rate in bps
OverallBitRate_Minimum/St : Minimum Bit rate (with measurement)
OverallBitRate_Nominal : Nominal Bit rate in bps
OverallBitRate_Nominal/St : Nominal Bit rate (with measurement)
OverallBitRate_Maximum : Maximum Bit rate in bps
OverallBitRate_Maximum/St : Maximum Bit rate (with measurement)
StreamSize : Stream size in bytes
StreamSize/String
StreamSize/String1
StreamSize/String2
StreamSize/String3
StreamSize/String4
StreamSize/String5 : With proportion
StreamSize_Proportion : Stream size divided by file size
HeaderSize
DataSize
FooterSize
Album_ReplayGain_Gain : The gain to apply to reach 89dB SPL on playback
Album_ReplayGain_Gain/String
Album_ReplayGain_Peak : The maximum absolute peak value of the item
Encryption
Title : (Generic)Title of file
Title/More : (Generic)More info about the title of file
Title/Url : (Generic)Url
Domain : Univers movies belong to, e.g. Starwars, Stargate, Buffy, Dragonballs
Collection : Name of the series, e.g. Starwars movies, Stargate SG-1, Stargate Atlantis, Buffy, Angel
Season : Name of the season, e.g. Strawars first Trilogy, Season 1
Season_Position : Number of the Season
Season_Position_Total : Place of the season e.g. 2 of 7
Movie : Name of the movie. Eg : Starwars, a new hope
Movie/More : More infos about the movie
Movie/Country : Country, where the movie was procuced
Movie/Url : Homepage for the movie
Album : Name of an audio-album. Eg : The joshua tree
Album/More : More infos about the album
Album/Sort
Comic : Name of the comic.
Comic/More
Comic/Position_Total
Part : Name of the part. e.g. CD1, CD2
Part/Position : Number of the part
Part/Position_Total : Place of the part e.g. 2 of 3
Track : Name of the track. e.g. track1, track 2
Track/More : More infos about the track
Track/Url : Link to a site about this track
Track/Sort
Track/Position : Number of this track
Track/Position_Total : Place of this track, e.g. 3 of 15
Chapter : Name of the chapter.
SubTrack : Name of the subtrack.
Original/Album : Original name of album, serie...
Original/Movie : Original name of the movie
Original/Part : Original name of the part in the original support
Original/Track : Original name of the track in the original support
Performer : Main performer/artist of this file
Performer/Sort
Performer/Url : Homepage of the performer/artist
Original/Performer : Original artist(s)/performer(s).
Accompaniment : Band/orchestra/accompaniment/musician.
Composer : Name of the original composer.
Composer/Nationality : Nationality of the main composer of the item, mostly for classical music.
Arranger : The person who arranged the piece. e.g. Ravel.
Lyricist : The person who wrote the lyrics for a musical item.
Original/Lyricist : Original lyricist(s)/text writer(s).
Conductor : The artist(s) who performed the work. In classical music this would be the conductor, orchestra, soloists.
Director : Name of the director.
AssistantDirector : Name of the assistant director.
DirectorOfPhotography : The name of the director of photography, also known as cinematographer.
SoundEngineer : The name of the sound engineer or sound recordist.
ArtDirector : The person who oversees the artists and craftspeople who build the sets.
ProductionDesigner : The person responsible for designing the Overall visual appearance of a movie.
Choregrapher : The name of the choregrapher.
CostumeDesigner : The name of the costume designer.
Actor : Real name of an actor or actress playing a role in the movie.
Actor_Character : Name of the character an actor or actress plays in this movie.
WrittenBy : The author of the story or script.
ScreenplayBy : The author of the screenplay or scenario (used for movies and TV shows).
EditedBy : Editors name
CommissionedBy : name of the person or organization that commissioned the subject of the file
Producer : Name of the producer of the movie.
CoProducer : The name of a co-producer.
ExecutiveProducer : The name of an executive producer.
MusicBy : Main music-artist for a movie
DistributedBy : Company the item is mainly distributed by
OriginalSourceForm/Distri : Name of the person or organization who supplied the original subject
MasteredBy : The engineer who mastered the content for a physical medium or for digital distribution.
EncodedBy : Name of the person or organisation that encoded/ripped the audio file.
RemixedBy : Name of the artist(s), that interpreted, remixed, or otherwise modified the item.
ProductionStudio : Main production studio
ThanksTo : A very general tag for everyone else that wants to be listed.
Publisher : Name of the organization publishing the album (i.e. the 'record label') or movie.
Publisher/URL : Publishers official webpage.
Label : Brand or trademark associated with the marketing of music recordings and music videos.
Genre : The main genre of the audio or video. e.g. classical, ambient-house, synthpop, sci-fi, drama, etc.
Mood : Intended to reflect the mood of the item with a few keywords, e.g. Romantic, Sad, Uplifting, etc.
ContentType : The type of the item. e.g. Documentary, Feature Film, Cartoon, Music Video, Music, Sound FX, etc.
Subject : Describes the topic of the file, such as Aerial view of Seattle..
Description : A short description of the contents, such as Two birds flying.
Keywords : Keywords to the item separated by a comma, used for searching.
Summary : A plot outline or a summary of the story.
Synopsis : A description of the story line of the item.
Period : Describes the period that the piece is from or about. e.g. Renaissance.
LawRating : Depending on the country it's the format of the rating of a movie (P, R, X in the USA, an age in other countries or a URI
defining a logo).
LawRating_Reason : Reason for the law rating
ICRA : The ICRA rating. (Previously RSACi)
Released_Date : The date/year that the item was released.
Original/Released_Date : The date/year that the item was originaly released.
Recorded_Date : The time/date/year that the recording began.
Encoded_Date : The time/date/year that the encoding of this item was completed began.
Tagged_Date : The time/date/year that the tags were done for this item.
Written_Date : The time/date/year that the composition of the music/script began.
Mastered_Date : The time/date/year that the item was tranfered to a digitalmedium.
File_Created_Date : The time that the file was created on the file system
File_Created_Date_Local : The time that the file was created on the file system (Warning: this field depends of local configuration, do not use it in an international database)
File_Modified_Date : The time that the file was modified on the file system
File_Modified_Date_Local : The time that the file was modified on the file system (Warning: this field depends of local configuration, do not use it in an international database)
Recorded_Location : Location where track was recorded. (See COMPOSITION_LOCATION for format)
Written_Location : Location that the item was originaly designed/written. Information should be stored in the following format: country code, state/province, city where the coutry code is the same 2 octets as in Internet domains, or possibly ISO-3166. e.g. US, Texas, Austin or US, , Austin.
Archival_Location : Location, where an item is archived, e.eg. Louvre,Paris,France
Encoded_Application : Name of the software package used to create the file, such as Microsoft WaveEdit.
Encoded_Application/Url : Name of the software package used to create the file, such as Microsoft WaveEdit.
Encoded_Library : Software used to create the file
Encoded_Library/String : Software used to create the file
Encoded_Library/Name : Name of the the encoding-software
Encoded_Library/Version : Version of encoding-software
Encoded_Library/Date : Release date of software
Encoded_Library_Settings : Parameters used by the software
Cropped : Describes whether an image has been cropped and, if so, how it was cropped.
Dimensions : Specifies the size of the original subject of the file. eg 8.5 in h, 11 in w
DotsPerInch : Stores dots per inch setting of the digitizer used to produce the file
Lightness : Describes the changes in lightness settings on the digitizer required to produce the file
OriginalSourceMedium : Original medium of the material, e.g. vinyl, Audio-CD, Super8 or BetaMax
OriginalSourceForm : Original form of the material, e.g. slide, paper, map
OriginalSourceForm/NumCol : Number of colors requested when digitizing, e.g. 256 for images or 32 bit RGB for video
OriginalSourceForm/Name : Name of the product the file was originally intended for
OriginalSourceForm/Croppe : Describes whether an image has been cropped and, if so, how it was cropped. e.g. 16:9 to 4:3, top and bottom
OriginalSourceForm/Sharpn : Identifies the changes in sharpness for the digitizer requiered to produce the file
Tagged_Application : Software used to tag this file
BPM : Average number of beats per minute
ISRC : International Standard Recording Code, excluding the ISRC prefix and including hyphens.
ISBN : International Standard Book Number.
BarCode : EAN-13 (13-digit European Article Numbering) or UPC-A (12-digit Universal Product Code) bar code identifier.
LCCN : Library of Congress Control Number.
CatalogNumber : A label-specific catalogue number used to identify the release. e.g. TIC 01.
LabelCode : A 4-digit or 5-digit number to identify the record label, typically printed as (LC) xxxx or (LC) 0xxxx on CDs medias or co
vers, with only the number being stored.
Owner : Owner of the file
Copyright : Copyright attribution.
Copyright/Url : Link to a site with copyright/legal information.
Producer_Copyright : The copyright information as per the productioncopyright holder.
TermsOfUse : License information, e.g., All Rights Reserved,Any Use Permitted.
ServiceName
ServiceChannel
Service/Url
ServiceProvider
ServiceProviderr/Url
ServiceType
NetworkName
OriginalNetworkName
Country
TimeZone
Cover : Is there a cover
Cover_Description : short descriptio, e.g. Earth in space
Cover_Type
Cover_Mime
Cover_Data : Cover, in binary format encoded BASE64
Lyrics : Text of a song
Comment : Any comment related to the content.
Rating : A numeric value defining how much a person likes the song/movie. The number is between 0 and 5 with decimal values possible (e.g. 2.7), 5(.0) being the highest possible rating.
Added_Date : Date/year the item was added to the owners collection
Played_First_Date : The date, the owner first played an item
Played_Last_Date : The date, the owner last played an item
Played_Count : Number of times an item was played
EPG_Positions_Begin
EPG_Positions_End
Video
Count : Number of objects available in this stream
StreamCount : Number of streams of this kind available
StreamKind : Stream type name
StreamKind/String : Stream type name
StreamKindID : Number of the stream (base=0)
StreamKindPos : When multiple streams, number of the stream (base=1)
Inform : Last **Inform** call
ID : The ID for this stream in this file
ID/String : The ID for this stream in this file
UniqueID : The unique ID for this stream, should be copied with stream copy
MenuID : The menu ID for this stream in this file
MenuID/String : The menu ID for this stream in this file
Format : Format used
Format/Info : Info about Format
Format/Url : Link
Format_Version : Version of this format
Format_Profile : Profile of the Format
Format_Settings : Settings needed for decoder used, summary
Format_Settings_BVOP : Settings needed for decoder used, detailled
Format_Settings_BVOP/Stri : Settings needed for decoder used, detailled
Format_Settings_QPel : Settings needed for decoder used, detailled
Format_Settings_QPel/Stri : Settings needed for decoder used, detailled
Format_Settings_GMC : Settings needed for decoder used, detailled
Format_Settings_GMC/String
Format_Settings_Matrix : Settings needed for decoder used, detailled
Format_Settings_Matrix/St : Settings needed for decoder used, detailled
Format_Settings_Matrix_Da : Matrix, in binary format encoded BASE64. Order = intra, non-intra, gray intra, gray non-intra
Format_Settings_CABAC : Settings needed for decoder used, detailled
Format_Settings_CABAC/Str : Settings needed for decoder used, detailled
Format_Settings_RefFrames : Settings needed for decoder used, detailled
Format_Settings_RefFrames : Settings needed for decoder used, detailled
Format_Settings_Pulldown : Settings needed for decoder used, detailled
MuxingMode : How this file is muxed in the container
CodecID : Codec ID (found in some containers)
CodecID/Info : Info on the codec
CodecID/Hint : Hint/popular name for this codec
CodecID/Url : Homepage for more details about this codec
CodecID_Description : Manual description given by the container
Codec : Deprecated, do not use in new projects
Codec/String : Deprecated, do not use in new projects
Codec/Family : Deprecated, do not use in new projects
Codec/Info : Deprecated, do not use in new projects
Codec/Url : Deprecated, do not use in new projects
Codec/CC : Deprecated, do not use in new projects
Codec_Profile : Deprecated, do not use in new projects
Codec_Description : Deprecated, do not use in new projects
Codec_Settings : Deprecated, do not use in new projects
Codec_Settings_PacketBitS : Deprecated, do not use in new projects
Codec_Settings_BVOP : Deprecated, do not use in new projects
Codec_Settings_QPel : Deprecated, do not use in new projects
Codec_Settings_GMC : Deprecated, do not use in new projects
Codec_Settings_GMC/String : Deprecated, do not use in new projects
Codec_Settings_Matrix : Deprecated, do not use in new projects
Codec_Settings_Matrix_Dat : Deprecated, do not use in new projects
Codec_Settings_CABAC : Deprecated, do not use in new projects
Codec_Settings_RefFrames : Deprecated, do not use in new projects
Duration : Play time of the stream in ms
Duration/String : Play time in format : XXx YYy only, YYy omited if zero
Duration/String1 : Play time in format : HHh MMmn SSs MMMms, XX omited if zero
Duration/String2 : Play time in format : XXx YYy only, YYy omited if zero
Duration/String3 : Play time in format : HH:MM:SS.MMM
BitRate_Mode : Bit rate mode (VBR, CBR)
BitRate_Mode/String : Bit rate mode (Variable, Cconstant)
BitRate : Bit rate in bps
BitRate/String : Bit rate (with measurement)
BitRate_Minimum : Minimum Bit rate in bps
BitRate_Minimum/String : Minimum Bit rate (with measurement)
BitRate_Nominal : Nominal Bit rate in bps
BitRate_Nominal/String : Nominal Bit rate (with measurement)
BitRate_Maximum : Maximum Bit rate in bps
BitRate_Maximum/String : Maximum Bit rate (with measurement)
Width : Width in pixel
Width/String : Width with measurement (pixel)
Height : Height in pixel
Height/String : Width with measurement (pixel)
PixelAspectRatio : Pixel Aspect ratio
PixelAspectRatio/String : Pixel Aspect ratio
PixelAspectRatio_Original : Original (in the raw stream) Pixel Aspect ratio
PixelAspectRatio_Original : Original (in the raw stream) Pixel Aspect ratio
DisplayAspectRatio : Display Aspect ratio
DisplayAspectRatio/String : Display Aspect ratio
DisplayAspectRatio_Origin : Original (in the raw stream) Display Aspect ratio
DisplayAspectRatio_Origin : Original (in the raw stream) Display Aspect ratio
Rotation : Rotation
Rotation/String : Rotation (if not horizontal)
FrameRate_Mode : Frame rate mode (CFR, VFR)
FrameRate_Mode/String : Frame rate mode (Constant, Variable)
FrameRate : Frames per second
FrameRate/String : Frames per second (with measurement)
FrameRate_Minimum : Minimum Frames per second
FrameRate_Minimum/String : Minimum Frames per second (with measurement)
FrameRate_Nominal : Nominal Frames per second
FrameRate_Nominal/String : Nominal Frames per second (with measurement)
FrameRate_Maximum : Maximum Frames per second
FrameRate_Maximum/String : Maximum Frames per second (with measurement)
FrameRate_Original : Original (in the raw stream) Frames per second
FrameRate_Original/String : Original (in the raw stream) Frames per second (with measurement)
FrameCount : Number of frames
Standard : NTSC or PAL
Resolution : 16/24/32
Resolution/String : 16/24/32 bits
Colorimetry
ScanType
ScanType/String
ScanOrder
ScanOrder/String
Interlacement : Deprecated, do not use in new projects
Interlacement/String : Deprecated, do not use in new projects
Bits-(Pixel*Frame) : bits/(Pixel*Frame) (like Gordian Knot)
Delay : Delay fixed in the stream (relative) IN MS
Delay/String : Delay with measurement
Delay/String1 : Delay with measurement
Delay/String2 : Delay with measurement
Delay/String3 : format : HH:MM:SS.MMM
Delay_Settings : Delay settings (in case of timecode for example)
Delay_Original : Delay fixed in the raw stream (relative) IN MS
Delay_Original/String : Delay with measurement
Delay_Original/String1 : Delay with measurement
Delay_Original/String2 : Delay with measurement
Delay_Original/String3 : format : HH:MM:SS.MMM
Delay_Original_Settings : Delay settings (in case of timecode for example)
StreamSize : Stream size in bytes
StreamSize/String : Streamsize in with percentage value
StreamSize/String1 : Streamsize with measurement
StreamSize/String2 : Streamsize with measurement
StreamSize/String3 : Streamsize with measurement
StreamSize/String4 : Streamsize with measurement
StreamSize/String5 : Streamsize in with percentage value
StreamSize_Proportion : Stream size divided by file size
Alignment : How this stream file is aligned in the container
Alignment/String
Title : Name of the track
Encoded_Application : Software. Identifies the name of the software package used to create the file, such as Microsoft WaveEdit.
Encoded_Application/Url : Software. Identifies the name of the software package used to create the file, such as Microsoft WaveEdit.
Encoded_Library : Software used to create the file
Encoded_Library/String : Software used to create the file
Encoded_Library/Name : Info from the software
Encoded_Library/Version : Version of software
Encoded_Library/Date : Release date of software
Encoded_Library_Settings : Parameters used by the software
Language : Language (2-letter ISO 639-1 if exists, else 3-letter ISO 639-2, and with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn)
Language/String : Language (full)
Language_More : More info about Language (e.g. Director's Comment)
Encoded_Date : UTC time that the encoding of this item was completed began.
Tagged_Date : UTC time that the tags were done for this item.
Encryption
Audio
Count : Number of objects available in this stream
StreamCount : Number of streams of this kind available
StreamKind : Stream type name
StreamKind/String : Stream type name
StreamKindID : Number of the stream (base=0)
StreamKindPos : When multiple streams, number of the stream (base=1)
Inform : Last **Inform** call
ID : The ID of this stream in this file
ID/String : The ID of this stream in this file
UniqueID : A unique ID for this stream, should be copied with stream copy
MenuID : The menu ID for this stream in this file
MenuID/String : The menu ID for this stream in this file
Format : Format used
Format/Info : Info about the format
Format/Url : Homepage of this format
Format_Version : Version of this format
Format_Profile : Profile of this Format
Format_Settings : Settings needed for decoder used, summary
Format_Settings_SBR
Format_Settings_SBR/String
Format_Settings_PS
Format_Settings_PS/String
Format_Settings_Floor
Format_Settings_Firm
Format_Settings_Endianness
Format_Settings_Sign
Format_Settings_Law
Format_Settings_ITU
MuxingMode : How this stream is muxed in the container
MuxingMode_MoreInfo : More info (text) about the muxing mode
CodecID : Codec ID (found in some containers)
CodecID/Info : Info about codec ID
CodecID/Hint : Hint/popular name for this codec ID
CodecID/Url : Homepage for more details about this codec ID
CodecID_Description : Manual description given by the container
Codec : Deprecated, do not use in new projects
Codec/String : Deprecated, do not use in new projects
Codec/Family : Deprecated, do not use in new projects
Codec/Info : Deprecated, do not use in new projects
Codec/Url : Deprecated, do not use in new projects
Codec/CC : Deprecated, do not use in new projects
Codec_Description : Deprecated, do not use in new projects
Codec_Profile : Deprecated, do not use in new projects
Codec_Settings : Deprecated, do not use in new projects
Codec_Settings_Automatic : Deprecated, do not use in new projects
Codec_Settings_Floor : Deprecated, do not use in new projects
Codec_Settings_Firm : Deprecated, do not use in new projects
Codec_Settings_Endianness : Deprecated, do not use in new projects
Codec_Settings_Sign : Deprecated, do not use in new projects
Codec_Settings_Law : Deprecated, do not use in new projects
Codec_Settings_ITU : Deprecated, do not use in new projects
Duration : Play time of the stream
Duration/String : Play time in format : XXx YYy only, YYy omited if zero
Duration/String1 : Play time in format : HHh MMmn SSs MMMms, XX omited if zero
Duration/String2 : Play time in format : XXx YYy only, YYy omited if zero
Duration/String3 : Play time in format : HH:MM:SS.MMM
BitRate_Mode : Bit rate mode (VBR, CBR)
BitRate_Mode/String : Bit rate mode (Constant, Variable)
BitRate : Bit rate in bps
BitRate/String : Bit rate (with measurement)
BitRate_Minimum : Minimum Bit rate in bps
BitRate_Minimum/String : Minimum Bit rate (with measurement)
BitRate_Nominal : Nominal Bit rate in bps
BitRate_Nominal/String : Nominal Bit rate (with measurement)
BitRate_Maximum : Maximum Bit rate in bps
BitRate_Maximum/String : Maximum Bit rate (with measurement)
Channel(s) : Number of channels
Channel(s)/String : Number of channels (with measurement)
ChannelPositions : Position of channels
ChannelPositions/String2 : Position of channels (x/y.z format)
SamplingRate : Sampling rate
SamplingRate/String : in KHz
SamplingCount : Frame count
Resolution : Resolution in bits (8, 16, 20, 24)
Resolution/String : n bits
CompressionRatio : Current stream size divided by uncompressed stream size
Delay : Delay fixed in the stream (relative)
Delay/String : Delay in format : XXx YYy only, YYy omited if zero
Delay/String1 : Delay in format : HHh MMmn SSs MMMms, XX omited if zero
Delay/String2 : Delay in format : XXx YYy only, YYy omited if zero
Delay/String3 : Delay in format : HH:MM:SS.MMM
Delay_Original : Delay fixed in the raw stream (relative) IN MS
Delay_Original/String : Delay with measurement
Delay_Original/String1 : Delay with measurement
Delay_Original/String2 : Delay with measurement
Delay_Original/String3 : format : HH:MM:SS.MMM
Delay_Original_Settings : Delay settings (in case of timecode for example)
Video_Delay : Delay fixed in the stream (absolute / video)
Video_Delay/String
Video_Delay/String1
Video_Delay/String2
Video_Delay/String3
Video0_Delay : Deprecated, do not use in new projects
Video0_Delay/String : Deprecated, do not use in new projects
Video0_Delay/String1 : Deprecated, do not use in new projects
Video0_Delay/String2 : Deprecated, do not use in new projects
Video0_Delay/String3 : Deprecated, do not use in new projects
ReplayGain_Gain : The gain to apply to reach 89dB SPL on playback
ReplayGain_Gain/String
ReplayGain_Peak : The maximum absolute peak value of the item
StreamSize : Streamsize in bytes
StreamSize/String : Streamsize in with percentage value
StreamSize/String1
StreamSize/String2
StreamSize/String3
StreamSize/String4
StreamSize/String5 : Streamsize in with percentage value
StreamSize_Proportion : Stream size divided by file size
Alignment : How this stream file is aligned in the container
Alignment/String : Where this stream file is aligned in the container
Interleave_VideoFrames : Between how many video frames the stream is inserted
Interleave_Duration : Between how much time (ms) the stream is inserted
Interleave_Duration/Strin : Between how much time and video frames the stream is inserted (with measurement)
Interleave_Preload : How much time is buffered before the first video frame
Interleave_Preload/String : How much time is buffered before the first video frame (with measurement)
Title : Name of the track
Encoded_Library : Software used to create the file
Encoded_Library/String : Software used to create the file
Encoded_Library/Name : Info from the software
Encoded_Library/Version : Version of software
Encoded_Library/Date : Release date of software
Encoded_Library_Settings : Parameters used by the software
Language : Language (2-letter ISO 639-1 if exists, else 3-letter ISO 639-2, and with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn)
Language/String : Language (full)
Language_More : More info about Language (e.g. Director's Comment)
Encoded_Date : UTC time that the encoding of this item was completed began.
Tagged_Date : UTC time that the tags were done for this item.
Encryption
Text
Count : Count of objects available in this stream
StreamCount : Count of streams of that kind available
StreamKind : Stream type name
StreamKind/String : Stream type name
StreamKindID : Number of the stream (base=0)
StreamKindPos : When multiple streams, number of the stream (base=1)
Inform : Last **Inform** call
ID : A ID for this stream in this file
ID/String : A ID for this stream in this file
UniqueID : A unique ID for this stream, should be copied with stream copy
MenuID : A menu ID for this stream in this file
MenuID/String : A menu ID for this stream in this file
Format : Format used
Format/Info : Info about Format
Format/Url : Link
Format_Version : Version of this format
Format_Profile : Profile of the Format
Format_Settings : Settings needed for decoder used
MuxingMode : How this stream is muxed in the container
MuxingMode_MoreInfo : More info (text) about the muxing mode
CodecID : Codec ID (found in some containers)
CodecID/Info : Info about codec ID
CodecID/Hint : A hint for this codec ID
CodecID/Url : A link for more details about this codec ID
CodecID_Description : Manual description given by the container
Codec : Deprecated
Codec/String : Deprecated
Codec/Info : Deprecated
Codec/Url : Deprecated
Codec/CC : Deprecated
Duration : Play time of the stream
Duration/String : Play time (formated)
Duration/String1 : Play time in format : HHh MMmn SSs MMMms, XX omited if zero
Duration/String2 : Play time in format : XXx YYy only, YYy omited if zero
Duration/String3 : Play time in format : HH:MM:SS.MMM
BitRate_Mode : Bit rate mode (VBR, CBR)
BitRate_Mode/String : Bit rate mode (Constant, Variable)
BitRate : Bit rate in bps
BitRate/String : Bit rate (with measurement)
BitRate_Minimum : Minimum Bit rate in bps
BitRate_Minimum/String : Minimum Bit rate (with measurement)
BitRate_Nominal : Nominal Bit rate in bps
BitRate_Nominal/String : Nominal Bit rate (with measurement)
BitRate_Maximum : Maximum Bit rate in bps
BitRate_Maximum/String : Maximum Bit rate (with measurement)
Width : Width
Width/String
Height : Height
Height/String
FrameCount : Frame count
Resolution
Resolution/String
Delay : Delay fixed in the stream (relative)
Delay/String
Delay/String1
Delay/String2
Delay/String3
Delay_Original : Delay fixed in the raw stream (relative) IN MS
Delay_Original/String : Delay with measurement
Delay_Original/String1 : Delay with measurement
Delay_Original/String2 : Delay with measurement
Delay_Original/String3 : format : HH:MM:SS.MMM
Delay_Original_Settings : Delay settings (in case of timecode for example)
Video_Delay : Delay fixed in the stream (absolute / video)
Video_Delay/String
Video_Delay/String1
Video_Delay/String2
Video_Delay/String3
Video0_Delay : Deprecated
Video0_Delay/String : Deprecated
Video0_Delay/String1 : Deprecated
Video0_Delay/String2 : Deprecated
Video0_Delay/String3 : Deprecated
StreamSize : Stream size in bytes
StreamSize/String
StreamSize/String1
StreamSize/String2
StreamSize/String3
StreamSize/String4
StreamSize/String5 : With proportion
StreamSize_Proportion : Stream size divided by file size
Title : Name of the track
Encoded_Library : Software used to create the file
Encoded_Library/String : Software used to create the file
Encoded_Library/Name : Info from the software
Encoded_Library/Version : Version of software
Encoded_Library/Date : Release date of software
Encoded_Library_Settings : Parameters used by the software
Language : Language (2-letter ISO 639-1 if exists, else 3-letter ISO 639-2, and with optional ISO 3166-1 country separated by a dash
if available, e.g. en, en-us, zh-cn)
Language/String : Language (full)
Language_More : More info about Language (e.g. Director's Comment)
Summary
Encoded_Date : The time that the encoding of this item was completed began.
Tagged_Date : The time that the tags were done for this item.
Encryption
Chapters
Count : Count of objects available in this stream
StreamCount : Count of streams of that kind available
StreamKind : Stream type name
StreamKind/String : Stream type name
StreamKindID : Number of the stream (base=0)
StreamKindPos : When multiple streams, number of the stream (base=1)
Inform : Last **Inform** call
ID : A ID for this stream in this file
ID/String : A ID for this stream in this file
UniqueID : A unique ID for this stream, should be copied with stream copy
MenuID : The menu ID for this stream in this file
MenuID/String : The menu ID for this stream in this file
Format : Format used
Format/Info : Info about Format
Format/Url : Link
Codec : Deprecated
Codec/String : Deprecated
Codec/Info : Deprecated
Codec/Url : Deprecated
Total : Total number of chapters
Title : Name of the track
Language : Language (2-letter ISO 639-1 if exists, else 3-letter ISO 639-2, and with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn)
Language/String : Language (full)
Image
Count : Count of objects available in this stream
StreamCount : Count of streams of that kind available
StreamKind : Stream type name
StreamKind/String : Stream type name
StreamKindID : Number of the stream (base=0)
StreamKindPos : When multiple streams, number of the stream (base=1)
Inform : Last **Inform** call
ID : A ID for this stream in this file
ID/String : The ID for this stream in this file
UniqueID : A unique ID for this stream, should be copied with stream copy
MenuID : The menu ID for this stream in this file
MenuID/String : The menu ID for this stream in this file
Title : Name of the track
Format : Format used
Format/Info : Info about Format
Format/Url : Link
Format_Version : Version of this format
Format_Profile : Profile of the Format
Format_Settings : Settings needed for decoder used
CodecID : Codec ID (found in some containers)
CodecID/Info : Info about codec ID
CodecID/Hint : A hint for this codec ID
CodecID/Url : A link for more details about this codec ID
CodecID_Description : Manual description given by the container
Codec : Deprecated
Codec/String : Deprecated
Codec/Family : Deprecated
Codec/Info : Deprecated
Codec/Url : Deprecated
Width : Width
Width/String
Height : Height
Height/String
Resolution
Resolution/String
StreamSize : Stream size in bytes
StreamSize/String
StreamSize/String1
StreamSize/String2
StreamSize/String3
StreamSize/String4
StreamSize/String5 : With proportion
StreamSize_Proportion : Stream size divided by file size
Encoded_Library : Software used to create the file
Encoded_Library/String : Software used to create the file
Encoded_Library/Name : Info from the software
Encoded_Library/Version : Version of software
Encoded_Library/Date : Release date of software
Encoded_Library_Settings : Parameters used by the software
Language : Language (2-letter ISO 639-1 if exists, else 3-letter ISO 639-2, and with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn)
Language/String : Language (full)
Summary
Encoded_Date : The time that the encoding of this item was completed began.
Tagged_Date : The time that the tags were done for this item.
Encryption
Menu
Count : Count of objects available in this stream
StreamCount : Count of streams of that kind available
StreamKind : Stream type name
StreamKind/String : Stream type name
StreamKindID : Number of the stream (base=0)
StreamKindPos : When multiple streams, number of the stream (base=1)
Inform : Last **Inform** call
ID : A ID for this stream in this file
ID/String : A ID for this stream in this file
UniqueID : A unique ID for this stream, should be copied with stream copy
MenuID : A menu ID for this stream in this file
MenuID/String : A menu ID for this stream in this file
Format : Format used
Format/Info : Info about Format
Format/Url : Link
Format_Version : Version of this format
Format_Profile : Profile of the Format
Format_Settings : Settings needed for decoder used
CodecID : Codec ID (found in some containers)
CodecID/Info : Info about this codec
CodecID/Hint : A hint/popular name for this codec
CodecID/Url : A link to more details about this codec ID
CodecID_Description : Manual description given by the container
Codec : Deprecated
Codec/String : Deprecated
Codec/Info : Deprecated
Codec/Url : Deprecated
List_StreamKind : List of programs available
List_StreamPos : List of programs available
List : List of programs available
List/String : List of programs available
Title : Name of this menu
Language : Language (2-letter ISO 639-1 if exists, else 3-letter ISO 639-2, and with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn)
Language/String : Language (full)
Language_More : More info about Language (e.g. Director's Comment)
ServiceName
ServiceChannel
Service/Url
ServiceProvider
ServiceProviderr/Url
ServiceType
NetworkName
Original/NetworkName
Countries
TimeZones
Chapters_Pos_Begin : Used by third-party developpers to know about the begining of the chapters list, to be used by Get(Stream_Menu, x, Pos), where Pos is an Integer between Chapters_Pos_Begin and Chapters_Pos_End
Chapters_Pos_End : Used by third-party developpers to know about the end of the chapters list (this position excluded)</pre>
<p>Ouai moi j'suis comme ça moi... :enerve:</p>
<h5>Presque <a name="presque"></a></h5>
<p>Vous remarquerez assez vite que l'information qu'on cherche semble s'appeler "FrameCount". C'est en effet ça sauf que vous remarquerez peut être aussi qu'il y a plusieurs "FrameCount". Si vous cherchez un peut vous voyez qu'il y a plusieurs "catégories":</p>
<ul>
<li>General</li>
<li>Video</li>
<li>Audio</li>
<li>Text</li>
<li>Chapters</li>
<li>Image</li>
<li>Menu</li>
</ul>
<p>Celle qui nous intéresse est bien entendu Video. Ce rapport à la "catégorie" est important car si vous indiquez "FrameCount" sans indiquer la catégorie, il ne s'en sortira pas... :mechantCrash:</p>
<p>La ligne à taper est donc (Je ne me rappel plus vraiment comment j'en suis arrivé là mais je crois que c'est pas "évident" à comprendre car il n'y a pas d'exemple):</p>
<pre>
C:\MediaInfo_CLI_0.7.23_Windows_i386\MediaInfo.exe --Inform=Video;%FrameCount% C:\MediaInfo_CLI_0.7.23_Windows_i386\E05P005.mov
77</pre>
<p>Notre fichier fait donc 77 images... La grande classe! :laClasse:</p>
<p>Nous savons maintenant extraire le nombre d'image d'un fichier Quicktime (et ducoups, tout autre fichier vidéo supporté). Dans un prochain billet. Je vous proposerai de passer à Python et d'étendre ce que nous venons de voir à l'échelle d'un dossier complet car il y a quelques subtilités.</p>
<h5>Les liens: <a name="les_liens"></a></h5>
<ul>
<li><a href="http://mediainfo.sourceforge.net/fr" hreflang="fr">Site Officiel</a></li>
<li><a href="https://sourceforge.net/projects/mediainfo/" hreflang="en">Page Sourceforge</a></li>
<li><a href="http://downloads.sourceforge.net/mediainfo/MediaInfo_CLI_0.7.25_Windows_i386.zip">Télécharger la version CLI de MediaInfo</a></li>
</ul>
<p>A bientôt!</p>Appliquer un script à toutes les scenes Maya du dossierurn:md5:c316289bd40a97c6e54a594daa9504c22009-05-29T22:20:00+02:002013-07-26T22:40:20+02:00NarannScript et codebatbatchbidouilledossiersfichiersfrmayamelpatchscript<p><img src="https://www.fevrierdorian.com/blog/public/billets/patchFolderScene/patchFolderScene003.png" alt="patchFolderScene003.png" style="float:left; margin: 0 1em 1em 0;" title="patchFolderScene003.png, mai 2009" height="90" width="90" />Il peut arriver en cours de prod d'avoir à appliquer un petite modification sur un grand nombre de scène (en général quand on en arrive là c'est qu'on a des failles dans les rouages quelque part :siffle: ). Je vous propose donc ici un méthode (il y en à d'autres) qui se révèle assez simple pour appliquer un script à l'intégralité des scènes d'un dossier.</p> <h5>Le principe</h5>
<p>Comme vous le savez surement déjà, vous pouvez lancez maya en ligne de commande. Pour plus d'information, <a href="http://fr.wikipedia.org/wiki/RTFM" hreflang="fr">RTFM</a>! Allez dans l'aide Maya:</p>
<blockquote><p>User Guide > General > Basics > Interface overview > Work with menu items, tools, and options > Start Maya from the command line</p></blockquote>
<p>Nous allons donc créer un batch qui lance Maya et exécute un script.</p>
<p>Nous auront besoin de trois choses choses:</p>
<ol>
<li>Un premier .bat: Qui contiendra les commandes maya que Windows exécute.</li>
<li>Un .mel: Qui sera le script exécuté par Maya à l'ouverture.</li>
<li>Un second .bat: Qui appellera le premier bat une fois pour chaque fichier du dossier.</li>
</ol>
<p>On pourrait s'y prendre avec un seul .bat mais ça complexifie un peu l'écriture.</p>
<h5>On approfondi</h5>
<p>La ligne de commande du premier bat ressemble grosso modo à ça (patchFolderScenes.bat):</p>
<pre class="dos dos">maya -batch -script <monSuperScript.mel> -file <maSceneMaya.ma></pre>
<p>Le script (monSuperScript.mel):</p>
<pre class="mel mel">proc monSuperScript<span style="color: #009900;">(</span><span style="color: #009900;">)</span> <span style="color: #666666; font-style: italic;">//declaration de la procedure</span>
<span style="color: #009900;">{</span>
print<span style="color: #009900;">(</span><span style="color: #ff0000;">"patchFolderScenes -> Launched...<span style="color: #000099; font-weight: bold;">\n</span>"</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//on affiche le message de demarrage (facultatif)</span>
<span style="color: #666666; font-style: italic;">//mes commandes mel</span>
file <span style="color: #339933;">-</span>save<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//on sauvegarde à la fin sinon les modifications ne seront pas apporté à la scene</span>
print<span style="color: #009900;">(</span><span style="color: #ff0000;">"patchFolderScenes -> Finished...<span style="color: #000099; font-weight: bold;">\n</span>"</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//on affiche le message de fin (facultatif)</span>
<span style="color: #009900;">}</span>
monSuperScript<span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//on lance la procedure</span></pre>
<p>Et pour finir, le second bat qui lancera le premier pour chaque scène maya du dossier en cours (applyPatchToAllScenes.bat):</p>
<pre class="dos dos"><span style="color: #00b100; font-weight: bold;">for</span> <tout les fichier .ma ou .mb> <span style="color: #00b100; font-weight: bold;">do</span> <span style="color: #00b100; font-weight: bold;">call</span> patchFolderScenes.bat <nom du fichier></pre>
<p>C'est celui là qu'on lancera.</p>
<h5>Du concret</h5>
<p>Bon, maintenant que vous connaissez le principe, nous allons appliquer tout ça.</p>
<p>Je vous propose de créer un fichier test.bat et de l'ouvrir avec un éditeur de texte.
<img src="https://www.fevrierdorian.com/blog/public/billets/patchFolderScene/patchFolderScene001.png" alt="patchFolderScene001.png" style="display:block; margin:0 auto;" title="patchFolderScene001.png, mai 2009" height="107" width="177" />
Il existe des "trucs" (désolé, j'ai pas trouvé d'autres noms) pour afficher les répertoires. Je m'explique:</p>
<p>En batch, les fichiers argument sont des variables écrites comme ça:</p>
<pre>%1 << Premier argument du bat
%2 << Second argument du bat
etc...</pre>
<p>Taper dans votre test.bat:</p>
<pre class="dos dos"><span style="color: #b1b100; font-weight: bold;">echo</span> <span style="color: #33cc33;">%</span><span style="color: #448888;">1</span>
<span style="color: #b1b100; font-weight: bold;">pause</span></pre>
<ol>
<li>Ouvrez un invite de commande Windows</li>
<li>Cliquez-glissez votre test.bat</li>
<li>Mettez un espace</li>
<li>Glissez un fichier quelconque derrière</li>
<li>Lancez tous ça!</li>
</ol>
<pre class="dos dos">C:\Documents and Settings\user\testFolder>test.bat monfichier.txt
C:\Documents and Settings\user\testFolder>echo monfichier.txt
monfichier.txt
C:\Documents and Settings\user\testFolder>pause
Appuyez sur une touche pour continuer...</pre>
<p>Maintenant, mettez:</p>
<pre class="dos dos"><span style="color: #b1b100; font-weight: bold;">echo</span> <span style="color: #33cc33;">%</span><span style="color: #448888;">0</span>
<span style="color: #b1b100; font-weight: bold;">pause</span></pre>
<p>Lancez le:</p>
<pre class="dos dos">C:\Documents and Settings\user\testFolder>test.bat
C:\Documents and Settings\user\testFolder>echo test.bat
test.bat
C:\Documents and Settings\user\testFolder>pause
Appuyez sur une touche pour continuer...</pre>
<p>Oooh... Surprise...
%0 correspondau fichier bat lui même.</p>
<h5>Ça me fait une belle jambe...</h5>
<p>Du calme, ce n'est pas tout :sourit:</p>
<p>"~" (tilde) suivi d'une lettre (cf: <a href="http://www.rdpslides.com/publiclinks/FAQ00138.htm" hreflang="en">petite documentation</a>) va nous permettre de récupérer le chemin du répertoire.</p>
<pre>%~0 -> Enlève les guillemets si il y en a.
%~f0 -> C:\Documents and Settings\user\testFolder\test.bat
%~d0 -> C:
%~p0 -> \Documents and Settings\user\testFolder\
%~n0 -> test
%~x0 -> .bat
%~s0 -> C:\DOCUME~1\user\TESTFO~1\test.bat
%~a0 -> --a------ (les attributs du fichier)
%~t0 -> 29/05/2009 22:06 (Date de la dernière modification... Pratique hein? ;) )
%~z0 -> 9 (taille en octet, pratique aussi)</pre>
<p>Vous l'aurez compris:</p>
<pre class="dos dos"><span style="color: #b1b100; font-weight: bold;">echo</span> <span style="color: #33cc33;">%</span><span style="color: #448888;">~dp0</span>
<span style="color: #b1b100; font-weight: bold;">pause</span></pre>
<p>Donne:</p>
<pre class="dos dos">C:\Documents and Settings\user\testFolder>test.bat
C:\Documents and Settings\user\testFolder>echo C:\Documents and Settings\user\testFolder\
C:\Documents and Settings\user\testFolder\
C:\Documents and Settings\user\testFolder>pause
Appuyez sur une touche pour continuer...</pre>
<p>Nous avons maintenant le dossier dans lequel on exécute le bat!</p>
<p>Pour simplifier la procédure, nous allons considérer que votre .mel à exécuter se trouve dans le même répertoire que le .bat :hehe: .</p>
<p>Donc:</p>
<pre class="dos dos"><span style="color: #b1b100; font-weight: bold;">echo</span> <span style="color: #33cc33;">%</span>~dp0monSuperScript.mel
<span style="color: #b1b100; font-weight: bold;">pause</span></pre>
<p>Donne:</p>
<pre class="dos dos">C:\Documents and Settings\user\testFolder>test.bat
C:\Documents and Settings\user\testFolder>echo C:\Documents and Settings\user\testFolder\monSuperScript.mel
C:\Documents and Settings\user\testFolder\monSuperScript.mel
C:\Documents and Settings\user\testFolder>pause
Appuyez sur une touche pour continuer...</pre>
<p>On viens de récupérer le chemin du script qu'on souhaite exécuter. Nous n'avons plus qu'a stocker cette information dans une variable:</p>
<pre class="dos dos"><span style="color: #b1b100; font-weight: bold;">SET</span> scriptPath=<span style="color: #33cc33;">%</span>~dp0patchFolderScenes.mel</pre>
<p>Écrire le début de la ligne de commande avec laquelle on appel Maya:</p>
<pre class="dos dos">maya -batch -script "<span style="color: #33cc33;">%</span><span style="color: #448888;">scriptPath</span><span style="color: #33cc33;">%</span>"</pre>
<p>Ajouter l'argument "file" pour dire quel fichier il doit ouvrir</p>
<pre class="dos dos">maya -batch -script "<span style="color: #33cc33;">%</span><span style="color: #448888;">scriptPath</span><span style="color: #33cc33;">%</span>" -file <span style="color: #33cc33;">%</span><span style="color: #448888;">1</span></pre>
<p>Rappelez vous, %1 est le premier argument donné après le bat.</p>
<p>Votre test.bat:</p>
<pre class="dos dos"><span style="color: #b1b100; font-weight: bold;">SET</span> scriptPath=<span style="color: #33cc33;">%</span>~dp0patchFolderScenes.mel
maya -batch -script "<span style="color: #33cc33;">%</span><span style="color: #448888;">scriptPath</span><span style="color: #33cc33;">%</span>" -file <span style="color: #33cc33;">%</span><span style="color: #448888;">1</span></pre>
<p>Si vous lancez:</p>
<pre class="dos dos">C:\Documents and Settings\user\testFolder>test.bat maScene.ma</pre>
<p>Vous aurez Maya qui ouvrira votre scène, lancera le script et quittera. Aussi simple que ça! Vous pouvez aussi cliquer glissez votre scène sur le .bat:</p>
<p><img src="https://www.fevrierdorian.com/blog/public/billets/patchFolderScene/patchFolderScene002.png" alt="patchFolderScene002.png" style="display:block; margin:0 auto;" title="patchFolderScene002.png, mai 2009" height="85" width="207" /></p>
<p>Renommez votre "test.bat" en "patchFolderScenes.bat".</p>
<p>Nous avons fait la moitié! Prochaine étape, faire un .bat qui appel patchFolderScenes.bat pour chaque fichier .ma ou .mb du fichier.</p>
<h5>Patch mes scènes j'te dis!</h5>
<p>Créez (toujours dans le même répertoire) un fichier "allPatchFolderScenes.bat" et ouvrez le avec un éditeur de texte.</p>
<p>Et là, attention, c'est du gros!</p>
<p>Dans un premier temps, nous allons apprendre à appeler un .bat depuis un autre .bat :hehe: . Pour cela, nous allons utiliser la commande "call" (sans déconner...). Créez un fichier "allPatchFolderScenes.bat" et entrez y:</p>
<pre class="dos dos"><span style="color: #00b100; font-weight: bold;">call</span> patchFolderScenes.bat maScene.ma</pre>
<p>Et double cliquez dessus. C'est comme si vous aviez lancez:</p>
<pre class="dos dos">C:\Documents and Settings\user\testFolder>patchFolderScenes.bat maScene.ma</pre>
<p>Maintenant, il faut intégrer ça à une boucle de batch.</p>
<h5>La boucle</h5>
<p>La boucle for en batch se fait sur une ligne...:baffed: La notre prendra la forme:</p>
<pre class="dos dos"><span style="color: #00b100; font-weight: bold;">for</span> <span style="color: #33cc33;">%%</span><span style="color: #448888;">f</span> <span style="color: #00b100; font-weight: bold;">in</span> <span style="color: #66cc66;">(</span>*.mb *.ma<span style="color: #66cc66;">)</span> <span style="color: #00b100; font-weight: bold;">do</span> <span style="color: #66cc66;">[</span>...pleins de choses...<span style="color: #66cc66;">]</span></pre>
<p>Cette boucle va récupérer tout les fichiers (sous la variable %%f) et faire: [...pleins de choses...] (En l'occurrence, vous l'aurez compris, un "call patchFolderScenes.bat maScene.ma")</p>
<p>Si vous êtes du genre pressez et que vous tapez:</p>
<pre class="dos dos"><span style="color: #00b100; font-weight: bold;">for</span> <span style="color: #33cc33;">%%</span><span style="color: #448888;">f</span> <span style="color: #00b100; font-weight: bold;">in</span> <span style="color: #66cc66;">(</span>*.mb *.ma<span style="color: #66cc66;">)</span> <span style="color: #00b100; font-weight: bold;">do</span> <span style="color: #00b100; font-weight: bold;">call</span> patchFolderScenes.bat <span style="color: #33cc33;">%%</span><span style="color: #448888;">f</span></pre>
<p>Vous aurez quelques soucis... En effet %%f est juste un nom de fichier. Et il lui faut un chemin complet vers un fichier.</p>
<p>Ni une, ni deux, je vous donne la méthode sans explications (La vérité c'est que je ne me souvient plus moi même comment je l'ai trouvé! :siffle: )</p>
<pre class="dos dos"><span style="color: #00b100; font-weight: bold;">for</span> <span style="color: #33cc33;">%%</span><span style="color: #448888;">f</span> <span style="color: #00b100; font-weight: bold;">in</span> <span style="color: #66cc66;">(</span>*.mb *.ma<span style="color: #66cc66;">)</span> <span style="color: #00b100; font-weight: bold;">do</span> <span style="color: #00b100; font-weight: bold;">call</span> patchFolderScenes.bat <span style="color: #33cc33;">%</span><span style="color: #33cc33;">%</span>~dpf<span style="color: #33cc33;">%%</span><span style="color: #448888;">f</span></pre>
<p>Vous n'avez plus qu'a double-cliquer sur "allPatchFolderScenes.bat" et il appellera, pour chaque fichier .ma ou .mb du dossier, "patchFolderScenes.bat" avec comme argument, le chemin de la scène.</p>
<p>Vous pouvez vous redresser et admirer votre ordinateur s'épuiser à ouvrir les 300 plans pour changer la couleur du poil de cul d'un des objet de vos scènes (que vous vous maudissez de ne pas avoir importé en référence externe pour le coup) parce que la femme de votre client à trouvé que c'était "mieux en rose bonbon sur font vert-fuschia"...</p>
<p>Bref, vous y trouverez surement un intérêt! En cas de problème n'hésitez pas à laisser un commentaire, j'ai testé la manipulation mais il se peut que j'ai oublié deux trois détails.</p>
<p>A bientôt!</p>
<p>Dorian</p>Tkinter: Vous aussi, faites des GUI en Python... Ouai, mes fesses ouai...urn:md5:530872bfaa7e3f875a1c8a456bce3cac2009-03-13T23:53:00+01:002013-07-26T22:41:38+02:00NarannScript et code32bits64bitsbidouilledossiersfichiersfiledialogfrocelotproductionpythonscripttrackingwxpython<p><img src="https://www.fevrierdorian.com/blog/public/ecureuilFileTrack/ecureuil_002.png" alt="ecureuil_002.png" style="float:left; margin: 0 1em 1em 0;" title="ecureuil_002.png, mar. 2009" height="150" width="150" />Travaillant actuellement sur un projet de <a href="http://fr.wikipedia.org/wiki/Michel_Ocelot" hreflang="fr">Michel Ocelot</a> (les incultes, cliquez sur le lien :bete: ), je fais une interface graphique pour un logiciel de "tracking de fichier". Ça consiste en gros à lister tous les fichiers d'un certain type (ex: ExxPxx_DecA.tif) dans une hiérarchie donnée (par exemple: Z:/Exx/Pxx/Decors) en ne changeant que quelques variables dans le chemin, ce qui permet d'avoir rapidement un aperçu de "qu'est-ce qu'il manque", de l'âge des fichiers, de savoir qui est plus récent que qui, etc... Super pratique donc! Mais je ne vais pas m'attarder sur le sujet trop longtemps (J'y reviendrai peut-être un jour si je fais une version "publique" et si ça intéresse quelqu'un...). Je voudrais vous parler de Python 3.0 et des problèmes que j'ai rencontrés (et que je rencontre encore à l'heure actuelle) concernant l'utilisation de tkinter. Problèmes qui se révèlent être un des cotés sombres de Python et des modules indépendants qui l'entourent.</p> <h5>Explications <a name="Explications"></a></h5>
<p>Comme je l'ai dit avant, <a href="https://www.fevrierdorian.com/blog/index.php?post/2008/12/23/Pyhton-dans-Maya...-Ou-l-inverse..." hreflang="fr">Python "cay bien"</a>, le seul problème ici c'est que j'ai fait le choix d'utiliser la version 3.0 qui n'est pas rétrocompatible... Cela dit, je m'en foutais dans la mesure où après avoir évalué mes besoins, je ne comptais utiliser que la ligne de commande (et je n'avais besoin que des librairies standards) :hehe: .</p>
<p>Bon, le projet commence, mes scripts marchent à merveille:</p>
<ul>
<li>Renommage des fichiers exportés par Final<del>caca</del>cut (Qu'on ne vienne pas me dire que Mac en prod ça déchire, j'ai un surplus d'arguments allant dans le sens inverse à gérer...)</li>
<li>Cherchage d'erreurs dans les nomenclatures des fichiers: "Pourquoi c'est là ça?", "Il manque un tiret à ton nom de fichier", etc...</li>
<li>Comparaison des fichiers et update par exécution de programme en ligne de commande automatiquement: "Fichier .tiff plus récent que fichier .map, conversion...", "Fichier .map absent mais fichier .tiff présent, conversion...", etc...</li>
<li>Frame "checkage": "Image E01P001_color.tiff de 0 octet", "Image E01P001_color.tiff de 128 octet -> Erreur mental ray probable", etc...</li>
</ul>
<p>Bref, que du bonheur... :youplaBoum:</p>
<h5>Toujours plus! <a name="Toujours_plus"></a></h5>
<p>Mais voila, au fur et à mesure de mon avancement, je me suis fait une lib de petites fonctions bien pratiques et j'ai voulu commencer à faire une petite interface graphique pour tout ça... En toute logique, je commence avec tkinter (une lib graphique vieille comme pas permis mais intégrée en standard à Python 3.0, je la trouve bien moins puissante que le mel, même pour des choses "simples"). Pour ce que je voulais faire (au début), c'était largement suffisant. Quelques colonnes et puis c'était bon...</p>
<p><img src="https://www.fevrierdorian.com/blog/public/ecureuilFileTrack/ecureuil_001.png" alt="ecureuil_001.png" style="display:block; margin:0 auto;" title="ecureuil_001.png, mar. 2009" height="372" width="628" /></p>
<p>Mais comme tout bon (ou mauvais) projet, on se met à vouloir (et devoir) faire évoluer son outil et les besoins en terme de "possibilités" grandissent... Bon, mon interface étant très simple, et voyant le truc venir, je commence à me tourner vers d'autres tool kits graphiques. Et là, je me prends un mur dans les dents (c'est l'effet Python 3.0), à savoir, tous les portages des librairies graphiques les plus connus sont actuellement sous Python 2.x. En effet, Python 3.0 n'était pas rétroactive, la plupart des projets sont frileux à l'idée de passer à la nouvelle version. J'ai trouvé <a href="http://lists.wxwidgets.org/pipermail/wxpython-users/2008-July/078115.html" hreflang="fr">un post</a> d'une personne qui semble être impliquée dans un projet (wxPython, on y reviendra) disant que le portage n'est pas prévu....</p>
<blockquote><p>- "Hi,
I was wondering if there are already any plans when or how wxPython
will support/start moving to python 3? Are there a lot of issues
involved with porting wxPython framework? (I don't mean user
programs.) I know it is still a bit early but as it is coming closer
maybe there is a roadmap already."</p>
<p>
- "Nothing solid yet. I've got a general idea of things that will likely
need to be done, but haven't yet confirmed any of it or done any real
investigations."</p></blockquote>
<p>Qu'a cela ne tienne, mes scripts étant relativement simples, je vire la version 3.0, installe la version 2.6.1 et corrige mes script pour les rendre compatibles: 15 minutes... Aux vues de l'investissement que ça représentait, je n'étais, à priori pas perdant au change dans la mesure où j'allais me retrouver avec une "vraie" lib graphique qui n'allait pas me limiter (comme le fait tkinter).</p>
<p>Après un aperçu rapide des <a href="http://python.developpez.com/outils/Librairies/?page=IHM" hreflang="fr">libs graphiques existantes</a> je remarque une certaine sympathie des utilisateurs pour la librairie <a href="http://www.wxpython.org/" hreflang="fr">wxPython</a>. En ayant déjà entendu parlé, je décide de m'y tenter.</p>
<h5>"Quand les emmerdes arrivent c'est moi qui interviens..." <a name="Quand_les_emmerdes_arrivent"></a></h5>
<p>J'installe tout ça (avec la "doc et démos" qui est extrêmement bien faite, et je pèse mes mots) et commence à lancer une fenêtre, tout marche bien mais dès que je place mon curseur sur la dite fenêtre, python plante (avec envois de rapport d'erreur et tout...). Je continue, utilise différents exemples... Défois ça marche, défois pas (ça fait très débordement de mémoire)... Je cherche sur le forum et je trouve un type <a href="http://www.developpez.net/forums/d697375/autres-langages/python-zope/gui/wxpython/pb-vista-p-python-2-6-p-wxpython/" hreflang="fr">dans le même cas que moi</a>, un système 64bits. Il renvoi à <a href="http://trac.wxwidgets.org/ticket/10082" hreflang="en">un rapport de bug</a>. Le problème est donc connu mais non résolu. C'est spécifique aux systèmes 64bits...</p>
<blockquote><p>"Same problem here with wxPython2.8-win32-unicode-2.8.9.1-py26 under Vista Ultimate x64. Simple applications crash as soon as one moves the mouse onto their window. More complicated applications seem to work fine. Even the demo crashes if you move the mouse onto the splashscreen. If you leave the mouse outside the spashscreen and let it disappear, the demo seams to run fine."</p></blockquote>
<p>Naïvement, je désinstalle mon wxPyhon et mon Python, tous deux en 64bits, puis réinstalle le tout en 32bits... Même problème. :mechantCrash:</p>
<p>Je commence à réfléchir aux alternatives et n'en voit qu'une seule: Passer à Python 2.5...</p>
<p>(Edit: Une personne <a href="http://morison.biz/technotes/articles/55" hreflang="en">semble avoir trouvé une solution</a> mais c'est pas ce qu'il y a de plus propre disons...)</p>
<p>Bon, là ça commence à me gonfler un peu. Après une longue réflexion, je décide de rester sous Python 3.0 avec tkinter. Pourquoi? J'en sais trop rien en fait... Ça me fait bizarre de repasser sous une ancienne version de Python. Mais surtout, j'ai pris conscience de quelque chose: le support est assuré uniquement sur les librairies standard... En gros, tous les portages ne sont pas assurés dans le temps (j'en veux pour preuve la grande quantité de lib python qui ne sont plus maintenus) ce qui fait que si on veut être sûr d'avoir quelques chose qui dure dans le temps, il faut rester sur les librairies standards.</p>
<h5>tkinter! <a name="tkinter"></a></h5>
<p>C'est ici que commence le billet en fait. Tout le début était une intro. :sauteJoie:</p>
<p>Je continue donc ma petite interface sous tkinter. Sauf que voila, la documentation est désastreuse...</p>
<p>Pour résumer, disons que:</p>
<ul>
<li>Il n'y a pas de "vrai doc ultime"</li>
<li>Elle est éparpillée sur le net</li>
<li>Les exemples datent et ne sont plus adaptés à Python 3.0 (L'effet Python 3.0 que je citais plus haut)</li>
</ul>
<p>On s'amuse donc comme un petit fou à tenter tout et n'importe quoi pour réussir certaines manipulations, à trouver une bride d'infos qu'on retranscrit comme on peut (j'ai du aller regarder directement dans les libs py pour savoir comment faire certaines choses :baffed: ). Allez trouvez un moyen de lancer une FileDialog sous Python 3.0, le truc de base à faire. J'ai cru qu'au final j'allais devoir me rescripter une FileDialog. Soit je suis nul, soit ça prouve que c'est un peu la misère, (non pas à faire, mais ça se devine pas... Et sans doc, on est comme un imbécile). Au final, on trouve mais en mettant en relation différentes documentations. Pour mon exemple:</p>
<ul>
<li>"FileDialog" est un sous module de tkinter (Doc1)</li>
<li>Il faut l'appeler avec "asksaveasfilename" (Doc2) (Ne me dites pas que ça se devine...)</li>
<li>L'attribut pour lui mettre un path par défaut est "initialdir" (Doc3)</li>
</ul>
<p>Super! Maintenant (après plus d'une heure), j'ai une FileDialog. :casseTeteMur:</p>
<p>La raison pour laquelle j'ai créé ce billet est la suivante: J'ai tellement galèré pour trouver des morceaux de documentation que je vous propose de les lister ci-dessous (Tout est en vrac mais au moins, vous en avez déjà pas mal).</p>
<ul>
<li><a href="http://fr.wikibooks.org/wiki/Programmation_Python/Tkinter" hreflang="fr">http://fr.wikibooks.org/wiki/Programmation_Python/Tkinter</a></li>
<li><a href="http://infohost.nmt.edu/tcc/help/pubs/tkinter/" hreflang="en">http://infohost.nmt.edu/tcc/help/pubs/tkinter/</a></li>
<li><a href="http://www-acc.kek.jp/WWW-ACC-exp/KEKB/control/Activity/Python/TkIntro/introduction/index.htm" hreflang="en">http://www-acc.kek.jp/WWW-ACC-exp/KEKB/control/Activity/Python/TkIntro/introduction/index.htm</a></li>
<li><a href="http://effbot.org/tkinterbook/" hreflang="en">http://effbot.org/tkinterbook/</a></li>
<li><a href="http://www.pythonware.com/library/tkinter/introduction/" hreflang="en">http://www.pythonware.com/library/tkinter/introduction/</a></li>
<li><a href="http://python.developpez.com/faq/?page=Tkinter" hreflang="fr">http://python.developpez.com/faq/?page=Tkinter</a></li>
<li><a href="http://python.developpez.com/cours/TutoSwinnen/" hreflang="fr">http://python.developpez.com/cours/TutoSwinnen/</a> (Chapitre 8, 13 et 15 mais beaucoup de "dessin")</li>
<li><a href="http://sebsauvage.net/python/gui/index_fr.html" hreflang="fr">http://sebsauvage.net/python/gui/index_fr.html</a></li>
<li><a href="http://python.developpez.com/sources/?page=Tkinter" hreflang="en">http://python.developpez.com/sources/?page=Tkinter</a></li>
<li><a href="http://www.java2s.com/Code/Python/GUI-Tk/CatalogGUI-Tk.htm" hreflang="en">http://www.java2s.com/Code/Python/GUI-Tk/CatalogGUI-Tk.htm</a></li>
<li><a href="http://www.tcl.tk/man/tcl8.5/TkCmd/contents.htm" hreflang="en">http://www.tcl.tk/man/tcl8.5/TkCmd/contents.htm</a></li>
<li><a href="http://www.manning.com/grayson/" hreflang="en">http://www.manning.com/grayson/</a> (Livre que je vais peut-être m'acheter en PDF)</li>
</ul>Bourrage de zéros en Pythonurn:md5:7d76dbf541c02de6abd94166f7efa15a2009-02-28T21:42:00+01:002021-09-02T10:28:19+02:00NarannScript et codebourragedossiersfichiersfrpythonscriptstringzero<p><img src="https://www.fevrierdorian.com/blog/public/logos/Python_logo_150.png" alt="" style="float:left; margin: 0 1em 1em 0;" />Je vous propose une petite procédure en python qui permet d'effectuer un "bourrage de zéros" (ou "zero garbage") à une chaine de caractères. Ceci peut se révéler très pratique dans le cas où, (comme par hasard...) vous vouliez ajouter des zéros devant un chiffre donné pour naviguer dans des dossier (de plans par exemple), où que vous souhaitiez renommer des fichiers en masse (Pas juste dans un dossier hein? Il existe des logiciels qui le font très bien... Là je parle de renommer des dizaines de séquences d'images différentes dans des centaines de fichiers). Personnellement, j'utilise souvent cette procédure alors j'ai jugé utile d'en faire part à tous le monde.</p> <p>/EDIT 2009 04 21</p>
<p>Comme l'a dit Laurent dans son commentaire, il existe une fonction Python qui le fait déjà:</p>
<pre>[python]
print str(50).zfill(4)
>> "0050"</pre>
<p>Comme quoi, je me suis bien cassé les fesses pour rien... :seSentCon:</p>
<p>/FIN EDIT</p>
<h5>En quoi ça consiste?</h5>
<p>Et bien tout simplement, c'est une manière de récupérer une chaine de caractère (ressemblant à "005") depuis un chiffre de type "int" (dans notre exemple: 5).</p>
<h5>Let's go</h5>
<p>Je vous donne le code brut et j'expliquerai chacune des lignes ensuite.</p>
<pre>[python]
def fdZeroGarbage(toGarbage, zeroNumber):
toGarbageStr = str(toGarbage)
while len(toGarbageStr) < zeroNumber:
toGarbageStr = "0"+toGarbageStr
return toGarbageStr</pre>
<p>Vous pouvez l'exécuter puis lancer:</p>
<pre>[python]
>> fdZeroGarbage(50, 4)</pre>
<p>Ce qui renvoie:</p>
<pre>[python]
>> "0050"</pre>
<p>Explication des lignes:</p>
<pre>[python]
def fdZeroGarbage(toGarbage, zeroNumber):</pre>
<p>Cette ligne sert à définir le nom de la procédure ainsi que les arguments:</p>
<ul>
<li>fdZeroGarbage est le nom de la procédure.</li>
<li>toGarbage est la valeur de base.</li>
<li>zeroNumber est le nombre de caractère que devra contenir la chaine renvoyé par la procédure.</li>
</ul>
<pre>[python]
toGarbageStr = str(toGarbage)</pre>
<p>la fonction str() renvoie son contenu mais de type "string". (5 devient: "5" et donc, n'est plus un nombre, mais le caractère 5). Ici, nous créons une nouvelle variable (toGarbageStr) qui sera la version "stringué" de la valeur entré (toGarbage). Si cette procédure est inutile si l'entrée est déjà de type string, elle est cependant nécessaire pour la suite si ce n'est pas le cas.</p>
<pre>[python]
while len(toGarbageStr) < zeroNumber:</pre>
<p>La fonction len() renvoie la longueur de la chaine de caractère (ou de la liste, ou d'autres choses) donné. On comprend ici pourquoi l'argument de la procédure (toGarbage) doit être converti en string. En effet, comme le dis si bien le message d'erreur:</p>
<pre>[python]
>>> len(5)
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
len(5)
TypeError: object of type 'int' has no len()</pre>
<p>En revanche:</p>
<pre>[python]
>>> len("5")
1</pre>
<p>La ligne va exécuter le reste de la procédure: "Tant que la longueur de la chaine de caractère donné (toGarbageStr) est plus petite que le nombre de caractère voulu (zeroNumber)</p>
<pre>[python]
toGarbageStr = "0"+toGarbageStr</pre>
<p>On ajoute le caractère "0" à la chaine. ("5" devient: "05", "05" devient "005", etc...)</p>
<pre>[python]
return toGarbageStr</pre>
<p>A la fin de tout ça, on renvois la valeur de la chaine de caractère toGarbageStr.</p>
<h5>Conclusion</h5>
<p>Voici donc une petite procédure qui est utile car souvent répété. Avec ça vous pouvez faire pas mal de petites chose (renommage, tracking de fichier, etc...). C'est à vous de voir!</p>
<p>Ce modeste tuto est dans la ligné du <a href="https://www.fevrierdorian.com/blog/index.php?post/2009/02/25/Cr%C3%A9er-des-folders-en-Python.">précédent</a>. A savoir, simple, rapide et, je l'espère, utile. (Vous pouvez même intégrer cette procédure dans le script <a href="https://www.fevrierdorian.com/blog/index.php?post/2009/02/25/Cr%C3%A9er-des-folders-en-Python.">précédent</a> si vous voulez utiliser des fonctions dans d'autres fonctions... :baffed:</p>
<p>N'hésitez pas à me laisser un commentaire si vous rencontrez des problèmes avec. :hehe:</p>
<p>A plus!</p>
<p>Dorian</p>Créer 300 dossiers en Pythonurn:md5:9fd1e4c630ae34db92fc154a0c38e1ea2009-02-21T15:25:00+01:002021-09-02T10:15:43+02:00NarannScript et codedossiersfrpythonscript<p><img src="https://www.fevrierdorian.com/blog/public/logos/Python_logo_150.png" alt="" style="float:left; margin: 0 1em 1em 0;" /> Il arrive dès fois d'avoir à créer un tas de dossier identique ou la seul différence se situe au niveau du numéro...</p>
<p>J'ai toujours considéré qu'a partir du moment ou une manipulation devait être faites plus de deux fois il fallait qu'elle soit automatisé. (Car on se rend compte qu'au final on le fait bien plus de trois fois :D )</p>
<p>Je vous propose modestement ce petit script Python oû j'ai expliqué, ligne à ligne, la démarche de la manière la plus claire possible. Le but n'est pas de l'utiliser tel quel mais de vous en inspirer. L'objectif étant qu'un non initié puisse faire quelques modifications pour pouvoir l'adapter à ses besoins.</p> <pre>[python]
import os
for i in range(300):
planNum = str(i)
if len(planNum) == 1:
planNum = "00"+planNum
if len(planNum) == 2:
planNum = "0"+planNum
folderName = "P"+planNum
os.makedirs(folderName)</pre>
<p>/EDIT 2009 08 10</p>
<p>Comme l'a dit Laurent dans <a href="https://www.fevrierdorian.com/blog/index.php?post/2009/03/03/Bourrage-de-z%C3%A9ros-en-Python">un autre billet</a>, il existe une fonction Python qui bourre les zéros automatiquement:</p>
<pre>[python]
print str(50).zfill(4)
>> "0050"</pre>
<p>Le code serait donc:</p>
<pre>[python]
import os
for i in range(300):
planNum = str(i).zfill(3)
folderName = "P"+planNum
os.makedirs(folderName)</pre>
<p>/FIN EDIT</p>
<p>Explication:</p>
<pre>[python]
import os</pre>
<p>On importe le module "os" qui permet de d'utiliser des fonctions propre à l'OS (Dans notre cas, pour demander a Windows de créer un répertoire.)</p>
<pre>[python]
for i in range(300):</pre>
<p>i est une variable et range(300) est une liste de type: 0, 1, 2, 3, ... 299. Donc, "pour" i = chaque élément de la liste:</p>
<pre>[python]
planNum = str(i)</pre>
<p>planNum sera égale la variable i mais de type string. En effet, i est de type int (ou float) mais pour nommer un dossier, il nous faut une chaine de caractère qui est donc un type string. La commande str(maValeur) renvoir maValeur en type string. Exemple: str(12) = "12"</p>
<pre>[python]
if len(planNum) == 1:</pre>
<p>Ceci est pour le padding (ou bourrage de zéro): len(maVariableString) renvoi le nombre de caractère dans le mot maVariableString. Si la longueur de la liste de caractère de ma variable planNum est strictement égal à 1:</p>
<pre>[python]
planNum = "00"+planNum</pre>
<p>On ajoute deux zéros devant la valeur. Ainsi, si planNum = "1" -> planNum = "00"+planNum -> "001"</p>
<pre>[python]
if len(planNum) == 2:
planNum = "0"+planNum</pre>
<p>Idem mais si planNum contient deux caractère, on ajoute un seul zéro (par exemple: "12" -> "0"+"12" -> "012")</p>
<pre>[python]
folderName = "P"+planNum</pre>
<p>On créé une variable qui contiendra le nom du folder: folderName -> "P"+planNum -> "P"+"001" ->"P001", "P002", "P003", ... "P299"</p>
<pre>[python]
os.makedirs(folderName)</pre>
<p>Utilise la fonction "makedirs" du module "os" importé plus haut pour créer le répertoire "folderName".</p>
<p>Sauvegardez le tout dans un fichier texte portant l'extension Python (.py) et lancez le.</p>
<p><img src="https://www.fevrierdorian.com/blog/public/300plansFoldersPython/300foldersEmpty.png" alt="300foldersEmpty" style="display:table; margin:0 auto;" title="300foldersEmpty, fév. 2009" /></p>
<p><img src="https://www.fevrierdorian.com/blog/public/300plansFoldersPython/300foldersFull.png" alt="300foldersFull" style="display:table; margin:0 auto;" title="300foldersFull, fév. 2009" /></p>
<center><I>Tadaaa!</I></center>
<p>Bon, c'est pas du gros script mais c'est concis et ça offre des possibilités intéressantes. :)</p>