INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 3 [4] 5 6   Go Down

Author Topic: pscriptor.pl: a general purpose scriptable MC field manipulator + utility  (Read 100821 times)

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

I've updated the post above with a new zip file containing the updated scriptlet.  It includes the requested change to include your column data in your file's name.  This is done via the syntax:

   <[column]>

where column is the name if your file list column.

In addition, I've changed the name of the -a option which was named "name" to "fname" and also its token "<name>" is now "<fname>".  It is easier to reference this way, and won't collide with the "name" column in your data.  See the updated examples and description.

To include the your column values in a track name:

  a "base:M:\Music\Copied fname:<[artist]>-<[bitrate]>bps"



   
Logged
The opinions I express represent my own folly.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

I've updated the test code zip archive again.  This now includes the ability to delete existing files, duplicate detection, and name conflict avoidance.

Delete Existing Files:
There is a new -a option:

    delete:yes

which when used will cause deletion of pre-existing files.

Duplicate Detection
A source file listed multiple times in a playlist will be copied only once so long as the destination name does not change.  It would not change, for example, if the destination file name is some static value, like the source file's file name, but it would change if the destination file name was to be a sequence number.  The code does not examine file content.

Name Conflict Avoidance
If the destination file already exists, a (n) will be appended to the destination file name.
Logged
The opinions I express represent my own folly.

stiv32

  • World Citizen
  • ***
  • Posts: 162


Can I use it like this?

perl pscriptor.pl -v -c pscriptor-config.txt -E Stiv32inator -f "
M3U8_Playlists" -a "base:C:\1  delete:yes forlderfield:[artist] fname:<[artist]>-<fname>-<seq,3>"

I will run some tests and I will write you here how it goes?
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

Not quite - you have:

   perl pscriptor.pl -v -c pscriptor-config.txt -E Stiv32inator -f "M3U8_Playlists" -a "base:C:\1  delete:yes forlderfield:[artist] fname:<[artist]>-<fname>-<seq,3>"

Note the typo of forlderfield and the value here [artist] is not an MC field, but the name of one of your columns. so you probably meant:

   perl pscriptor.pl -v -c pscriptor-config.txt -E Stiv32inator -f "M3U8_Playlists" -a "base:C:\1  delete:yes folderfield:artist fname:<[artist]>-<fname>-<seq,3>"

p.s.  I think I'm going to change the way -a args are processed.   I think something like this would be better:

   perl pscriptor.pl -v -c pscriptor-config.txt -E Stiv32inator -f "M3U8_Playlists" -- --base C:\1  --delete:yes --folderfield artist --fname "<[artist]>-<fname>-<seq,3>"

That is, everything after a lone -- will go to the scriptlets, so you can use options similar to how they are used by pscriptor itself (and -a could be used for simple scriptlet options).

Also, by the way, the later you place the -v (or -d), the less verbose (or debug) output you'll get.  This is especially useful after the -c option, so you get less verbose output regarding processing the config file, etc.  It is also easier to remove when you recall/edit your previous command.  Example:

   perl pscriptor.pl -c pscriptor-config.txt -E Stiv32inator -f "M3U8_Playlists" -a "base:C:\1  delete:yes folderfield:artist fname:<[artist]>-<fname>-<seq,3>" -v
Logged
The opinions I express represent my own folly.

stiv32

  • World Citizen
  • ***
  • Posts: 162

So, I tried adding the playlist to different programs and everything worked as we expected.

I also copied the folder with the playlist to my android phone, but no application would load the .m3u8 playlist.

Not all the applications showed the [Filename (name)] at their playlist windows (most of them show [Name] only) but that didn't affect the order of the tracks... at least at the programs I tested it.
I renamed the playlist.m3u8 to playlist.m3u. This worked.

Accidentally I found a limitation of most android music application. They could read only 99 files from a playlist. Out of 10 applications only two could read the whole 168 files of the playlist. (I know it is out of the topic, but I found it a bit strange and also want to point out that it is not a limitation of the script).

So we have a script that can extract to .m3u8 playlist (and .m3u in UTF-8 (right?) if we just rename the playlist file) all the selected files in MC.

And this can be used to take the files with us in a stick, external disk, mobile phone or mp3 player even if the files (songs, videos, photos) have names with characters like ñ, ó, é, έ, η etc.

Thank you very much MrC !
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

You're welcome, and thanks for testing it out.  I'll wait a short while before pushing out a full release, in case you find any issues.

I'm still considering changing/amending the scriptlet argument processing.

