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

Similar Messages

  • 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]
    ====================================================================

  • 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

  • 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

  • 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.

  • 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.

  • Audio Converter in MediaSource-Format Conversion is not support

    Just bought a ZEN Micro and I have a question about the Audio Converter in MediaSource. Everytime I try to convert a file I am getting this error: Format Conversion is Not supported.Fo example I just tried to convert a 92kbps MP3 to a 28kbps MP3. I also tried to convert the same file to a 28 WMA. Both times I got the Format Conversion is Not Supported Error. I have tried a few different files with no success.Please HELP!
    I emailed customer service and they told me to just reinstall MediaSource..Seems like thats the standard answer to everything...Any other suggestions would be helpful!
    Thanks

    Faztang,
    Reinstalling MediaSource can often resolve problems like this because they may be caused by a file that was not copied over correctly during install. This is usually a good first suggestion but it certainly isn't the only suggestion they will offer.
    What if you use the standalone version of the file converter, does it give you the same errors? Also if you haven't yet uninstalled and reinstalled you might try installing into a different directory as that can help with this also.
    Jeremy

  • Compressor vs Algolith for format conversion

    Has anyone done any testing in terms of frame rate and format conversion of Compressor vs the Algolith plugins for Shake?
    Cheers
    Al

    Hi,
    Compressor is REALLY slow if you use the highest quality settings.
    Algolith is always slow (check here):
    http://www.algolith.com/index.php?id=algotools_benchmarks
    Here is what they recommended to speed up the process:
    "To speed up the PAL to NTSC conversion, do it in 2 passes to avoid the content adaptive scaler which doesn’t do much when downscaling 720x576 to 720x480. My recommendation is MAADI double frame rate, AE scaling to 720x480 -> intermediate result. Intermediate result -> FC 50 frame per sec to 60 field per second."
    Their Noise Reduction Software is great. If that is any indication their format conversion is probably really good quality.
    If you try it let us know.
    Best Wishes!
    Mitch

  • Automated video format conversion on Windows?

    Hi all,
    I'm sure there are dozens of posts on here about video conversion, but I'm looking for something quite specific so thought best to start a clean thread. On my MBP I use Visualhub quite happily to convert other formats to MP4 for ATV, but I'm looking for a separate solution for my Windows machines that does the following:
    - Monitor folders for supported video files
    - Supports XVID, DIVX at a minimum, preferably more
    - Works relatively quickly and/or performs well, preferably able to respect the processor requirements of other apps on the machine by optionally using 'idle' processor
    It would be brilliant if there were something that did all of the above for free, but I'm happy to pay a reasonable amount for something that works well. I've tried using ImToo MPEG Encoder but it only satisfies the second criteria above and not very well at that. In my tests it also resulted in really bad audio sync issues in most formats (although i did have a slightly older version).
    Thanks in advance!
    Tom

    If you are willing to roll your own solution, directory monitoring can be done using DirMon2.
    http://www.dragonglobal.org/
    Transcoding can be done using MPEG StreamClip
    http://www.squared5.com/svideo/mpeg-streamclip-win.html
    And if you do a Google search, you can find some code that uses the iTunes API's to add a file to iTunes.
    Of course, other than DirMon2, it's all theory to me. I've never been able to get MPEG Stream Clip (or Quicktime Pro for that matter) to transcode anything longer than a couple of minutes. I've had pretty good results with Handbrake but it only works with DVDs.
    As far as "relatively quickly" goes, Handbrake runs at about .5x real time for me (AMD X2 3800+) on a two pass encode.
    I've pretty much given up on transcoding as an approach to feeding Apple TV until something that's more reliable and less work comes along. Or Apple comes to its senses and realizes that the lack of MPEG-2 support is hurting sales. Or I buy another Mac (my Powerbook takes forever to transcode). Short-term, I'm settling for photos, music, podcasts, and ITS content on my Apple TV

  • Date format conversion in BEX query level

    Hi ,
          We had a date field in the numeric format like 735.020 in the cube level, but when we execute the query the values for thsi date field is changed in to date format like 31.05.2013.
    we are not having any conversion routines and the date fields are used directly in the query .

    Hi,
    Try the below class file or may be create a method in your controller. It will resolve your problem.
    package com.XXX.DateFormatForSAP;
    import java.util.Date;
    import java.text.SimpleDateFormat;
    public class FormatSAPDate {
    public static String changeDateFormat(Date sapDate) {
    String formattedDate = null;
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
    formattedDate = dateFormat.format(sapDate);
    return formattedDate;
    Try this code and let me know.
    Regards
    Mukesh

  • File format conversion of Target file using FTP adapter

    Hi All,
    I am using FTP adapter to create the file on the Target side. But file needs to below format : How do i conver the XML File fomat( Default generate by XI ) to be generat to below file format;
    000000000000154162,
    CWC1A,,,,
    CWC1B,,,,
    CWC2A,,,,
    CWC2B,,,,
    Please provide your suggestion;
    thanks;
    MK

    Hi Mohan,
       I have a collection of Blogs (links) which Specify the File content conversion parameters.
    File content conversion, I am Not sure as which Link will Match Your Requirement exactly...
    /people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
    Please see the below links for file content conversion..
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter - FCC
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter - FCC
    File Content Conversion for Unequal Number of Columns
    /people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns - FCC
    Content Conversion (Pattern/Random content in input file)
    /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file - FCC
    Regards,
    Sainath chutke

  • Video format conversion help

    My friend imported video footage from two separate "action" cameras onto his mac book. The files are labeled as .avi files. I plan to edit the videos in PE4 to create a movie. I've transferred the files to my PC, but they only play on VLC media player. Other media players only play the audio portion.
    I tried importing the files into PE4 and again...only audio. I believe what I need to do is to download video conversion software and convert to a usable format (although I thought .avi was usable).
    I don't want to compromise video quality. Can someone suggest a good "free" video conversion program? Are there better programs for a nominal fee?
    Thanks.

    I'm not sure how he converted those files to AVIs, tm (Macs don't use AVI natively), but my guess is that they're not DV codec AVIs. More likely Cinepak AVIs.
    To see, open the videos in Windows Media Player and go to File/Properties. You'll see the codecs displayed there.
    From there, you could look for a converter -- or, even better, you could ask your friend to output DV-AVIs instead. He should have that ability if he's using Final Cut or even Quicktime Pro to output those AVIs.

Maybe you are looking for

  • Mail won't open - please help me if you can I'm feeling down .... and I do

    Hello everyone - never used this before so I don't know quite where it will arrive - BUT, HELP - my Mail program just will not load - I press the icon in the sidebar and it just hops and that's it! I hold the menue open and click 'open' and the same,

  • 4.2 update but phone still not does not work with Motorola T505

    I use an iPhone 3G and on 3.1 it could rebroadcast iTunes signals by FM to my car stereo. 4.1 lost this capacity. I was hoping to get it back with 4.2 but so far no success, even re-pairing the 505. (Otherwise the upgrade much improved the responsive

  • Using OpenVPN client on Windows 7 64 bit

    I am using  openvpn client 2.3.5-I602-x86_64 and when I connect I get the following message. I have tried running Openvpn as Administrator and disabling Windows firewall but no luck. From the same wireless network as my laptop with the same ovpn file

  • Music plays - Music doesn't play ?

    iTunes 10 library on external HD, wireless, OS 10.6.4, I have AirTunes working and listen to music on my external speakers. Sometimes the music moves to the next song in a list and plays but no sound. If I double click the song it starts over and pla

  • The page for License Keys in the CMC is blank

    After I had installed XI 3.1 inkluding some desktop tools, I had to uninstall Xcelsius. The result was that the License Keys page in the CMC turned blank. I am not able to add/change or even see my license keys anymore. How to get this back?