Missing something obvious (batch process with ffmpeg)

I have a number of video clips in .mov format. I want to trim the first four seconds from each, and save with a new name. This script works fine:
#!/bin/sh
ffmpeg -i clip1.mov -vcodec copy -acodec copy -ss 00:00:04 clip1trim.mov
ffmpeg -i clip2.mov -vcodec copy -acodec copy -ss 00:00:04 clip2trim.mov
ffmpeg -i clip3.mov -vcodec copy -acodec copy -ss 00:00:04 clip3trim.mov
and etc. I have quite a number of these.
Being 'typing lazy' I figured something like this would work:
#!/bin/sh
for f in *.mov;
do
echo "Procesing $f"
ffmpeg -i "$f"  -vcodec copy -acodec copy -ss 00:00:04  "${f%.mov}trim.mov"
done
I know only enough shell scripting to be dangerous, but I figured the problem had to do with quoting or shell substitution -- two topics I am weak on.
Instead it tries to run each file and throws this error:
"Unable to find a suitable output format for ' -vcodec'"
Anyway, I appreciate any help.
Andy

#!/bin/sh
for f in *.mov
do
echo "Procesing $f"
ffmpeg -i "$f" -vcodec copy -acodec copy -ss 00:00:04 "${f%.mov}trim.mov"
done
Your script actually looks rather good.
I can not see anything wrong with it from a scripting point of view.
You might try running the script using
sh -x your.script
which should show you want the actually ffmpeg command looks like after the substitution has occurred.