M3U8 files are UTF-8 Unicode.  M3U files are Windows 1252 (the Latin-1 character set).  So technically renaming the M3U8 to M3U is not quite correct.  If it works for your application, great.  I suppose the reason MC doesn't include M3U8 capabilities for HH or conversion is due to what you discovered - not all devices can handle the format, and not all file systems are UTF-8.
Logged
The opinions I express represent my own folly.

arin

  • Junior Woodchuck
  • **
  • Posts: 97

The @INC path in the error message from perl shows that the OS X version of perl is being used, not the new /opt/local/bin version you installed via Mac Ports.

Try looking at the PATH environment variable:

   echo $PATH

Code: [Select]
$ echo $PATH
/opt/local/bin:/opt/local/sbin:/Users/MrC/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin

and if /opt/local/bin is not at the front of the PATH, that's the cause.  Did you start up and use a new Terminal window (new shell) after installing the MacPorts package?  (see my above message about this).  MacPorts will add this entry:

Code: [Select]
# MacPorts Installer addition on 2013-04-06_at_09:45:09: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.

to your .bash_profile.  Having the PATH set properly means you don't have to type full path names to the executables in /opt/local/bin:

   /opt/local/bin/perl pscriptor.pl ....

and instead can use:

   perl pscriptor.pl ....



Hi MrC!
I'm really puzzled…
And I was trying to understand by myself why the Mac Ports installer doesn't put perl where it should, according to what you told me.
The only perl I can see in /opt/local/bin is perl5.16 and being dumb I even tried to run pscriptor using that one but failed, of course…

When I type $ which perl
the only response I get is:
/usr/bin/perl

When I type $ echo $PATH
I get this:
/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin


I tried to re-uninstall ActivePerl for mac and of course it says it doesn't find anything to uninstall.

I also tried to install Mac Ports many times, being a little frustrated, and I always got the message that everything went ok.
But perl is not where it should be anyway...

And now I really need your help! ?
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

There may be several perl versions installed:

$ ls -l /opt/local/bin/perl*
lrwxr-xr-x  1 root  admin      8 Oct 26  2013 /opt/local/bin/perl@ -> perl5.12
lrwxr-xr-x  1 root  admin      8 Oct 26  2013 /opt/local/bin/perl5@ -> perl5.12
-rwxr-xr-x  1 root  admin  14008 Dec  1 21:04 /opt/local/bin/perl5.12*
lrwxr-xr-x  1 root  admin      8 Dec  1 21:04 /opt/local/bin/perl5.12.4@ -> perl5.12
-rwxr-xr-x  1 root  admin  13956 Apr  3 16:18 /opt/local/bin/perl5.16*
lrwxr-xr-x  1 root  admin      8 Apr  3 16:18 /opt/local/bin/perl5.16.3@ -> perl5.16
lrwxr-xr-x  1 root  admin     12 Oct 26  2013 /opt/local/bin/perlbug@ -> perlbug-5.12
-rwxr-xr-x  2 root  admin  45815 Dec  1 21:04 /opt/local/bin/perlbug-5.12*
-rwxr-xr-x  2 root  admin  41712 Apr  3 16:18 /opt/local/bin/perlbug-5.16*
lrwxr-xr-x  1 root  admin     12 Oct 26  2013 /opt/local/bin/perldoc@ -> perldoc-5.12
-rwxr-xr-x  1 root  admin    244 Dec  1 21:04 /opt/local/bin/perldoc-5.12*
-rwxr-xr-x  1 root  admin    244 Apr  3 16:18 /opt/local/bin/perldoc-5.16*
lrwxr-xr-x  1 root  admin     12 Oct 26  2013 /opt/local/bin/perlivp@ -> perlivp-5.12
-rwxr-xr-x  1 root  admin  12484 Dec  1 21:04 /opt/local/bin/perlivp-5.12*
-rwxr-xr-x  1 root  admin  10802 Apr  3 16:18 /opt/local/bin/perlivp-5.16*
lrwxr-xr-x  1 root  admin     15 Oct 26  2013 /opt/local/bin/perlthanks@ -> perlthanks-5.12
-rwxr-xr-x  2 root  admin  45815 Dec  1 21:04 /opt/local/bin/perlthanks-5.12*
-rwxr-xr-x  2 root  admin  41712 Apr  3 16:18 /opt/local/bin/perlthanks-5.16*

Since its best to use version 5.16, I created an alias in my .bash_profile:

$ grep perl .bash_profile
alias perl='perl5.16'

Once you do that, it will be available for each new shell you start, and to force the reading of that file by your current shell, you can "source" the file:

$ source .bash_profile

You can see which perl5.16 is found:

