Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#14 Failing bad with templates on Ubuntu

closed
General (13)
5
2012-03-16
2012-03-16
Bastien
No

Hello,

Im having some difficulties with creating correct templates ; here s what i want to get as a result :

General

Name : %FileName%
File size : %FileSize%
Duration : %Duration%
Overall bit rate : %OverallBitRate%

Video

Format : %Format%
Bit rate : %BitRate%
Width : %Width%
Height : %Height%
Display aspect ratio : %DisplayAspectRatio%
Frame rate : %FrameRate%

Audio

Format : %Format%
Bit rate : %BitRate%
Channel(s) : %Channel(s)%
Sampling rate : %SamplingRate%
Bit depth : %BitDepth%

Text

Subs : %Language%

My most productive template is with this one :

General;Name : %FileName%\r\nFile size : %FileSize%\r\nDuration : %Duration%\r\nOverall bit rate : %OverallBitRate%\r\n\r\nVideo;Format : %Format%\r\nBit rate : %BitRate%\r\nWidth : %Width%\r\nHeight : %Height%\r\nDisplay aspect ratio : %DisplayAspectRatio%\r\n
Frame rate : %FrameRate%\r\n\r\nAudio;Format : %Format%\r\nBit rate : %BitRate%\r\nChannel(s) : %Channel(s)%\r\nSampling rate : %SamplingRate%\r\nBit depth : %BitDepth%\r\n\r\nText;Subs : %Language%\r\n

Although im getting a weird result :

~/HDU$ mediainfo --Inform=file:///home/thewintch/template2.tx
t 001-Jona-Dune.1984.720p.BluRay.DTS.x264-UNIT3D.mkv
Name : 001-Jona-Dune.1984.720p.BluRay.DTS.x264-UNIT3D
File size : 3721838186
Duration : 8178112
Overall bit rate : 3640780

Im obviously doing it the bad way...
Any help to get me out of this nightmare would be greatly appreciated :)

Discussion

  • yeah, this is not currently intuitive enough... :(

    do "mediainfo -f --Language=raw YourVideoFileName" and you will be able to see the right value to put, if you want something like "2h 16mn" instead of 8178112 (milliseconds)

    Something like:
    General;Name : %FileName%\r\nFile size : %FileSize/String%\r\nDuration : %Duration/String%\r\nOverall bit rate : %OverallBitRate/String%\r\n\r\n
    Video;Format : %Format%\r\nBit rate : %BitRate/String%\r\nWidth : %Width/String%\r\nHeight : %Height/String%\r\nDisplay aspect ratio : %DisplayAspectRatio/String%\r\nFrame rate : %FrameRate/String%\r\n\r\n
    Audio;Format : %Format%\r\nBit rate : %BitRate/String%\r\nChannel(s) : %Channel(s)/String%\r\nSampling rate : %SamplingRate/String%\r\nBit depth : %BitDepth/String%\r\n\r\n
    Text;Subs : %Language/String%\r\n

     
    • status: open --> closed
     
  • Bastien
    Bastien
    2012-03-16

    Thats what i call a fast answer, thanks ! Thanks for that --raw trick, i didnt know at all that...

    I would have 2 little questions, if u mind :
    - is there a way to display in the result the "title" tags, like with the gui version? I mean, General, Video, audio...

    -im getting some blank results (i.e duration, width, channels...)...what could that be from ?

    Name : 001-Jona-Dune.1984.720p.BluRay.DTS.x264-UNIT3D
    File size : 3.47 GiB
    Duration :Format : AVC
    Bit rate : 3 000 Kbps
    Width :Format : AC-3
    Bit rate : 640 Kbps
    Channel(s) :Subs :

     
  • > Thats what i call a fast answer

    :)

    > - is there a way to display in the result the "title" tags, like with the gui version? I mean, General, Video, audio...

    %StreamKind%

    Notes:
    - you can see it with the command I provided
    - with such template, you can directly hardcode it in your template, this is same.

    > -im getting some blank results (i.e duration, width, channels...)...what could that be from ?

    Maybe:
    - empty in hte GUI (not available)
    - Be careful, fields are case sensitive (yeah... SOmething I need to change): "width" is unknown, "Width" is OK. Again, loog at the exact value wit the command line I provided.

     
  • Bastien
    Bastien
    2012-03-16

    Okayyy end of the pain :D

    After multiple attempts with %StreamKind% I finally followed your advise and hardcoded the Titles tags ><

    The blank contents was totally my fault, i realised that there was a "jump line" just after some " : " that i hadnt seen in nano at first sight ><

    Thanks a million , thats a wonderful tool there :D

     
  • Bastien
    Bastien
    2012-03-16

    I'm sorry...Last question....and that will be the absolute perfect template :P

    If a file got multiple subs, how can I make it display :
    Subs : French, English, Brasil

    instead of :
    Subs : French
    Subs : English
    Subs : Brasil

    ?

     
  • Bastien
    Bastien
    2012-03-16

    Nevermind, I figured it out :)

    Thanks again for your help,
    Cheers,

    Bastien.

     
    • rodrigo polo
      rodrigo polo
      2013-08-17

      How you did put the subs "Subs : French, English, Brasil"?