Similar Messages

  • Error in XML parsing. Im i missing something obvious.

    I am new to XML and i cant seem to be able to iterate through the xml response.
    Here is the relevant code
         QName qName = new QName( "http://www.ros.ie/schemas/customs/collectresponse/v1", "MailboxCollectResponse" );
                              //create the parser
                              XMLStreamReader parser = response.getPullParser(qName);                 
                              StAXOMBuilder builder = new StAXOMBuilder(parser);
                              OMElement documentElement = builder.getDocumentElement();
                              //dump the out put to console with caching
                              System.out.println(documentElement.toStringWithConsume());                             
                              //QName elementQName = new QName("http://www.ros.ie/schemas/customs/collectresponse/v1","MailboxItem");
                              QName elementQName = new QName("http://www.ros.ie/schemas/customs/collectresponse/v1","MailboxItemList");
                              Iterator infoIter =
                                  documentElement.getChildrenWithName(elementQName);
                                  while (infoIter.hasNext()) {
                                      OMElement element = (OMElement) infoIter.next();
                                      System.out.println("Matching Element Name = " +
                                          element.getFirstElement().getText());
                                      }  The println statement is producing this output which i think is correct.
    <MailboxItemList xmlns="http://www.ros.ie/schemas/customs/collectresponse/v1" moremessages="false" messagecount="2"><MailboxItem xmlns="http://www.ros.ie/schemas/customs/collectresponse/v1"><ns2:IEMailboxId xmlns:ns2="http://www.ros.ie/schemas/customs/customstypes/v1">Mailboxid123</ns2:IEMailboxId><ns2:IETransactionId xmlns:ns2="http://www.ros.ie/schemas/customs/customstypes/v1">Transaction123</ns2:IETransactionId><Message xmlns="http://www.ros.ie/schemas/customs/collectresponse/v1"><x:root xmlns:x="bar" xmlns:y="bar1"><x:foo xmlns:x="bar"><y:yuck xmlns:y="bar1">blah</y:yuck></x:foo></x:root></Message>But when it gets to the Iterator an exception is raised.
    org.apache.axiom.om.OMException: Parser has already reached end of the document. No siblings found
         at org.apache.axiom.om.impl.llom.OMElementImpl.getNextOMSibling(OMElementImpl.java:267)
         at org.apache.axiom.om.impl.traverse.OMChildrenQNameIterator.hasNext(OMChildrenQNameIterator.java:69)
         at com.alp.ccs21.soapwg.msgcollect.FrDHLCli.collectMsgs(FrDHLCli.java:281)
         at com.alp.ccs21.soapwg.msgcollect.FrDHLCli.run(FrDHLCli.java:203)Im i missing something obvious here?
    Thanks in advance.

    Edited by: ziggy on Jul 31, 2010 4:48 PM

  • Upsert of xmltype from given xpath - missing something obvious?

    Version: 10.2.0.*2* EE
    I am trying to do an upsert (update/ insert ) of an xmltype for a given xpath.
    The xml data is being passed as an xmltype, the xpath is a string (varchar2), the new value is a string, varchar2.
    If the node specified by the xpath exists this is trivial using updatexml; of course if the node doesn't exist nothing happens. I can check for the nodes existence using exists node, but I'm coming unstuck trying to figure out how to insert the node.
    All the APIS I can find that insert XML (APPENDCHILDXML,INSERTXMLBEFORE, INSERTCHILDXML) do not take an xpath but require an xmltype. Which means if I am reading this right I have no choice but to parse the xpath varchar2 string to try and construct an xmltype (ugh!).
    I can't find any API that just takes an xpath as a varchar2 and a value and gives me an xmltype. Ideally I don't even want that, would just like an API that returns the updated XML which has either had the xpath updated (or inserted if it didn't exist) with the new value.
    I am not an XML expert but I am pretty handy with SQL and PL/SQL. To me this just seems incredibly cumbersome just to do something as trivial as an upsert, so I am hoping I am missing something obvious!
    Can soemone please set me straight with a pointer or example?
    To top it all off the XML uses namespaces, but they aren't registered, there is no schema registration going on.

    Marco Gralike wrote:
    Couldn't it be done via XQuery, although the database version doesn't really help...That would be possible with a dynamic XQuery expression, but "painful" with a static expression as it would require parsing the XPath, and rebuilding the entire input document with the required modifications.
    I think XSLT would be more efficient in this case.
    Maybe, one day, when the database has XQuery Update Facility, we will be able to do this :
    copy $a := $doc/Address
    modify (
      if ($a/zip)
        then replace value of node $a/zip with "12345"
        else insert node element zip {"12345"} into $a
    return $a
    user12083137 wrote:To me, from a SQL background, I can't believe this simple case is simply not covered.Maybe not as simple as it seems. :)
    The functionality can be simulated via an IF/THEN/ELSE logic, or a DELETE/INSERT sequence.
    For example :
    case when existsNode(doc, xpath) = 1
      then updateXML(
             doc
           , xpath || '/text()'
           , somevalue
      else appendchildxml(
             doc
           , substr(xpath, 1, instr(xpath, '/', -1)-1)
           , xmlelement(
               evalname(substr(xpath, instr(xpath, '/', -1)+1))
             , somevalue
    endor,
    appendChildXML(
      deleteXML(doc, xpath)
    , substr(xpath, 1, instr(xpath, '/', -1)-1)
    , xmlelement(
        evalname(substr(xpath, instr(xpath, '/', -1)+1))
      , somevalue
    )

  • Batch processing with an image overlay

    Is it possible to do batch processing with an image overlay in FW CS4?
    I'm trying to resize several hundred images and place rounded corners on them.
    If this cannot be done in FW, does anyone know of another program that could accomplish this?

    Hi Marje,
    It's possible to include both resizing and image overlay in a custom Fireworks command that can be used in batch processing.  To get started, you could check out this tutorial that deals with the first step.
    That article describes how to perform image resize and overlay (in that case, a watermark), and then how to record the steps and turn them into a custom command that can be later used in batch processing.
    Once you saved the custom command, click File >> Batch Process, and follow the steps below:
    In the first window, select the images you want to process.
    On the next screen, open the Commands dropdown menu and select the custom command you created (it'll probably be on the bottom of the list), and click the Add button to include it in the batch process list.
    Finally, on the next screen select the location of the processed files, and optionally save the batch script for later use.
    Good luck!

  • How to use batch processing with jpg pictures taken with iphone cameras?

    How to use batch processing with jpg pictures taken with iphone cameras?

    Open the editor . Go to file>process multiple files
    Sent from my iPad

  • I updated to lion and now don't have a minimize button in the new emails i am writing.  Do i really have to save it as a draft to be able to have multiple emails in progress?  Or am I missing something obvious?!

    I updated to lion and now don't have a minimize button in the new emails i am writing.  Do i really have to save it as a draft to be able to have multiple emails in progress?  Or am I missing something obvious?!

    Photoshop Elements is not part of the Cloud, I will move this to that forum
    Photoshop Elements Forum http://forums.adobe.com/community/photoshop_elements
    Redemption Code http://helpx.adobe.com/x-productkb/global/redemption-code-help.html
    -and https://forums.adobe.com/thread/1572504
    Lost serial # http://helpx.adobe.com/x-productkb/global/find-serial-number.html
    Select a topic, then click I STILL NEED HELP to activate Photoshop Elements Online chat
    -http://helpx.adobe.com/contact.html?product=photoshop-elements or
    http://helpx.adobe.com/photoshop-elements/kb/troubleshoot-installation-photoshop-elements- premiere.html

  • I synched iPhone and PC but can't locate any of library on iPhone - am i missing something obvious ?

    i synched iPhone and Pc but can't locate any of library on IPhone - am I missing something obvious ?

    What did you select to sync?
    It will only sync what you tell it to sync.
    iPhone User Guide (For iOS 4.2 and 4.3 Software)

  • RMIC & Netbeans - am I missing something obvious?

    I finally managed to get rmic to compile something without errors, but I can't find any additional files I thought it would create. I added the following to build.xml in my server application:
    <target name="-post-compile">
    <!-- Empty placeholder for easier customization. -->
    <!-- You can override this target in the ../build.xml file. -->
    <echo message="Running rmic ..."/>
    <rmic base="${build.classes.dir}" includes="**/*Impl.java;${build.classes.dir}"/>
    </target>
    And I see this in the compiler output:
    Running rmic ...
    But nothing. Did I miss something obvious? I'm using Netbeans Beta 6.
    Thanks

    Ok, so I read some more recent tutorials (teaches me for reading an old book!) and I have some success. Except:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: StudioWorks.security.SecurityResponder
    at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)
    at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
    at sun.rmi.transport.Transport$1.run(Unknown Source)
    Obviously there are two issues;
    1) Can't find the remote object's class
    2) The remove object isn't serializable? Odd, as it extends Remote. I thought that was enough based on what I'm reading
    Maybe it's a simple mistake of not providing the right parameters/classpath to the rmiregistry, which I'm running from the command line and not through Netbeans (don't know how to do that).
    Back to the reading! :)
    Edited by: BobCrivens on Oct 14, 2007 8:32 PM

  • Adding an application component - missing something obvious

    Hi,
    We just upgraded to portal (running server and portal on windows nt) and I am developing. We have reports already completed in reports 6i. However, I am having trouble adding them to the pages or even in the "other providers" listed in portlet repository. The report is connected, as when I click on "edit" and then "run," it runs. I just don't know what I need to do so that the report shows in the "application component" when I click on "add item."
    I am sure that I am missing something obvious. Any help would be greatly appreciated.
    Thanks,
    Lindsay

    Thanks anyway, I figured it out. :-)

  • Am I missing something OBVIOUS

    Is it just me or am I missing something OBVIOUS
    I simply find it ALMOST IMPOSSIBLE to report a BROADBAND fault using E_MAIL
    I seem to be going round in circles .....................and the HELP SOLUTIONS ..... DON'T
    Yours   ING D M Logan
    Ing D M Logan Retired ACADEMIC Structural Engineer

    Hi Westerwood_Community and welcome
    If you select 'Broadband' at the top of any forum page, then click on 'Contact us about Broadband' , select 'BT Broadband', select the section you need (in your case 'I have problems connecting to broadband'), you can then email BT from there.
    The direct link to contact BT is - http://bt.custhelp.com/app/contact/c/346,401,1847
    Hope this helps
    edit. Or simply use the link Keith provided
    -+-No longer a forum member-+-

  • Batch processing with JTA not possible?

    hi ng,
    i'm hoping that someone can tell me if it is actually possible to use JTA transactions in non-app server spawned threads and, if so, how to do it.
    The problem we have is that we need a demon thread executing updates over a cached cluster (hence the need for JTA), but sun 7 uses a thread local to store the context and transaction info, if we try to perform JTA transactions in our own thread it bombs out from trying to lookup the missing data.
    We've tried to re-create what is expected in the thread local and bind it in but this is a large hack involving changing accessibility levels etc and we can't even get it to work anyway.
    The other option we've considered is to do the processing in a servlet but that would make the process widely accessible.
    Any help would be most appreciated.
    Thanks,
    Cam

    Hi Marje,
    It's possible to include both resizing and image overlay in a custom Fireworks command that can be used in batch processing.  To get started, you could check out this tutorial that deals with the first step.
    That article describes how to perform image resize and overlay (in that case, a watermark), and then how to record the steps and turn them into a custom command that can be later used in batch processing.
    Once you saved the custom command, click File >> Batch Process, and follow the steps below:
    In the first window, select the images you want to process.
    On the next screen, open the Commands dropdown menu and select the custom command you created (it'll probably be on the bottom of the list), and click the Add button to include it in the batch process list.
    Finally, on the next screen select the location of the processed files, and optionally save the batch script for later use.
    Good luck!

  • Batch Processing with an Action

    Hello everyone,
    I created an Action within Photoshop CS5.  I saved this action to an .atn file which then I loaded into the CORRECT directory for PSE 10. 
    Once in PSE I can go to Actions and I can see and properly use said Action.  So I know it works.
    My question/problem:  Is it possible to Batch process using "Process multiple files" or something else using this Action?  I know is CS5 the option is there and it is fairly straight forward, however I did not see this option anywhere within PSE.
    I am hopeful that I'm missing something or there is just some trick that I don't know about. 
    I appreciate any help that is provided.  Thanks in advance.

    You would need to open the BatchWin,atn file located in (this is for win 7 and vista x64) into cs5 (these are just actions that elements uses for process multiple files)
    (be sure to put a copy of the original file somewhere in case you ever need it)
    C:\Program Files (x86)\Adobe\Photoshop Elements 10\Locales\en_US\Support Files
    Then add your action to the list, without any open steps in the action and you'll have to add the save step at the end of the action (the format you want to save the files in).
    Then save the action set and put it back into Support Files Folder.
    example of an action added:
    example of how it looks in elements:

  • Batch processing with a re-save Script

    i have a script that i use to re-save a master file that may or may not have many layers, channels and/or paths.  when i have the master file open, i run the script and it flattens the image, deletes all the channels and paths, and then does a "save as" step saving the file as a tiff with lzw compression.  this all takes place without any user input or dialogs.  the script is copied at the bottom for reference.   i have made an action out of this script and it works fine everytime.  the problem is that when i try to batch process multiple file with this action, it seems that regardless of which options i choose in the batch processing window for saving (e.g. "none", save and close", etc.), the action is interrupted with the usual "save as" dialog window and even though lzw is specified in the script, i also have to manually select this option in the dialog.  does anyone know how to accomplish what i am trying to do (batch "save as" with lzw compression to files that are saved as uncompresseed tiffs) without having to stop for any dialogs?  please help!!!!  thanks.
    johnh h.
    if(documents.length){
    var saveFile = new File(activeDocument.fullName.fsName);
    SaveTIFF(saveFile);
    function SaveTIFF(saveFile){
        tiffSaveOptions = new TiffSaveOptions();
        tiffSaveOptions.embedColorProfile = true;
        tiffSaveOptions.alphaChannels = true;
        tiffSaveOptions.byteOrder = ByteOrder.IBM;
        tiffSaveOptions.imageCompression = TIFFEncoding.TIFFLZW;
        activeDocument.saveAs(saveFile, tiffSaveOptions, false, Extension.LOWERCASE);
        activeDocument.close();

    hey michael,
    your reply made me curious to try something i hadn't tried before which was to run the "batch" processing from within photoshop and to my surprise it worked.  however if i repeat the exact same thing from within bridge (although in bridge i am selecting multiple files instead of the enclosing folder) it runs into the same problem.  so you have 1/2 solved my problem.  did you actually get it to run properly from bridge (bridge/tools/photoshop/batch) or did you run it from within photoshop itself?  please let me know... i am very curious to detmine the source of the problem.  thanks.  i appreciate the help.

  • New battery will not charge - have we missed something obvious?

    My DD has just replaced the battery on her PB. When the power supply (less than 3 months old) is attached, the led shows amber but the battery will not charge. I've tried reseating the battery with no effect. Since I purchased it from an apple dealer, I'll be taking it back tomorrow, but I wondered whether there is something obvious we've missed.
    Thanks
    Jennifer

    Thank you both. Yes I know the battery needs to be calibrated, but as you say, to calibrate, you need to charge, which is a non-starter. I'm going to take the whole thing in (again). I suspect the problem that led to the battery needing to be replaced possibly dealt a death blow to something inside. I don't know whether this is relevant, but before replacing the battery, the charger started to make a loud buzzing noise (I understand - I wasn't here), and with the old battery in place the PB kept freezing and/or rebooting. Only with the battery out and just the power supply in would the PB work. The PB is seeing the new battery, it just wont charge it. I just wanted to make sure there wasn't anything else I could do before taking it in.
    Jennifer

  • Batch processing with filename filter

    Hi guys,
    Does anyone have any idea how to run a specific action in batch along with a filename filter?
    My problem is I have a folder with subfolders ie...  0001, 0002, 0003, 0004 etc   all these folders have approx 100 jpg files with the same filenames in each.
    a sample of my images are: landscape-oraange.jpg , landscape-blue.jpg , landscape-red.jpg , portrait-orange.jpg etc etc
    I was wonder of a way to just run the specific batch action on filenames containing a certain word, for instance to apply to all files containing the word "landscape" and exclude all other files.
    I cannot copy all files under the subfolders to a seperate folder and run this way... as all filenames are the exact same as the other folders.
    Does anyone have any advise?
    Thanks again guys,   Jamie.

    This might provide not quite what you are looking for but something similar.
    Insert the correct Action and Set names in the line
    app.doAction("Action 3", "Set 1")
    and change the variable theIdentifier to the name part you want to use as a criterium.
    This would work only if there are no spaces in the names by the way.
    // 2012, use it at your own risk;
    #target photoshop
    // select folder;
    var theFolder = Folder.selectDialog ("select folder");
    if (theFolder) {
    // define the name part to look for;
    var theIdentifier = "Untitled";
    var theFiles = theFolder.getFiles(new RegExp(theIdentifier+"\\S*.(jpg|tif|eps|psd)$", "i"));
    // work through the files;
    for (var m = 0; m < theFiles.length; m++) {
    // open image;
    var theImage = app.open(theFiles[m]);
    // perform action;
    app.doAction("Action 3", "Set 1")

Maybe you are looking for