$ which perl5.16
/opt/local/bin/perl5.16

and you can see the version:

$ perl --version

This is perl 5, version 16, subversion 3 (v5.16.3) built for darwin-thread-multi-2level
...

If you have not installed 5.16, you can install it with:

$ sudo port install perl5.16
Logged
The opinions I express represent my own folly.

arin

  • Junior Woodchuck
  • **
  • Posts: 97

Sorry to bother you but…I told you I was dumb… ;D


When I go:

$ grep perl .bash_profile
alias perl='perl5.16'

I get:

grep: .bash_profile: No such file or directory



When I go:

$ source .bash_profile

I get:

-bash: alias: .bash_profile: not found



When I go:

$ which perl5.16

I get:
/opt/local/bin/perl5.16


How can I create a .bash_profile?
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

The easiest way in the command shell.  Copy and paste the command:

   echo "alias perl='perl5.16'" > ~/.bash_profile
Logged
The opinions I express represent my own folly.

stiv32

  • World Citizen
  • ***
  • Posts: 162

Hello MrC,

I am trying to use the Stiv32inator script with this command

perl pscriptor.pl -c pscriptor-config.txt -E Stiv32inator -f "M3U8_Playlists" -a "base:C:\SDCARD folderfield:folderfield fname: <seq,3>-<fname>"

unfortunately processes the command when I have chosen from 1 to 20 files.

The previous time I used it, it could processed 160 files without any problem. I have checked my ram and I am using less than 2gb out of 6gb. Is there something I can do to force it copy the files into clipboard so that they can be processed from the script?

Thank you
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

Hi Stiv32 - I'm not sure I understand what the error or problem is.  What is happening?
Logged
The opinions I express represent my own folly.

stiv32

  • World Citizen
  • ***
  • Posts: 162

It isn't really a script error. I choose all the files in the playlist but they aren't copied to clipboard. So, they can't be processed through the script.

What is strange is that last week I had chosen 160 files in a playlist and everything went fine. This time the files are only 120 and they can't be copied to clipboard. I can process only 20 files per time.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

Are you able to select the files in MC, and Edit > Copy, and then paste the results into a spreadsheet or Notepad?  Do all the files appear?
Logged
The opinions I express represent my own folly.

stiv32

  • World Citizen
  • ***
  • Posts: 162

Alright, I found what was the problem. I just had to remove the "Playlist Paths" column from "view", because it carries too much information. Now, everything works great!

I noticed this when I tried to copy some of the files with edit > copy as you pointed out :)

Thank you very much!
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

I've seen on a couple of occasions that MC has trouble CSV-ifying the clipboard data when certain columns are present.  But I haven't followed up on it.  When you copied the files and pasted into Notepad, did MC not carry all the rows of data?
Logged
The opinions I express represent my own folly.

stiv32

  • World Citizen
  • ***
  • Posts: 162

When I pasted into the Notepad, I noticed that it hadn't copied any data. When I choose only one file and copied - pasted, the information pasted was half a page. It was because of the Playlists Paths column.

About the WhichPlaylists script. Last week I noticed that it returned not only the Playlists paths that I had created, but also the paths of the playlists that MC auto-creates. That is, "Recently imported", "Recently Played". The information kept at those auto created Playlists is too much because one song can be present at many playlists and those playlists have names that are really long.

What I need to do, is empty the "Playlist Paths" column, delete the "Imported Playlists" and "Recently Imported" groups of playlists and rerun the WhichPlaylists script. In that way my "Playlist Paths" column will be clean.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

Interesting.

Would it be helpful to be able to configure certain playlist paths that should be ignored?
Logged
The opinions I express represent my own folly.

stiv32

  • World Citizen
  • ***
  • Posts: 162

Yes, it would. In that way every time I run WhichPlaylists I won't have to delete those playlist groups.
Logged

stiv32

  • World Citizen
  • ***
  • Posts: 162


p.s.  I think I'm going to change the way -a args are processed.   I think something like this would be better:

   perl pscriptor.pl -v -c pscriptor-config.txt -E Stiv32inator -f "M3U8_Playlists" -- --base C:\1  --delete:yes --folderfield artist --fname "<[artist]>-<fname>-<seq,3>"

That is, everything after a lone -- will go to the scriptlets, so you can use options similar to how they are used by pscriptor itself (and -a could be used for simple scriptlet options).


I already have understood how  -a args work, and I will adapt easily to the new way. if you believe that it will be easier for new users to understand how this works then by all means change it. :)
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

Edit: The attached whichplaylists zip has been removed as the change has been incorporated into the pscriptor release.

