Lost Sort Tags On Format Conversion

When converting files to other formats with iTunes, the new files have empty sorting tags when the original had custom data.

From my Links page...
iTunes COM for Windows SDK
You'll need this if you want create or modify any scripts for iTunes for Windows. You need a free membership to Apple Developer Connections in order to get access to the file. Once you have your membership, log in and go to Downloads -> Developer Tools. The entry for iTunes COM for Windows SDK will be about 2/3 of the way down the page.
You're obviously not limited to VBScript, it just happens to be what I'm most familiar with. The tricky bits from the pseudocode I've outlined above are managing the conversion - essentially you need to ask iTunes to do something, then set up a loop which keeps checking to see if the task is finished - and recycling the old file. I already have some suitable code for each of those in ImportM3U and DeDuper respectively.
Coincidentally, I was half-intending to write such a script anyway, following a conversation a week ago. If you don't mind waiting a day or two I'll make good on that intention, or you can have the fun of doing it for yourself.
tt2

Similar Messages

  • RE: Is it possible to sort tags?

    This is a continuation of the Support Forum question titled: “Is it possible to sort tags?” located at:
    https://support.mozilla.org/en-US/questions/963133?esab=a&as=s&r=2&page=1
    If this new topic has to be posed as a new question the following applies.
    If you visit the above link you will learn how convoluted were the solutions provided to non-programmers.
    I CERTAINLY EXPECTED THAT BY NOW there would have been an effort to address the Tag sorting issue, since there have been a number of upgrades since this question was first posted. Tag sorting provides a much more robust browser many more would choose to use. It would also attract more users concerned about the control on our liberties if supplied with a browser that truly has more powerful capabilities to garner and access information.
    One of the points the Firefox Team uses to attract more to use it is the protection it gives from snoops. You’ve got to ask yourself how much protection that might be if developers can’t do something simple (for talented programmers) like provide tag sorting. That comment is from, basically, a non-programmer, so I have no idea how much code would have to be written to bring this about. I suspect they don’t either and possibly fear the effort might turn out to be much greater than it really is.
    It’s been a LONG time since I used Internet Explorer by Microsoft. What brought me to Firefox was their mission statement to provide access free of its own brand of commercialism and free usage of the Internet, which also implied an effort to protect privacy. For the same reasoning I would not use Google, after reports of their cooperation with government heads in China. Reports have also surfaced that Microsoft has provided a back-door to the NSA for their Internet Search engine, all of this in total disregard to the US Constitution’s 4th Amendment requiring a warrant from a court to prevent unreasonable searches and seizures. I would, however, wish that Firefox would OPENLY adhere to the Bill of Rights in their Privacy Policy, which is not stated in so many words. Many would say, “I don’t have anything to hide, so I don’t care.” Apparently they are unaware how dirty politics and politicians can be. This is the reason why a viable alternative, such as Firefox, is so important.
    If you wish to learn more about just one individual who has dedicated his life in service to this country in terms of providing liberty to the widest possible number along with a promise to use the wealth he has built throughout his life (except for the necessity of living in exile), visit the following:
    http://wantarevelations.com/wanta-black-swan-white-hat/
    This is just one of the links that would be a lot easier to access, were it possible to sort Tags.
    Is this off-topic? Not really.

    HI MozillaFirefoxNewbie,
    Thank you for your question, even though this is not off topic, the points made would have a better audience in a feature proposal in Bugzilla. Please check out the features and description here:
    [https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox&component=Bookmarks%20%26%20History]
    As mentioned in the previously posted thread, there was a work around provided by [https://support.mozilla.org/en-US/questions/963133#answer-462676 jscher] that sounded functional.
    However if there is no extension desired, I encourage to proved the steps and objective of the feature.
    If you open up the Bookmark Library however and click the drop down of 'Tags', they are in alphabetical order.
    Have you tried this built into Firefox?
    Cheers

  • RE: Oracle DATE data format conversion..

    <C.M> Motta's question about dates and oracle>
    Dealing with dates and Oracle is somewhat of a nuisance. Oracle is very
    particular about how date strings are formatted, and if you get it wrong,
    you get the (unhelpful) message that C.M. Motta showed us. However, if
    you pass a DateTimeData to Oracle, Forte' does the right formatting for you.
    If you do need to format the date prior to interacting with Oracle, use the
    following format:
    dd-mmm-yy <time component>
    You can change the default format, but it is not easy.
    If you customise Express generated code that interacts with an Oracle
    database, again, make sure that you pass a DateTimeData, and not the
    .TextValue.
    Good luck!
    Richard Kirk

    Date: Wed, 06 Nov 1996 08:18:37 -0500
    To: "C. M. Motta" <[email protected]>
    From: Jim Milbery <[email protected]>
    Subject: Re: Oracle DATE data format conversion..
    Cc: [email protected]
    Cheers:
    Most likely what is happening is that you are using the default date
    format of Oracle, and you are sending a four-character year. As follows:
    SQL> insert into jimbo values ('01-dec-1997')
    2 /
    insert into jimbo values ('01-dec-1997')
    ERROR at line 1:
    ORA-01830: date format picture ends before converting entire inputstring
    >
    Oracle defaults to a format of 'dd-MON-yy'
    You can either truncate the year, or manipulate the date to match the standard
    database as follows:
    insert into jimbo values (to_Date('01-jan-1997', 'DD-MON-YYYY'))
    \jimbo
    At 09:21 AM 11/6/96 -0200, you wrote:
    Forte Users,
    First, Id like to thank all those who answered my question on
    droplist & SQL. I got just what I was looking for: its up and runnunig
    now.
    I have another question: Im trying to insert a DATE into an Oracle
    database. The source date is:
    data : DateTimeData = new;
    data.SetCurrent();
    So, when I try to insert data.Value or data.textvalue into DB, I
    get the following exception:
    ORA-01830: date format picture ends before converting entire
    input string.
    Are there any suggestions?
    Thanks for your help,
    C.M. Motta
    ====================================================================
    Jim Milbery
    Milbery Consulting Group
    132 N. West St., Allentown, PA 18102
    O: 610 - 432 - 5350 F: 610 - 432 - 5380
    E-Mail : [email protected]
    ====================================================================

  • Hi. Migrated photos from Photoshop Album to Phtoshop Elements 13. Lost all tags Any ideas?

    Hi. Migrated photos from Photoshop Album to Photoshop Elements 13. Lost all tags Any ideas?

    I'm not sure but it sounds a lot like the question I posed to the forum a little later today.  It may be that the newer versions of PSE are not compatible with transfering all the Categories, Sub Categories and Tags from versions up to PSE 10.  I am presently using PSE 10 because I couldn't figure out how to save all the organization I have put into Elements over the past 10 years or so.
    I'm hoping for an answer to my question.

  • Is it possible to sort tags?

    I've tried various methods of sorting tags. None of them really represents the conventional output one would consider "sorting". I've had to, for example, prefix categories of tags in order to get some semblance of order. Lately not even this works very well after going through various updates to Firefox.
    Further, there doesn't seem to be anything on the Mozilla website for Firefox that addresses this question. Perhaps my library of Bookmarks is more extensive than most, and those who program the interface have never seen a need to provide this capability to sort tags. In my case, since I've used tags to introduce order and fast access to information, tags have become indispensable to that end.
    Maybe the reason this capability is missing is because it is not technically feasible. I would like to know whether or not it is so I don't continue to search for a solution.

    Hi jscher2000,
    The reason I haven’t tried your method is that I have no idea where you enter the “query”. You did not explain that:
    • type=6 means tag query
    • sort=14 means descending order by last modified date
    • maxResults=10 means only show the first 10 results
    So where am I supposed to put the above? I did view the SQLite Manager extension description. I’m quite busy now and don’t have the time to get involved with another interface to sort Tags within Firefox. I’m also reticent to start adding Extensions to overcome Firefox inadequacies.
    There are some Add-ons which are quite helpful, like the “Go Parent Folder” and “Show Parent Folder”. I use these extensively to keep my Bookmarks in order and to find particular ones that would be very difficult to find otherwise in order to redefine the links associated with Tags. But these routines are simple downloads that don’t require anything beyond simply downloading the Add-on.
    The technique I described requires no Extension to be added, and appears to be less of a drag on my schedule than going through the learning curve of using SQLite. I did notice that the description of the SQLite extension has gone through various revisions, so I’m not sure how that might have impacted previous Tag sorting per the lines of code you provided above. When I began using LISP (actually AutoLISP) there was a great deal of payback for the effort put forth to get the desired results. There were also additions, deletions and redefined ways of doing things which meant past efforts had to be revised or were no longer workable. And with time these AutoLISP shortcuts (macros) actually became part of the main program.
    This takes me back to my original comment about why the Firefox interface did not provide this sorting capability in the first place. If SQLite can do this effectively and easily, then why isn’t the sorting capability included with the Firefox browser download?
    Your description of the process appears to be somewhat involved, more so than my technique of ordering Tags by modifying them through the Properties window to obtain the desired Sort, which is cumbersome but effective. This could be referred to as the K.I.S.S. principle (Keep It Simple Stupid), the last part of which I freely admit.
    Thanks, though, for providing an alternative way to sort Tags.

  • Advanced Format Conversion - PAL - NTSC question

    I need to convert from DV PAL (@ 25fps) to DV NTSC (@ 23.98fps).
    My first test conversion resulted in a DV file running at 29.97 fps.
    Also, I seem unable to modify the speed settings in order to re-time from PAL to NTSC, which should run approximately 4% longer.
    Can somebody guide me through how to achieve this?
    G5, dual 2.7   Mac OS X (10.4.9)   Final Cut Studio 2.0

    Marc:
    AFAIK standard DV NTSC is 23.97 fps, why do you need 23.98?
    The best free way I found is with Compressor Advanced format conversion, using the settings you'll find in this thread posted by Andynick:
    http://discussions.apple.com/thread.jspa?messageID=3055477&#3055477
    Export your timeline as Quicktime Movie, same settings (self contained if you have space) and use that in Compressor.
    Hope that helps !
      Alberto

  • Regarding Date Format Conversion

    Hi,
    In my project i am picking the date from the date picker which is a javascript program . Then i am displaying it on a jsp page .It is coming in mm/dd/yyyy format .I have to change it to dd/mm/yyyy format .
    I have the code for date formatting conversion .
    What my doubt is whether  the code should be written inside the jsp page or in the javascript .
    Thanks .

    Hi
    <%@page language="java" import="java.sql.*,java.util.*,java.text.*" %>
    <%SimpleDateFormat sdf= new SimpleDateFormat(dd/mm/yyyy );%>
    <% java.util.Date temp_date = sdf.parse(PassYourDateHere); %>
    use this with your jsp
    Regards
    Abhijith YS

  • FM for OTF to TIFF format conversion?

    Hi,
    Any function module for OTF to TIFF(image file ) format conversion or anything to do it.
    Thanks
    Vaibhav

    hi,
    please check this link.. this contain some function moule to convert OTF -> other formats .. Not sure of TIFF
    [http://help.sap.com/saphelp_45b/helpdata/EN/08/e043c4c18711d2a27b00a0c943858e/content.htm]
    safel

  • Sorting/tag trouble

    Could someone save me an aneurysm and tell me how an artist named "Jackson Browne" ends up showing up in my library in the O's when sorted? I've tried changing the Sorting tags, even completely erasing the Artist Name, then re-typing it in, and yet, it still shows up in in the O's.
    Help.
    This *****.

    I think you are on the right track here. I want to edit the child entity manually but I don't know how. I went to the edit query for the child entity on the screen but there is no option to add code to manually sort or filter for a screen query in VS LS
    2012. Ideally I would like to sort all instances of the grid control by Monogram or MonogramC(a calculated field) AND by Reviewed(a boolean) OR just filter the specific Grid under one of the tabs the Grid is named MedicationOrderDetails5.
    How do I do this I am not sure about even the code to use I have thought of adding the following to the screen code. How would you code something like this?
    using System;
    using System.Linq;
    using System.IO;
    using System.IO.IsolatedStorage;
    using System.Collections.Generic;
    using Microsoft.LightSwitch;
    using Microsoft.LightSwitch.Framework.Client;
    using Microsoft.LightSwitch.Presentation;
    using Microsoft.LightSwitch.Presentation.Extensions;
    //added to alow OLE DB data set code
    using System.Data;
    //using System.Data.OleDb;
    //added for Process Start statement
    using System.Diagnostics;
    using System.Linq.Expressions;
    namespace LightSwitchApplication
    public partial class TimesAndMARs
    partial void TimesAndMARs_InitializeDataWorkspace(List<IDataService> saveChangesTo)
    // Write your code here.
    //MedicationOrderDetails5
    partial void Reviewed_Filter(ref Expression<Func<MedicationOrderDetail, bool>> filter)
    filter = e => e.Reviewed != true;
    partial void OrderedByMonoramCalculatedField_PreprocessQuery
    (short? MonogramC, ref IQueryable<MedicationOrderDetail> query)
    query = (from myOrder in query
    where myOrder.MonogramC.Count() > 0
    orderby myOrder.MonogramC ascending
    select myOrder);

  • SCOT error "File format conversion error"

    Dear All,
    When a PDF file is sent as a FAX, the SCOT throws the following error with message XS 812:
    No delivery to <fax_number>
    Message no. XS812
    Diagnosis
    The message could not be delivered to recipient <fax_number>. The node gave the following reason (in the language of the node):
    File format conversion error
    Can anybody suggest what could be the problem?
    Note that the normal PCL and RAW data are being sent to the same FAX number without any problem.
    Thanks
    Sagar

    Hello,
    You need to specify the correct formats:
    Check this link:
    http://help.sap.com/saphelp_nw70/helpdata/EN/b0/f8ef3aabdfb20de10000000a11402f/frameset.htm
    Regards,
    Siddhesh

  • HTMLDocument ending with SUB TAG=bad formatting

    Hi, I have a problem when tring to format text in JTextPane in HTMLDocument. When the text ends with </SUB> and I call document..setCharacterAttributes(0, doc.getLength(), attrs, false) text formatting goes wrong!!
    Why? Is it not possible to end text in document with "text<SUB>sub text</SUB>"?
    I prepared some sample code below, which should clarify what I want. Click one of 4 buttons to setText, then click repeatedly Format button to change its format.
    I want to know what am I doing wrong and how to do it right. Problem lies in calling method setCharacterAttributes. When changing its parameters I get different formattings, and not the one I expect :-( .
    When the formatting goes wrong all characters are put inside SUB tag. HTML code then looks like this:
    <html>
      <head>
        <font color="#000000" size="4" face="Arial"><sub>//<--This SUB tag is is added too
    </sub></font>  </head>
      <body>
        <font color="#000000" size="4" face="Arial"><sub>text that had many sub tags and now has none and is inside this sub tag, when this tag shouldnt exist</sub></font>
      </body>
    </html>Please HELP!!!
    Sample code below
    import javax.swing.text.*;
    import java.awt.*;
    import javax.swing.text.html.*;
    import javax.swing.text.html.HTML.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Example extends JFrame {
      JScrollPane sp;
      JTextPane textPane = new JTextPane();
      HTMLEditorKit htmlKit;
      JButton text1Button = new JButton("short SUB text");
      JButton text2Button = new JButton("long SUB text");
      JButton text3Button = new JButton("long SUB text ending with text");
      JButton text4Button = new JButton("long normal text");
      JButton formatButton = new JButton("Format");
      StringBuffer text1,text2,text3,text4;
      Font font = new Font("Arial",Font.ITALIC,14);
      public Example() {
        this.setTitle("SUB TAG bad formatting Example");
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setSize(700, 400);
        htmlKit = new HTMLEditorKit();
        HTMLDocument doc = (HTMLDocument)htmlKit.createDefaultDocument();
        textPane.setContentType("text/html");
        textPane.setEditorKit(htmlKit);
        textPane.setDocument(doc);
        sp = new JScrollPane(textPane,
                             JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                             JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
        JPanel menuPanel = new JPanel();
        menuPanel.add(text1Button);
        menuPanel.add(text2Button);
        menuPanel.add(text3Button);
        menuPanel.add(text4Button);
        menuPanel.add(formatButton);
        text1Button.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            textPane.setText(text1.toString());
        text2Button.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            textPane.setText(text2.toString());
        text3Button.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            textPane.setText(text3.toString());
        text4Button.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent e) {
           textPane.setText(text4.toString());
        formatButton.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            setJTextPaneFont(textPane,font,new Color((float)Math.random(),(float)Math.random(),(float)Math.random()));
        text1 = new StringBuffer();
        for (int i=1;i<10;i++) {
          text1.append("a<SUB>"+i+"</SUB> ");
        //text1.append("<BR>");//<--Add this line to get it working, however moving cursor behind any number and pressing Format, results same format error
        text2 = new StringBuffer();
        for (int i=1;i<1000;i++) {
          text2.append("a<SUB>"+i+"</SUB> ");
        //text2.append("<BR>");//<--Add this line to get it working, however moving cursor behind any number and pressing Format, results same format error
        text3 = new StringBuffer();
        text3.append(text2+"END");//moving cursor behind any number in sub tag and pressing Format, results same format error
        text4 = new StringBuffer();
        for (int i=1;i<2000;i++) {
          text4.append("a_"+i+" ");
        JPanel mainPanel = new JPanel();
        mainPanel.setLayout(new BorderLayout());
        mainPanel.add(menuPanel,BorderLayout.NORTH);
        mainPanel.add(sp,BorderLayout.CENTER);
        this.getContentPane().setLayout(new BorderLayout());
        this.getContentPane().add(mainPanel,BorderLayout.CENTER);
      public static void setJTextPaneFont(JTextPane jtp, Font font, Color c) {
        MutableAttributeSet attrs = jtp.getInputAttributes();
        StyleConstants.setFontFamily(attrs, font.getFamily());
        StyleConstants.setFontSize(attrs, font.getSize());
        StyleConstants.setItalic(attrs, (font.getStyle() & Font.ITALIC) != 0);
        StyleConstants.setBold(attrs, (font.getStyle() & Font.BOLD) != 0);
        StyleConstants.setForeground(attrs, c);
        StyledDocument doc = jtp.getStyledDocument();
        doc.setCharacterAttributes(0, doc.getLength(), attrs, false);
      public static void main(String[] args) {
        Example frame = new Example();
        //Center the window
        Dimension frameSize = frame.getSize();
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        if (frameSize.height > screenSize.height) {
          frameSize.height = screenSize.height;
        if (frameSize.width > screenSize.width) {
          frameSize.width = screenSize.width;
        frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
        frame.setVisible(true);
    }

    Thanks for the dukes.
    Actually I have very little knowledge about html handling in java. On you particular problem, I just went and browsed through the source code in search for the sub tag (which I didn't know before by the way) to see what effect it had on the StyledDocument.
    As far as your performance problem in loading html pages, my best advice would be to conduct experiments and try to see where the bottleneck is. I know that there is a way to make setPage synchronous. It has to do with setting some variable in the Document (I guess searching the forum might help on this). This can make it easier to actually measure how long it takes. Moreover, you might want to try and load a small page first and then your heavy one : that way you'll know if it has to do with loading the classes of the HTMLEditorKit. Another advice would be to make sure you feed your JEditorPane with pure HMTL 3.2. I have no idea about this but maybe parsing unknown tags slows down the loading (pure guess). One last advice would be to make multiple versions of your file with slight modifications in each case (like remove the tables, for instance). That might help determine if it has anything to do with the actual content you're trying to load.

  • I have proubleam with string to date conversion, i out put date fromat is 2012-04-30T23:48:55.727-07:00 . so please help me the format conversion

    i have proubleam with string to date conversion, i out put date fromat is 2012-04-30T23:48:55.727-07:00 . so please help me the format conversion.
    i wrote the method but it not workig
    My method is
    -(NSDate *)dateformstr:(NSString *)str
    NSString *date = [str stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
        NSDateFormatter *dateFormate = [[NSDateFormatter alloc] init];
      [dateFormate setDateFormat:@"yyyy-MM-dd'T'HH:mm:sssZZZZ"]
    // NSDate *formatterDate = [dateFormate  dateFromString:str];
        return formatterDate;
    but i did not the value and if i try othere formate i is working but my requiremet format is 2012-04-30T23:48:55.727-07:00.
    can any help it out in this senario.

    Sorry Butterbean, but I'm interested in the answer to your question myself.
    I've spent a few hours transfering my library from one computer to another and then find out that my ratings didn't transfer. Like you, I've spent many hours rating my 2000+ songs. I'm sure you have more, nevertheless, I want to find out how to get those ratings. They still show in my iTunes on my laptop but, when I go to the iTunes folder and display the details of at song, no rating is there. If you find out how to get them to display there in the iTunes folder, it seems that would be the key.
    Hope you get your answer soon.

  • Format Conversion : Transcoding

    Hi,
    I am working on an application for format conversion of files, be it audio or video files. I tried the code Transcode.java (attached below) given in JMF, but I could only succeed in converting .wav files to .mp3 files. I have till date been unable to convert any video files from one format to another. I might be missing out on certain assumptions as to which files can be converted to the required format or not. Kindly give some sample code if anyody has any and also any suggestions please so that I can fulfill the requirement.
    Also kindly suggest a possible algorithm for the problem.
    Thanks,
    Amit
    import java.awt.*;
    import java.util.Vector;
    import java.io.File;
    import javax.media.*;
    import javax.media.control.TrackControl;
    import javax.media.control.QualityControl;
    import javax.media.Format;
    import javax.media.format.*;
    import javax.media.datasink.*;
    import javax.media.protocol.*;
    import javax.media.protocol.DataSource;
    import java.io.IOException;
    import com.sun.media.format.WavAudioFormat;
    * A sample program to transcode an input source to an output location
    * with different data formats.
    public class Transcode implements ControllerListener, DataSinkListener {
          * Given a source media locator, destination media locator and
          * an array of formats, this method will transcode the source to
          * the dest into the specified formats.
         public boolean doIt(MediaLocator inML, MediaLocator outML, Format fmts[],
                   int start, int end) {
              Processor p;
              try {
                   System.err.println("- create processor for: " + inML);
                   p = Manager.createProcessor(inML);
              } catch (Exception e) {
                   System.err.println("Yikes!  Cannot create a processor from the given url: " + e);
                   return false;
              p.addControllerListener(this);
               *     Put the Processor into configured state.
              p.configure();
              if (!waitForState(p, p.Configured)) {
                   System.err.println("Failed to configure the processor.");
                   return false;
               *     Set the output content descriptor based on the media locator.
              setContentDescriptor(p, outML);
               *     Program the tracks to the given output formats.
              if (!setTrackFormats(p, fmts))
                   return false;
               * We are done with programming the processor.  Let's just
               * realize the it.
              p.realize();
              if (!waitForState(p, p.Realized)) {
                   System.err.println("Failed to realize the processor.");
                   return false;
               *  Set the JPEG quality to .5.
              setJPEGQuality(p, 0.5f);
               *  Now, we'll need to create a DataSink.
              DataSink dsink;
              if ((dsink = createDataSink(p, outML)) == null) {
                   System.err.println("Failed to create a DataSink for the given output MediaLocator: " + outML);
                   return false;
              dsink.addDataSinkListener(this);
              fileDone = false;
               *   Set the start time if there's one set.
              if (start > 0)
                   p.setMediaTime(new Time((double)start));
               *  Set the stop time if there's one set.
              if (end > 0)
                   p.setStopTime(new Time((double)end));
              System.err.println("start transcoding...");
               *   OK, we can now start the actual transcoding.
              try {
                   p.start();
                   dsink.start();
              } catch (IOException e) {
                   System.err.println("IO error during transcoding");
                   return false;
               *  Wait for EndOfStream event.
              waitForFileDone();
               * Cleanup.
              try {
                   dsink.close();
              } catch (Exception e) {}
              p.removeControllerListener(this);
              System.err.println("...done transcoding.");
              return true;
          * Set the content descriptor based on the given output MediaLocator.
         void setContentDescriptor(Processor p, MediaLocator outML) {
              ContentDescriptor cd;
               *  If the output file maps to a content type, we'll try to set it on the processor.
              if ((cd = fileExtToCD(outML.getRemainder())) != null) {
                   System.err.println("- set content descriptor to: " + cd);
                   if ((p.setContentDescriptor(cd)) == null) {
                         * The processor does not support the output content type.  But we can set the content type to RAW and
                         * see if any DataSink supports it.
                        p.setContentDescriptor(new ContentDescriptor(ContentDescriptor.RAW));
          * Set the target transcode format on the processor.
         boolean setTrackFormats(Processor p, Format fmts[]) {
              if (fmts.length == 0)
                   return true;
              TrackControl tcs[];
              if ((tcs = p.getTrackControls()) == null) {
                    *      The processor does not support any track control.
                   System.err.println("The Processor cannot transcode the tracks to the given formats");
                   return false;
              for (int i = 0; i < fmts.length; i++) {     
                   System.err.println("- set track format to: " + fmts);
                   if (!setEachTrackFormat(p, tcs, fmts[i])) {
                        System.err.println("Cannot transcode any track to: " + fmts[i]);
                        return false;
              return true;
         * We'll loop through the tracks and try to find a track
         * that can be converted to the given format.
         boolean setEachTrackFormat(Processor p, TrackControl tcs[], Format fmt) {
              Format supported[];
              Format f;
              for (int i = 0; i < tcs.length; i++) {
                   supported = tcs[i].getSupportedFormats();
                   if (supported == null)
                        continue;
                   for (int j = 0; j < supported.length; j++) {
                        if (fmt.matches(supported[j]) &&
                                  (f = fmt.intersects(supported[j])) != null &&
                                  tcs[i].setFormat(f) != null) {
                             * Success.
                             return true;
              return false;
         * Setting the encoding quality to the specified value on the JPEG encoder.
         * 0.5 is a good default.
         void setJPEGQuality(Player p, float val) {
              Control cs[] = p.getControls();
              QualityControl qc = null;
              VideoFormat jpegFmt = new VideoFormat(VideoFormat.JPEG);
              * Loop through the controls to find the Quality control for the JPEG encoder.
              for (int i = 0; i < cs.length; i++) {
                   if (cs[i] instanceof QualityControl &&
                             cs[i] instanceof Owned) {
                        Object owner = ((Owned)cs[i]).getOwner();
                        * Check to see if the owner is a Codec. Then check for the output format.     
                        if (owner instanceof Codec) {
                             Format fmts[] = ((Codec)owner).getSupportedOutputFormats(null);
                             for (int j = 0; j < fmts.length; j++) {
                                  if (fmts[j].matches(jpegFmt)) {
                                       qc = (QualityControl)cs[i];
                                       qc.setQuality(val);
                                       System.err.println("- Set quality to " +
                                                 val + " on " + qc);
                                       break;
                        if (qc != null)
                             break;
         * Create the DataSink.
         DataSink createDataSink(Processor p, MediaLocator outML) {
              DataSource ds;
              if ((ds = p.getDataOutput()) == null) {
                   System.err.println("Something is really wrong: the processor does not have an output DataSource");
                   return null;
              DataSink dsink;
              try {
                   System.err.println("- create DataSink for: " + outML);
                   dsink = Manager.createDataSink(ds, outML);
                   dsink.open();
              } catch (Exception e) {
                   System.err.println("Cannot create the DataSink: " + e);
                   return null;
              return dsink;
         Object waitSync = new Object();
         boolean stateTransitionOK = true;
         * Block until the processor has transitioned to the given state.
         * Return false if the transition failed.
         boolean waitForState(Processor p, int state) {
              synchronized (waitSync) {
                   try {
                        while (p.getState() < state && stateTransitionOK)
                             waitSync.wait();
                   } catch (Exception e) {
                        System.out.println("Exception 1 : " + e.getMessage());
              return stateTransitionOK;
         * Controller Listener.
         public void controllerUpdate(ControllerEvent evt) {
              if (evt instanceof ConfigureCompleteEvent ||
                        evt instanceof RealizeCompleteEvent ||
                        evt instanceof PrefetchCompleteEvent) {
                   synchronized (waitSync) {
                        stateTransitionOK = true;
                        waitSync.notifyAll();
              } else if (evt instanceof ResourceUnavailableEvent) {
                   synchronized (waitSync) {
                        stateTransitionOK = false;
                        waitSync.notifyAll();
              } else if (evt instanceof EndOfMediaEvent) {
                   evt.getSourceController().close();
              } else if (evt instanceof MediaTimeSetEvent) {
                   System.err.println("- mediaTime set: " +
                             ((MediaTimeSetEvent)evt).getMediaTime().getSeconds());
              } else if (evt instanceof StopAtTimeEvent) {
                   System.err.println("- stop at time: " +
                             ((StopAtTimeEvent)evt).getMediaTime().getSeconds());
                   evt.getSourceController().close();
         Object waitFileSync = new Object();
         boolean fileDone = false;
         boolean fileSuccess = true;
         * Block until file writing is done.
         boolean waitForFileDone() {
              System.err.print(" ");
              synchronized (waitFileSync) {
                   try {
                        while (!fileDone) {
                             waitFileSync.wait(1000);
                             System.err.print(".");
                   } catch (Exception e) {
                        System.out.println("Exception 2 : " + e.getMessage());
              System.err.println("");
              return fileSuccess;
         * Event handler for the file writer.
         public void dataSinkUpdate(DataSinkEvent evt) {
              if (evt instanceof EndOfStreamEvent) {
                   synchronized (waitFileSync) {
                        fileDone = true;
                        waitFileSync.notifyAll();
              } else if (evt instanceof DataSinkErrorEvent) {
                   synchronized (waitFileSync) {
                        fileDone = true;
                        fileSuccess = false;
                        waitFileSync.notifyAll();
         * Convert a file name to a content type. The extension is parsed
         * to determine the content type.
         ContentDescriptor fileExtToCD(String name) {
              String ext;
              int p;
              * Extract the file extension.
              if ((p = name.lastIndexOf('.')) < 0)
                   return null;
              ext = (name.substring(p + 1)).toLowerCase();
              String type;
              * Use the MimeManager to get the mime type from the file extension.
              if ( ext.equals("mp3")) {
                   type = FileTypeDescriptor.MPEG_AUDIO;
              } else {
                   if ((type = com.sun.media.MimeManager.getMimeType(ext)) == null)
                        return null;
                   type = ContentDescriptor.mimeTypeToPackageName(type);
              return new FileTypeDescriptor(type);
         * Main program
         public static void main(String [] args) {
              String inputURL = null, outputURL = null;
              int mediaStart = -1, mediaEnd = -1;
              Vector audFmt = new Vector(), vidFmt = new Vector();
              if (args.length == 0)
                   prUsage();
              * Parse the arguments.
              int i = 0;
              while (i < args.length) {
                   if (args[i].equals("-v")) {
                        i++;
                        if (i >= args.length)
                             prUsage();
                        vidFmt.addElement(args[i]);
                   } else if (args[i].equals("-a")) {
                        i++;
                        if (i >= args.length)
                             prUsage();
                        audFmt.addElement(args[i]);
                   } else if (args[i].equals("-o")) {
                        i++;
                        if (i >= args.length)
                             prUsage();
                        outputURL = args[i];
                   } else if (args[i].equals("-s")) {
                        i++;
                        if (i >= args.length)
                             prUsage();
                        Integer integer = Integer.valueOf(args[i]);
                        if (integer != null)
                             mediaStart = integer.intValue();
                   } else if (args[i].equals("-e")) {
                        i++;
                        if (i >= args.length)
                             prUsage();
                        Integer integer = Integer.valueOf(args[i]);
                        if (integer != null)
                             mediaEnd = integer.intValue();
                   } else {
                        inputURL = args[i];
                   i++;
              if (inputURL == null) {
                   System.err.println("No input url is specified");
                   prUsage();
              if (outputURL == null) {
                   System.err.println("No output url is specified");
                   prUsage();
              int j = 0;
              Format fmts[] = new Format[audFmt.size() + vidFmt.size()];
              Format fmt;
              * Parse the audio format spec. into real AudioFormat's.
              for (i = 0; i < audFmt.size(); i++) {
                   if ((fmt = parseAudioFormat((String)audFmt.elementAt(i))) == null) {
                        System.err.println("Invalid audio format specification: " +
                                  (String)audFmt.elementAt(i));
                        prUsage();
                   fmts[j++] = fmt;
              * Parse the video format spec. into real VideoFormat's.
              for (i = 0; i < vidFmt.size(); i++) {
                   if ((fmt = parseVideoFormat((String)vidFmt.elementAt(i))) == null) {
                        System.err.println("Invalid video format specification: " +
                                  (String)vidFmt.elementAt(i));
                        prUsage();
                   fmts[j++] = fmt;
              * Generate the input and output media locators.
              MediaLocator iml, oml;
              if ((iml = createMediaLocator(inputURL)) == null) {
                   System.err.println("Cannot build media locator from: " + inputURL);
                   System.exit(0);
              if ((oml = createMediaLocator(outputURL)) == null) {
                   System.err.println("Cannot build media locator from: " + outputURL);
                   System.exit(0);
              * Transcode with the specified parameters.
              Transcode transcode = new Transcode();
              if (!transcode.doIt(iml, oml, fmts, mediaStart, mediaEnd)) {
                   System.err.println("Transcoding failed");
              System.exit(0);
         * Create a media locator from the given string.
         static MediaLocator createMediaLocator(String url) {
              MediaLocator ml;
              if (url.indexOf(":") > 0 && (ml = new MediaLocator(url)) != null)
                   return ml;
              if (url.startsWith(File.separator)) {
                   if ((ml = new MediaLocator("file:" + url)) != null)
                        return ml;
              } else {
                   String file = "file:" + System.getProperty("user.dir") + File.separator + url;
                   if ((ml = new MediaLocator(file)) != null)
                        return ml;
              return null;
         * Parse the audio format specifier and generate an AudioFormat.
         * A valid audio format specifier is of the form:
         * [encoding]:[rate]:[sizeInBits]:[channels]:big:signed
         static Format parseAudioFormat(String fmtStr) {
              int rate, bits, channels, endian, signed;
              String encodeStr = null, rateStr = null,
              bitsStr = null, channelsStr = null,
              endianStr = null, signedStr = null;
              * Parser the media locator to extract the requested format.
              if (fmtStr != null && fmtStr.length() > 0) {
                   while (fmtStr.length() > 1 && fmtStr.charAt(0) == ':')
                        fmtStr = fmtStr.substring(1);
                   * Now see if there's a encode rate specified.
                   int off = fmtStr.indexOf(':');
                   if (off == -1) {
                        if (!fmtStr.equals(""))
                             encodeStr = fmtStr;
                   } else {
                        encodeStr = fmtStr.substring(0, off);
                        fmtStr = fmtStr.substring(off + 1);
                        * Now see if there's a sample rate specified
                        off = fmtStr.indexOf(':');
                        if (off == -1) {
                             if (!fmtStr.equals(""))
                                  rateStr = fmtStr;
                        } else {
                             rateStr = fmtStr.substring(0, off);
                             fmtStr = fmtStr.substring(off + 1);
                             * Now see if there's a size specified
                             off = fmtStr.indexOf(':');
                             if (off == -1) {
                                  if (!fmtStr.equals(""))
                                       bitsStr = fmtStr;
                             } else {
                                  bitsStr = fmtStr.substring(0, off);
                                  fmtStr = fmtStr.substring(off + 1);
                                  * Now see if there's channels specified.
                                  off = fmtStr.indexOf(':');
                                  if (off == -1) {
                                       if (!fmtStr.equals(""))
                                            channelsStr = fmtStr;
                                  } else {
                                       channelsStr = fmtStr.substring(0, off);
                                       fmtStr = fmtStr.substring(off + 1);
                                       * Now see if there's endian specified.
                                       off = fmtStr.indexOf(':');
                                       if (off == -1) {
                                            if (!fmtStr.equals(""))
                                                 endianStr = fmtStr.substring(off + 1);
                                       } else {
                                            endianStr = fmtStr.substring(0, off);
                                            if (!fmtStr.equals(""))
                                                 signedStr = fmtStr.substring(off + 1);
              * Sample Rate
              rate = AudioFormat.NOT_SPECIFIED;
              if (rateStr != null) {
                   try {
                        Integer integer = Integer.valueOf(rateStr);
                        if (integer != null)
                             rate = integer.intValue();
                   } catch (Throwable t) {
                        System.out.println("Exception 3 ");
              * Sample Size
              bits = AudioFormat.NOT_SPECIFIED;
              if (bitsStr != null) {
                   try {
                        Integer integer = Integer.valueOf(bitsStr);
                        if (integer != null)
                             bits = integer.intValue();
                   } catch (Throwable t) {
                        System.out.println("Exception :4 " );
              * # of channels
              channels = AudioFormat.NOT_SPECIFIED;
              if (channelsStr != null) {
                   try {
                        Integer integer = Integer.valueOf(channelsStr);
                        if (integer != null)
                             channels = integer.intValue();
                   } catch (Throwable t) {
                        System.out.println("Exception : 5 ");
              * Endian
              endian = AudioFormat.NOT_SPECIFIED;
              if (endianStr != null) {
                   if (endianStr.equalsIgnoreCase("big"))
                        endian = AudioFormat.BIG_ENDIAN;
                   else if (endianStr.equalsIgnoreCase("little"))
                        endian = AudioFormat.LITTLE_ENDIAN;
              * Signed
              signed = AudioFormat.NOT_SPECIFIED;
              if (signedStr != null) {
                   if (signedStr.equalsIgnoreCase("signed"))
                        signed = AudioFormat.SIGNED;
                   else if (signedStr.equalsIgnoreCase("unsigned"))
                        signed = AudioFormat.UNSIGNED;
              return new AudioFormat(encodeStr, rate, bits, channels, endian, signed);
         * Parse the video format specifier and generate an VideoFormat.
         * A valid video format specifier is of the form:
         * [encoding]:[widthXheight]
         static Format parseVideoFormat(String fmtStr) {
              String encodeStr = null, sizeStr = null;
              * Parser the media locator to extract the requested format.
              if (fmtStr != null && fmtStr.length() > 0) {
                   while (fmtStr.length() > 1 && fmtStr.charAt(0) == ':')     
                        fmtStr = fmtStr.substring(1);
                   * Now see if there's a encode rate specified.
                   int off = fmtStr.indexOf(':');
                   if (off == -1) {
                        if (!fmtStr.equals(""))
                             encodeStr = fmtStr;
                   } else {
                        encodeStr = fmtStr.substring(0, off);
                        sizeStr = fmtStr.substring(off + 1);
              if (encodeStr == null || encodeStr.equals(""))
                   prUsage();
              if (sizeStr == null)
                   return new VideoFormat(encodeStr);
              int width = 320, height = 240;
              int off = sizeStr.indexOf('X');
              if (off == -1)
                   off = sizeStr.indexOf('x');
              if (off == -1) {
                   System.err.println("Video dimension is not correctly specified: " + sizeStr);
                   prUsage();
              } else {
                   String widthStr = sizeStr.substring(0, off);
                   String heightStr = sizeStr.substring(off + 1);
                   try {
                        Integer integer = Integer.valueOf(widthStr);
                        if (integer != null)
                             width = integer.intValue();
                        integer = Integer.valueOf(heightStr);
                        if (integer != null)
                             height = integer.intValue();
                   } catch (Throwable t) {
                        System.out.println("Exception : 6");
                        prUsage();
                   return new VideoFormat(encodeStr,
                             new Dimension(width, height),
                             VideoFormat.NOT_SPECIFIED, // maxDataLen
                             null,                // data class
                             VideoFormat.NOT_SPECIFIED // FrameRate
              return null;
         static void prUsage() {
              System.err.println("Usage: java Transcode -o <output> -a <audio format> -v <video format> -s <start time> -e <end time> <input>");
              System.err.println(" <output>: input URL or file name");
              System.err.println(" <input>: output URL or file name");
              System.err.println(" <audio format>: [encoding]:[rate]:[sizeInBits]:[channels]:big:signed");
              System.err.println(" <video format>: [encoding]:[widthXheight]");
              System.err.println(" <start time>: start time in seconds");
              System.err.println(" <end time>: end time in seconds");
              System.exit(0);

    Actually, it's XDcam Ex in a .mov wrapper.
    +An out-of-the-box GY-HM700 can record to inexpensive SDHC cards (class 6 or faster) as Quicktime .MOV using the XDCAM EX codec at selectable bitrates of 19, 25 or 35Mbps. The Mpeg-2 encoder is JVC’s, the XDCAM EX codec is licensed from Sony, and the Quicktime wrapper is licensed from Apple.+
    http://www.dvinfo.net/articles/jvcprohd/hm700firstlook.php

  • Failed. Format conversion is not supported

    Hello again, this error happened when I was playing around with Creative Audio Converter
    Failed. Format conversion is not supported
    This error happened when I was converting a song from WMA Pro, 128 Kbps, 44khz, 2 Channel 24-Bit to WMA Pro, 128 Kbps, 44khz, 5.1 Channel 24-Bit
    Why is this error happening? And if the conversion is not supported, then why did Creative bother to put this format on their sound cards? Or is this another of Microsoft's problem?
    Thank You.

    Thank you very much for answering my query about that, at this moment i am very interested on 5.1 channel conversion. I have written to other ppl on other forums about 5.1 channel conversion. One person told me that there are a lot of ways to do it, depending on what kind of 5.1 upmixing do you want to perform. What kinds of upmixing do you use for 5.1 channel conversion? What do you recomend?
    Thank You very much

  • Batch format conversion and export

    There are dozens of archived (unanswered) threads on that simple topic: How can you batch convert and export audio files from *Folder A* to *Folder B* in Soundtrack Pro (or Logic Pro etc.)?
    I read about saving actions "as Apple Script..", but this doesn't seem to apply to format conversions.

    first of all are you trying to do this with the Multitrack or the audio file project modes?
    Quite frankly I use other software to do this, not STP.

Maybe you are looking for

  • HT200188 NAT from KB/ht5215 broken in ML 10.8.2?

    We've been using NAT with Lion Server and ML Server as described in the KB article but this config has broken on of our servers with the 10.8.2 / Server 2.1 (and 2.1.1) update. Basically, the pfctl lauch daemon won't load (exited with code: 1). Has a

  • Cannot open adobe reader at all

    I cannot open Adobe reader, even the icon on my desktop I mean. I have windows 7 and I could not open PDF file on web either. It will have a full blue bar telling me it is fully downloaded but the actual content never shows up. I tried uninstall and

  • PORTAL AND SSL?

    Hi all, I am trying to enable SSL in Portal? I am a new user and I am having problems doing so. Could anybody guide me through the process of doing so? Thank you, Kostas

  • COMMENT SORTIR DU SENS DE LECTURE INVERSÉ DANS L'ONGLET PAGES ?

    Bonjour, J'utilise Indesign CS6 ; je ne comprends pas ce qui arrive, je créée un nouveau document et en ajoutant des pages c'est comme si elles se mettaient dans le sens de lecture arabe de gauche à droite pour la numérotation qui s'affiche sous les

  • Automatic creation of Delivery Notes in pick transaction

    In the pick transaction, when you have a lot of lines  with a lot of Delivery adresses, the button (Deliver) creates automatically all the Delivery notes. That's fine but all the documents remains open until you add them manually in the system. I hav