Yes, it would. In that way every time I run WhichPlaylists I won't have to delete those playlist groups.

Ok, here you go.  The attached zip file contains the WhichPlaylists scriptlet and a new config file.  For this update, you only need the last two lines of the config file - copy those into your own if that will save you some time.  These look like:


Code: [Select]
  # WhichPlaylists
   WhichPlaylists::Var: ignored_playlists_re       = ^Recent Playing Now's\\.*     # regular expression defining playlists to be ignored

The variable ignored_playlists_re defines a regular expression to be used to match against the full playlist path.  The default one ignores Recent Playing Now's\... paths.  If you want to add more, you'll need to understand REs.  You might want something like:

Code: [Select]
  WhichPlaylists::Var: ignored_playlists_re       = ^(Recent Playing Now's\\.*|Recently Imported)$
Use the -v verbose option to see what is being skipped:

Code: [Select]
Playlists found: 2013237201 = Testing 2: B\Testing 2
Playlists found: 536715510 = Testing 2: A\AA\Testing 2
Playlists found: 1067419728 = Test 2: Test 2
Playlists found: 2138030397 = 05/10/14 09:57:50 pm: Recent Playing Now's\05/10/14 09:57:50 pm
Skipping ignored playlist: Recent Playing Now's\05/10/14 09:57:50 pm
Playlists found: 1005581327 = Testing 3: A\AA\AAA\Testing 3
Logged
The opinions I express represent my own folly.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

I already have understood how  -a args work, and I will adapt easily to the new way. if you believe that it will be easier for new users to understand how this works then by all means change it. :)

Thanks for the feedback.

Really its a matter of how well I can produce error messages for incorrect arguments.  The way I'm doing it now allows you to place -a <args> anywhere.  And I may still keep that method for some scriptlets.  But quoting long strings with arbitrary characters is hard for users, so I'm using some trickery to work out what are arguments and values.  And the new Stiv32inator script has difficult -a options (that's why you got tripped with with the fieldname typo a few posts back - I had no way to warn you since it looked like part of the previous argument).   So I think for some scriptlets, like Stiv32inator, it make sense to use -- and pass everything as real option/value arguments.  Then, I can detect, warn and croak on incorrect options.
Logged
The opinions I express represent my own folly.

stiv32

  • World Citizen
  • ***
  • Posts: 162

I downloaded the new WhichPlaylists so I am going to post back if I have any problems  :)
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

Version 1.13 is now posted.

Changes in Version 1.13:
    - Fix: --help option was not working.
    - Fix: minor typos in scriptlet Numberize.
    - Fix: undefined perfile callback function was not being properly detected.
    - Fix: suppress some extraneous verbose output when there is no per-file scriptlet function.
    - New: DateParse scriptlet's year, month, day separator can now be specified as an RE pattern.
      The default pattern includes - (dash) and . (dot).  See the date_separator variable in the
      config file.  The same separator will be used throughout the date (first one found is used
      on as the next separator).
    - New: RandomPlaybackRange scriptlet now clears the Bookmark field when setting the Playback
      Range field.  Also, the script supports a new option to clear Playback Range and Bookmark.
      Use the "clear" argument with -a (e.g. -a clear).
    - New: WhichPlaylists scriptlet can now ignore playlists matched by a regular expression.
      See the variable ignore_playlists_re in the config file under the WhichPlaylists section.
    - New: scriptlet CopyWithM3U8 copies files and creates M3U8 playlists for those files.  The
      folder and filename rules are customizable, allowing you to rename copied files, including
      using sequence numbers.  See the instructions inside the scriptlet file.

Note: the CopyWithM3U8 (formerly called Stiv32inator during testing) has changed the way it processes arguments.  The scriptlet no longer uses the -a option and its complex double-quoted argument string.  Instead, the scriptlet uses everything on the command line after a double-dash.    Example:

    perl pscriptor.pl -c pscriptor-config.txt -E CopyWithM3U8 -f 'MyGroupField' -- --base "M:\My Copied Music" --folder Playlists --file "<seq> <fname>"

All the stuff in blue (that is, everything after the lone --) is processed by the scriptlet, and the form of the scriptlet options now follows the same style as pscriptor's main options.  Use --help as a scriptlet option to see the scriptlet's options:

Code: [Select]
perl pscriptor.pl -c pscriptor-config.txt -E CopyWithM3U8 -f "My Group Field" -- --help

CopyWithM3U8 options:
    --basepath    | -b <base path> # base path of the destination folder
    --delete      | -d # delete existing files first?
    --help  | -h # output scriptlet help and usage text
    --filename    | -f <filename spec> # the specification that defines how filenames should be constructed
    --folderfield | -F <column name> # the name of a column that defines the sub-folder component

Stopped

You may have noticed that in the first example above, the scriptlet option --filename has been abbreviated as --file.  In fact, any option may be abbreviated to an unambiguous form, so --fo would be acceptable as --foldername and --fi would be acceptable as --filename.  Of course, the single letter options are still valid, with -F for --foldername and -f for --filename.
Logged
The opinions I express represent my own folly.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

I've posted version 1.14.  The big change is that the default config file is now automatically included, and it will include a custom config file you create, so this will greatly reduce the difficulty in migrating your settings as you update.

Changes in Version 1.14
    - Change: Split the README.txt file into three files: README.first.txt, README.install.txt,
      and README.usage.txt.  Added more instructions for intstallation on OS X.
    - Change: the default config file (pscript-config.txt) is read automataically, so you no
      longer have to specify the -c option (unless you want a config file other than the
      default).  Also, see next note.
    - New: a config file can use a new inclusion rule to include another config file.  This
      allows you to configure your own custom config file with only the differences from the
      default config file.  You can see the include rule at the bottom of the default config
      file.  It includes the file named pscriptor-config-custom.txt.  This file is one you
      can create, and it will not be overwritten on updates (unlike the default config file).
      A good usage of the custom config file would be to store your MCWS_* settings.
    - Fix: DateParse scriptlet failed to detect dates of the format D-MM-YYYY.

Using the example run from the post above, the new command line would look like:

    perl pscriptor.pl -E CopyWithM3U8 -f 'MyGroupField' -- --base "M:\My Copied Music" --folder Playlists --file "<seq> <fname>"
Logged
The opinions I express represent my own folly.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

I've re-uploaded version 1.14 - the zip file did not include the new README files.  You should re-download the zip file if you did so before this posting.

Sorry about that.
Logged
The opinions I express represent my own folly.

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14463
  • I won! I won!
Obtaining playback ranges for particles
« Reply #176 on: May 22, 2014, 01:17:52 am »

Unfortunately in my testing I've found they either don't exist for most, or when they do they splitting based on the track length + trackgap does not hit the right mark on all tracks.

By the way, if MediaInfo can read the chapter start/stop values, I already have a pscriptor scriptlet that uses it, and another one that sets playback range.  It would be easy enough to modify it to instead pull these values.

:) So, I've been checking out what accurate Chapter Info can be pulled by various progs.... and Media Info can do it if it is fed the right MPLS (see pic).  Other progs like madshi's eac3to can also export out chapter times to a txt file.

Thanks
Nathan

Logged
JRiver CEO Elect

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Obtaining playback ranges for particles
« Reply #177 on: May 22, 2014, 01:30:15 am »

Since MediaInfo is command line driven, it is something I can use.   I could also call eac3to and parse the txt file.
Logged
The opinions I express represent my own folly.

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14463
  • I won! I won!
Obtaining playback ranges for particles
« Reply #178 on: May 22, 2014, 02:36:59 am »

Does this help?  I tried adding "--Inform=Menu" and "--Inform=Chapter" to cut it down but.... the output was the same.

The downside is you have to guess the correct playlist (and there could be more than one), eg in MC the file is shown as:
".....\The Rolling Stones Eoms\BDMV\index.bluray;1" and to get it to work in mediainfo the correct playlist is
".....\the rolling stones eoms\bdmv\playlist\00000.mpls"
see below

Code: [Select]
C:\Users\Nathan\Downloads\MediaInfo_CLI>mediainfo "m:\media\discs\the rolling st
ones eoms\bdmv\playlist\00000.mpls"
General
Complete name                            : m:\media\discs\the rolling stones eom
s\bdmv\playlist\00000.mpls
Format                                   : Blu-ray Playlist
File size                                : 496 Bytes
Duration                                 : 1h 7mn
Overall bit rate mode                    : Variable
Overall bit rate                         : 1 bps

Video
ID                                       : 4113 (0x1011)
Menu ID                                  : 1 (0x1)
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Format settings, GOP                     : M=3, N=18
Codec ID                                 : 27
Duration                                 : 1h 7mn
Bit rate mode                            : Variable
Bit rate                                 : 11.4 Mbps
Maximum bit rate                         : 40.0 Mbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 24.000 fps
Standard                                 : NTSC
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.230
Stream size                              : 5.40 GiB (60%)
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
format_identifier                        : HDMV
Source                                   : 00000.m2ts

Audio #1
ID                                       : 4352 (0x1100)
Menu ID                                  : 1 (0x1)
Format                                   : PCM
Format settings, Endianness              : Big
Format settings, Sign                    : Signed
Muxing mode                              : Blu-ray
Codec ID                                 : 128
Duration                                 : 1h 7mn
Bit rate mode                            : Constant
Bit rate                                 : 4 608 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 96.0 KHz
Bit depth                                : 24 bits
Stream size                              : 2.18 GiB (24%)
Language                                 : English
format_identifier                        : HDMV
Source                                   : 00000.m2ts

Audio #2
ID                                       : 4353 (0x1101)
Menu ID                                  : 1 (0x1)
Format                                   : DTS
Format/Info                              : Digital Theater Systems
Format profile                           : 96/24 / Core
Mode                                     : 16
Format settings, Endianness              : Big
Muxing mode                              : Stream extension
Codec ID                                 : 134
Duration                                 : 1h 7mn
Bit rate mode                            : Constant
Bit rate                                 : 1 509 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 96.0 KHz / 48.0 KHz
Bit depth                                : 24 bits
Compression mode                         : Lossy
Stream size                              : 731 MiB (8%)
Language                                 : English
Source                                   : 00000.m2ts

Audio #3
ID                                       : 4354 (0x1102)
Menu ID                                  : 1 (0x1)
Format                                   : TrueHD / AC-3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Muxing mode                              : Stream extension
Codec ID                                 : 131
Duration                                 : 1h 7mn
Bit rate mode                            : Variable / Constant
Bit rate                                 : 640 Kbps
Maximum bit rate                         : 3 036 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: C / Front: L R
Sampling rate                            : 96.0 KHz / 48.0 KHz
Bit depth                                : 16 bits
Compression mode                         : Lossless
Stream size                              : 310 MiB (3%)
Language                                 : English
bsid                                     : 6
dialnorm                                 : -31
dialnorm/String                          : -31 dB
compr                                    : -0.28
compr/String                             : -0.28 dB
dsurmod                                  : 1
dsurmod/String                           : Not Dolby Surround encoded
acmod                                    : 2
lfeon                                    : 0
dialnorm_Average                         : -31
dialnorm_Average/String                  : -31 dB
dialnorm_Minimum                         : -31
dialnorm_Minimum/String                  : -31 dB
dialnorm_Maximum                         : -31
dialnorm_Maximum/String                  : -31 dB
dialnorm_Count                           : 1157
compr_Average                            : -2.72
compr_Average/String                     : -2.72 dB
compr_Minimum                            : -7.82
compr_Minimum/String                     : -7.82 dB
compr_Maximum                            : -0.28
compr_Maximum/String                     : -0.28 dB
compr_Count                              : 1157
format_identifier                        : AC-3
Source                                   : 00000.m2ts

Menu
00:00:00.000                             : Chapter 1
00:04:33.583                             : Chapter 2
00:06:59.666                             : Chapter 3
00:09:57.500                             : Chapter 4
00:13:33.375                             : Chapter 5
00:17:21.958                             : Chapter 6
00:21:49.125                             : Chapter 7
00:26:08.333                             : Chapter 8
00:29:07.916                             : Chapter 9
00:33:36.000                             : Chapter 10
00:36:43.000                             : Chapter 11
00:39:20.500                             : Chapter 12
00:42:45.166                             : Chapter 13
00:45:40.083                             : Chapter 14
00:51:01.458                             : Chapter 15
00:54:52.375                             : Chapter 16
00:59:29.833                             : Chapter 17
01:03:47.125                             : Chapter 18



C:\Users\Nathan\Downloads\MediaInfo_CLI>
Logged
JRiver CEO Elect

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14463
  • I won! I won!
Obtaining playback ranges for particles
« Reply #179 on: May 22, 2014, 02:42:47 am »

Did some more testing in MC and I can create particles with a filename that references the correct playlist in the format of
".....\The Rolling Stones Eoms\BDMV\PLAYLIST\00000.mpls"

If you just use the "File Name" contained in MC then I can change how these entries are created (and update the wiki).  This way there is no guessing as the user would create the particles from the desired playlist (it's an extra step for the user but it gets the all the tracks from a BD even if it is in mulitple playlists)  ;D
Logged
JRiver CEO Elect

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

Great, thanks.  I think instead of using the filename, I might suggest that a user-field or expression column be used to indicate the MPLS value.  This could be derived them from any method you or other choose.

That chapter info will be easy enough to parse and populate.  I'll get on it.  In the mean time, your job is to become familiar with  pscriptor.  Start ReadMe'ing...
Logged
The opinions I express represent my own folly.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

I've been a bad boy.

I've successfully created particles programmatically.

I used discogs.pl's ability to create all the necessary dummy files from a release entry, imported them into MC, and turned all but the first entry into particles with pscriptor, with the top entry being the top of stack member.
Logged
The opinions I express represent my own folly.

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14463
  • I won! I won!

 ;D You are a Good Good Boy
Logged
JRiver CEO Elect

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

Like I said, a very naughty boy:

   https://dl.dropboxusercontent.com/u/87189402/Auto-Particles.mp4

Download and play the movie.   Here's what's happening:

1. Discogs.pl creates dummy files from the given Discogs ID, and it creates an import.mpl file.
2. In MC, File > Import Playlist that import.mpl and MC populates entries for the files.
3. Pscriptor.pl is called with a new scriptlet Particlize which does some magic to make all the dummy files particles, deletes the dummy files, and sets the top file to be the top of stack, referring to all the members.  Ignore the 5 second pause; that was for debugging - it is gone now.

Magic.
Logged
The opinions I express represent my own folly.

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14463
  • I won! I won!

 ;D ;D ;D I've done my reading, and ready to test!

F5 F5 F5 F5
Logged
JRiver CEO Elect

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

Ok, here are two pre-releases of both discogs and pscriptor.  Please read the Changes logs, as there have been some changes particularly with the config files being automatically read (no more -c config-file required).

You'll do best by opening up two command windows, using one for discogs and the other for pscriptor.

Here's the way you should work.  Create a new view.  Include in that view:

   - the Filename column
   - an expression column named FileKey with the expression: FileKey()
   - an expression column named Stack Top with the expression: [Stack Top]
   - an expression column named Stack Files with the expression: [Stack Files]
   - setup the view to include the ParticleTest dummy file directory below (or whatever you call it) and to include your media files you want particlized.  Then use Search to select a single title (I had "exile" in my Search box in the window, since it was the common word in the files to be imported and that I wanted to work with).
   - The main file you want to work on MUST end up sorted at the top of the list after you import below.  Its values are used as the basis for particlizing the dummy entries and setting up the connections in the main file.  No longer required.

1. Run the discogs command to create the dummy files from an Discogs entry.  Example:

   perl discogs.pl --rid 5397834 --create --basedir C:\Users\MrC\Desktop\ParticleTest

2. Import the import.mpl playlist using File > Import Playlist in MC.

3. Select the main file and the dummy files, and run pscriptor selecting the Particlize script, supplying a dummy field with -f (it isn't used) and you must use --filekey.  Remember, the main file must be sorted to the top.  Example:

   perl pscriptor.pl -E Particlize -v -f dummyfield --filekey

Once it runs, you should now have stacked particles with the original file being the top of stack.

Particlize deletes the dummy files for you.  It also tells MC to temporarily rename your main file (it changes the Filename field and then at the end changes it back).  This is required to keep MC from auto-suffixing existing files with (1), thus breaking the linkage, when the Filename field for all the dummy file entries are set to match the main file.

Since this is all new, and I haven't spent much time testing out all the angles, maybe work on some test files for a while until we work out the kinks.

I haven't added the playback range stuff in yet.  That comes next.

Edit: archive files removed.
Logged
The opinions I express represent my own folly.

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14463
  • I won! I won!

Ok - I've been stepping though this carefully

Part 1 - Creating Dummy Files is fine
Part 2 - Failing with Field not available in the view.....

I'm sure I've stuffed something up....

edit - bad screen shot I did have all lines selected
Logged
JRiver CEO Elect

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

Two things.

Create the custom config file to quiet the warning.

Add a field to the view that you don't care about.  That will be your dummy field.  Use it's name.  I have a _test field I use for scratch purposes.  So I use -f _test as the option.
Logged
The opinions I express represent my own folly.

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14463
  • I won! I won!

Getting closer!

It works and creates the particles (p2.png), but when I change the Media Type (manually) to Video (p3.png), the filename then changes (very odd).  See the two pics.
Logged
JRiver CEO Elect

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14463
  • I won! I won!

Mmmm I created the dummy files using --media type Video and they were created with the Video File type.  Did the second pscriptor to make them particles, also fine.  Then tried to play one and all of a sudden all the filenames where changed to as you see in P3.PNG above and of course they don't play.
Logged
JRiver CEO Elect

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

That's weird.  Try setting the media type first, before calling pscriptor.

Also, be sure your dummy files are not in an auto import folder.  I think I recall you don't use
A.I.
Logged
The opinions I express represent my own folly.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

I'll have to test out BD tomorrow.  I'm baffled as to how MC changed the names like that.
Logged
The opinions I express represent my own folly.

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14463
  • I won! I won!

Yup don't use AutoImport.  Tested further.
- Created the Dummy files using --media type Video and imported them --> OK with Media Type = Video
- ran pscriptor and it looked fine with the correct Filename and the Stack Files / Stack Top entry cross populated
- did nothing then after about 5 sec, MC just changed the Filenames again replacing the "Name" portion of the filename with at from the "Name" field".  

Very Very Odd but it could be how particles work.  Unless you have another suggestion, how about this for a workflow (follows more how MC does it).
- Use Media Info to create the correct number of Particles based on the Chapters from the Base file populating just Track #, Playback Range but keep "Name" the same as the base files, then
- Use Discogs or AGM script to populate the metadata?

Logged
JRiver CEO Elect

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14463
  • I won! I won!

OK - I can confirm if I change the Name of each of the dummy tracks to "The Rolling Stones Eoms" prior to running pscriptor it is fine (also needed to change the File Type from MP3 to bdmv).  Also the Meta Data of the original does not match that of the particles from which has been populated from online (eg I'd suggest that the original should also be updated to have the same Meta Data)
Logged
JRiver CEO Elect

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14463
  • I won! I won!

Thinking some more about the workflow and the testing I've done on other BD, we can not rely of Discogs or AMG to always have the correct info for even the number of names of the tracks, while Media Info will be able to always list the correct #of tracks to create (and their associated playback times).  So if the particles could be created from Media Info Chatper Info first (but with the same meta data from the original (from it's sidecar file maybe?)) then we can run the existing Discogs or AMG scripts as needed to update the meta data over all of them.

...if this makes sense of course!

Thanks for looking at this.
Logged
JRiver CEO Elect

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14463
  • I won! I won!

Quote
This is required to keep MC from auto-suffixing existing files with (1), thus breaking the linkage, when the Filename field for all the dummy file entries are set to match the main file.

This is a key find! as I'd tried the MPL approach before and always have this problem and trying to then change it in MC GUI then caused all sorts of issues!
Logged
JRiver CEO Elect

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

As I was falling asleep last night, I realized that MC probably is treating the conglomerate files differently than the simple single file case that I was testing.  Since I'm developing on a Mac, I don't have MC access to BD or DVD here, so just used mp3.  So at least we have a workable method for non-conglomerate files, and this might be useful as is.

I'll work out the issues with conglomerates on the PC side, if possible.

I currently don't have a pscriptor scriptlet to create the dummy files (that capability is in amg.pl and discogs.pl, but the code is in a module shared by all the programs, so it will be easy to implement a scriptlet to do this).

I'll work with DVDs rips first, call MediaInfo to get the chapter data, and then have the new scriptlet create particles, of course also setting the playback range values for each.  Then I'll see if I can rip a BD and test that out.

You can use the MC UI to rename the particles, but you have to first rename the main file so that MC will allow renaming of the particles to match the original main file name.  Then the main file can be renamed in MC (You can edit the Filename field to do this).

The changing of Name prior to running pscriptor is an interesting find.  I'm pondering why this should matter to MC and what it is doing with those conglomerates.

Edit: I see the change of name on the PC side even with the simple file.  It doesn't happen on the Mac.
Logged
The opinions I express represent my own folly.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.

OK, I have it working fine for your DVDs.  You had the answer - Album had to be set for the top file.   So now I'm pushing down File Type, Media Type, Media Sub Type, and pushing up Album.  I've attached an updated Particlizer - unzip and place it in Scriptlets.  It also now warns of missing fields in the file list.

Does Playback Range not work on ripped DVDs?  Seems it always goes through the intro junk on the DVD.

Off and ripping a BD now (Memento SE)...

Edit: archive file removed.
Logged
The opinions I express represent my own folly.

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14463
  • I won! I won!

Thanks - I'll test the new script in a bit (got to get a coffee into me first).... but from what I remember on the discussion with Matt re DVD "Time Based Particles" & Playback Range is that they we a strange beast (in that it does not seem to work). 
Logged
JRiver CEO Elect

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14463
  • I won! I won!

Looks like one to add to my list of Particle improvements:
- DVD Title Particles are fine (I have plenty of these for TV Shows) & and uses the "JRiver DVD Reader" filter
- DVD Time Based Particles play the whole DVD back but with out any control over navigation, seeking, skipping etc.  It is using the "MS DVD Navigator" filter. 

Matts discussion at the time was that DVD Particles do not use the DVDNavigator so they can directly play the content. 
Logged
JRiver CEO Elect
Pages: 1 2 3 [4] 5 6   Go Up