[SOLVED] How to Crop an MP4 Video via Command-line?

I have ffmpeg, mpg123, and mencoder. Does anyone know of a way I could use any of those to crop an mp4 video via command-line? I am trying to take off the black space above and below a video. Thanks in advance!
Last edited by tony5429 (2009-04-12 00:12:57)

I don't think it's possible to crop without re-encoding, but you can crop from the command line with ffmpeg and mencoder. Not sure about mpg123 - I think that's for playing audio but I could be wrong there.
Anyway, with ffmpeg you can do cropping by using -croptop, -cropbottom, -cropleft, and -cropright. So if you wanted to crop 16 pixels off of the top and the bottom, your command line would look something like this:
ffmpeg -i <input file> -croptop 16 -cropbottom 16 <video encoding options> <audio encoding options> <output file>
With mencoder you use the "crop" video filter, like this:
mencoder <input file> -o <output file> -vf crop=320:208:0:16 <other options>
where the "320:208:0:16" means that the resulting picture is 320 pixels wide, 208 pixels high, and the 0:16 is the x,y position of the cropped area.
These command lines are just really very basic examples - ffmpeg and mencoder have a LOT of options. Way too many to explain here. If you don't believe me, just try reading through the mencoder man page sometime. (There's an online version of it at: http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.html)
Hope this helps!!

Similar Messages

  • How to turn off Bluetooth adapter via command line or script?

    I'm trying to write a batch script that will be able to turn on/off any connected Bluetooth adapters.
    In the "Bluetooth Settings" window, how can I change the "Turn off Bluetooth adapter" setting via command line or script?
    Due to my account not being verified yet, I cannot post a screenshot.  I will update this thread as soon as my account is verified.

    get-service -DisplayName 'Bluetooth Support Service' | Stop-Service
    ¯\_(ツ)_/¯

  • How to change "open with" defaults via command line?!?

    folks,
    i know that if i get info on a file -- in this case, a filemaker 5.5 file -- i can choose the default "open with" settings and apply those settings to all files of that kind. see the attached image for what i mean.
    but how do i do that via the command line?
    thus far, here's what i've got: i know that i can open a document called "scrubbing shell.sh" on my desktop WITH either MS Word of TextEdit by calling:
    open -a textedit /Users/david/Desktop/scrubbing-shell.sh
    or
    open -a Microsoft\ Word /Users/david/Desktop/scrubbing-shell.sh
    no sweat. BUT....how do i set the defaults so that it ALWAYS opens with that app in the future when double-clicking via the GUI?
    many thanks, ya'll!
    david koff
    associate systems admin
    the j. paul getty trust
    dkoff AT getty DOT edu

    Hi David,
       OK, I investigated the new format and treatment. It appears that the first entry in the property list file that matches the file being opened wins. The Finder may still honor the new format; when I moved my old Panther file into Tiger it seemed to work. However, in other ways, the Finder doesn't recognize the old format, which is the format of the FileMaker entries you posted.
       The Finder puts all of the new format entries at the beginning of the property list file. If you change a preference that was controlled by an old format entry, the Finder won't edit that entry. What it will do is to create a new entry in the new format closer to the beginning of the file than any of the old-format entries. SInce the new entry comes first, the old one doesn't apply. If you then edit the preference and change it back to what it was before, the Finder will edit the new entry. Consider the following sequence of events and commands:
    % cp ~/Library/Preferences/com.apple.LaunchServices.plist ~/Library/Preferences/com.apple.LaunchServices_copy.plist
    I change all GIF files to be opened by GraphicConverter instead of Preview, which is an old setting in the old format.
    % plutil -convert xml1 ~/Library/Preferences/com.apple.LaunchServices.plist
    % diff --text ~/Library/Preferences/com.apple.LaunchServices.plist ~/Library/Preferences/com.apple.LaunchServices_copy.plist
    404,409d403
    <      <dict>
    <         <key>LSHandlerContentType</key>
    <         <string>com.compuserve.gif</string>
    <         <key>LSHandlerRoleAll</key>
    <         <string>com.lemkesoft.graphicconverter</string>
    <      </dict>
    Then I change all the GIF files to be opened by Preview again.
    % plutil -convert xml1 ~/Library/Preferences/com.apple.LaunchServices.plist
    % cp ~/Library/Preferences/com.apple.LaunchServices.plist ~/Library/Preferences/com.apple.LaunchServices_copy2.plist
    % diff --text ~/Library/Preferences/com.apple.LaunchServices.plist ~/Library/Preferences/com.apple.LaunchServices_copy.plist
    404,409d403
    <       <dict>
    <          <key>LSHandlerContentType</key>
    <          <string>com.compuserve.gif</string>
    <          <key>LSHandlerRoleAll</key>
    <          <string>com.apple.preview</string>
    <       </dict>
    % diff --text ~/Library/Preferences/com.apple.LaunchServices.plist ~/Library/Preferences/com.apple.LaunchServices_copy2.plist
    408c408
    <          <string>com.apple.preview</string>
              <string>com.lemkesoft.graphicconverter</string>
       Note that I had to change the file to text after every change because the Finder converted the file to binary format every time it edited it. I didn't have to logout or reboot; the property list file change less than a second after the preference was set. I'm guessing that because you were just looking at the old-format entry, you missed the real changes to your property list file. Did it change from text to binary format? Try the command line tools that I used above.
       Note that this means that it matters where you put your entries in the property list file if you edit it.
    Gary
    ~~~~
       There are only 10 kinds of people in the world. Those
       who understand binary numbers and those who don't.

  • Generate video in command line?

    I didn't have time to research this in powermap. Is it possible to generate the power-map video via command line? Has anyone looked into it?
    Best Regards, Rajib Bahar

    Yes.
    It'd be nice to have this feature. I wonder if this will lead to increased performance??? For example, SSIS in command line runs faster than UI mode. 
    Best Regards, Rajib Bahar
    Can you submit this to the team via the Smile/Frown feedback button in the UI?
    Thanks!
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • How to transfer a mp4 video from my laptop (windows) to my iPad2?

    How to transfer a mp4 video from my laptop (windows) to my iPad2?

    As with transferring any other video that is in an iPad compatible format - via the iTunes sync/transfer process.

  • [SOLVED] How to Create an Image from UTF8 Text via Command-line

    As the title points out, I'm trying to create an image from unicode text via command line. I tried...
    convert -pointsize 48 -size 400 caption:测试用 text.png
    But that results in question marks for the Chinese characters. So searching around online I discovered that I needed to specify a font which could display the characters. The characters show up just fine in Firefox, KDE, Kate, Terminal, etc so I know I have a font which can render them. I thought it might be DejaVu but this also resulted in question marks...
    convert -font /usr/share/fonts/TTF/DejaVuSerif.ttf -pointsize 48 -size 400 caption:测试用 text.png
    Any ideas?
    Last edited by tony5429 (2011-01-31 23:17:41)

    DejaVu doesn't contain those Chinese glyphs at all, so please don't blame ImageMagick for not rendering them.
    So, Firefox, Kate, Terminal and the others you stated to use DejaVu, if encounter these characters, fall back to some other fonts to render them. These fonts are, however, not vector, but bitmap fonts. (This can be seen if you increase text size (Ctrl++ in Firefox): the Chinese characters don't change, they remain of their inherent size.)
    Actually, e.g. /usr/share/fonts/misc/18x18ko.pcf.gz definitely contains the three example characters, so the mentioned apps may use this font as fall back.
    Apparently ImageMagick doesn't handle bitmap fonts (I'm not sure), so you won't be able to hit your original target. Anyway, since you tried to parse "-pointsize 48", you wouldn't be satisfied with the font size.
    Your only choice seems to be using the above mentioned CJK-approved TTFs.
    EDIT: typo
    Last edited by barto (2011-01-28 21:52:33)

  • How can I install on Windows remotely via command line?

    Hello Folks.
    I want to install an application on Windows remotely and via command line, For example, I need a tool like Psexec or WMIC but I don't like the user understand it. Any idea? 

    Hi,
    Please also refer to following FAQ article and check if those four general ways will meet your requirement.
    [Forum FAQ] How to deploy applications remotely
    If any update, please feel free to let us know.
    Hope this helps.
    Best regards,
    Justin Gu
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How to change fcalias www via command line & particular port performance status

    how to change fcalias www via command line & particular port performance status

    how to change fcalias www via command line & particular port performance status

  • How do I get LR2 to "load from device" via command line?

    Hi,
    how do I get LR2 to "load from device" via command line?
    I've got XP to load LR2 when a "camera" (and only a camera) is connected but really cool would be if LR2 would also import the pictures.
    cu,
    Michael

    1. Make sure you are using IOS 7.
    2. Make sure your iPad is register in My Support Profile.
    https://supportprofile.apple.com/
    3. Try downloading again; it should be free.

  • How to see via command line blocked mails

    Im having a problem...i have a C100 Ironport appliance and i want to know via command line, how to grep and see mails that never went delivered.
    For example...i know that someone, like [email protected] send to my exchange server an email...but in exchange never entered. So i assume that it was filtered by Ironport.
    I go to the command line, use grep and 13 and search for [email protected] and i see something like this
    Wed Apr 18 14:17:54 2007 Info: MID 3977209 ICID 8813638 From: <pedro>
    Wed Apr 18 14:18:44 2007 Info: MID 3977209 ready 3019672 bytes from <pedro>
    I see that 2 mails came from pedro....so i want to see what happened to them...they were bounced? rejected? Delivered?
    I dont have any email in the local quarantine... and i want to know how to track what happened to those emails that never entered to my exchange server.
    Is there any command?
    Than you!

    Wanted to add that you can shortcut the "grep" process by putting everything on one line.
    grep -i "Mid 3977209" mail_logs
    grep -i "ICID 8813638" mail_logs
    grep -i "From: " mail_logs
    basically
    grep -i "pattern" mail_logs
    -i ===> ignore case
    Im having a problem...i have a C100 Ironport appliance and i want to know via command line, how to grep and see mails that never went delivered.
    For example...i know that someone, like [email protected] send to my exchange server an email...but in exchange never entered. So i assume that it was filtered by Ironport.
    I go to the command line, use grep and 13 and search for [email protected] and i see something like this
    Wed Apr 18 14:17:54 2007 Info: MID 3977209 ICID 8813638 From:
    Wed Apr 18 14:18:44 2007 Info: MID 3977209 ready 3019672 bytes from
    I see that 2 mails came from pedro....so i want to see what happened to them...they were bounced? rejected? Delivered?
    I dont have any email in the local quarantine... and i want to know how to track what happened to those emails that never entered to my exchange server.
    Is there any command?
    Than you!

  • How do I remove Lotus Notes PDFMaker plugin via command line?

    How do I remove the lotus notes PDFMaker plugin via command line?  I originally deployed Adobe Acrobat 10 as a complete install to many computers.  I see how to remove this specific feature through the GUI in Windows 7 by going to control panel / programs and features / Adobe Acrobat X / change / modify / create adobe PDF / acrobat PDFMaker / Lotus Notes, but this would be a tedious task to do manually at each computer.  I've experimented with a few msiexec commands after removing Acrobat such as:
    msiexec /i "\\path to msi" remove=pdfmakerforlotusnotes
    msiexec /i "\\path to msi" disable_pdfmaker=yes
    Both still install acrobat as a complete install.  Any help and suggestions would be appreciated.  Thank you!

    Thank you Sabian, that did the trick.  Here is the command line I used for anyone else having a similar issue:
    msiexec /i "\\path to msi" REMOVE=PDFMakerForLotusNotes /qn
    I did this on a test machine with a complete Acrobat installed.  I ran the above command and it removed the Lotus Notes PDFMaker plugin.  I should also note that it didn't downgrade my version of Acrobat and all of my custom settings within the application are still there.

  • [Solved] How to: Automatically add Semicolons at end of line

    Q. Is it possible to set JDeveloper to automatically add Semicolons to the end of a line of code?
    A. "While there is nothing that does this in batch mode to all your lines, while you are writing a line you can press the CTRL+SHIFT+Enter (complete statement in the source menu) shortcut and it will complete your line for you including the semicolon." [Solved] How to: Automatically add Semicolons at end of line
    Original Message:
    I'm spoiled from using Basic and similar programming languages, adding semicolons manually is something that'll take me time to get used to
    Thanks in advance,
    Abdulla
    Tags (for search engines):
    Jdeveloper automatic semicolon
    Message was edited by:
    Abdulla

    While there is nothing that does this in batch mode to all your lines, while you are writing a line you can press the CTRL+SHIFT+Enter (complete statement in the source menu) shortcut and it will complete your line for you including the semicolon.

  • How to merge multiple documents via command line (Adobe Acrobat Pro 9.3.2)?

    I'm searching solutions to merge multiple documents (all stored in one folder) via command line or batch file to a single PDF-File...
    Is there a way to do this?
    Finaly I want to control this from a application written in MS-Access. So, perhaps there are some features already integrated in Access to do this?
    Thanks for answer!

    If you have some programming experience you could probably do this using VBA from within MS Access to control Acrobat via OLE.
    Lots of examples on the Web.
    Hope this helps

  • How to install Developer Tools via command line

    Hello,
    is there a way, to install the Developer Tool via Command line?
    I need only the unix tools.
    I have to install the unix tools over a ssh connection.
    Thanks in advance and best regards
    Martin

    I followed the link you gave.  The only download I saw was for Xcode 4, and they either wanted $5 to purchase it from the app store or a 1 year mac developer license thing which was $100.
    <Edited by Host>

  • Turn on "Real-time preotection" via command line

    Hello!
    We have a cient without networking resources and I need to turn on the "Real-time protection" which is currently in OFF state.
    How can I do that via command line?
    I tried to review the "mpcmdrun" command but did not found proper switch to turning on this service.
    Regards, 
    Tamas

    You could do a regedit command to silently import a .reg file with the setting in it:
    create a .reg file from the following key:
    HKLM\SOFTWARE\Policies\Microsoft\Microsoft Antimalware\Real-Time Protection
    Name: DisableRealtimeMonitoring
    Type: REG_DWORD
    Data: 0
    Then import it silently with this command:
    regedit /s C:\ExamplePath\Example.reg
    You could also do a PowerShell command:
    Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Microsoft Antimalware\Real-Time Protection' -Name DisableRealtimeMonitoring -Value 0

Maybe you are looking for

  • Error in Downtime phase STARTSAP_NBAS

    Hi Experts, Am in the middle of EHP7 upgrade from ECC6.0 with 7.4 SP 37 kernel. Got an error saying Logon not possible (error in license check). So tried to upload the new license file via SLICENCE but got into new issue saying The license key librar

  • Is there a way to get phone numbers back on my iphone / or excel sheet?

    Is there a way to get phone numbers back on my iphone / or excel sheet? What I've done: I've upgraded my iphone from 2.0 to 2.1. To be able to do this I've upgraded to the latest iTunes and switched my USB port several times until it was finaly insta

  • BP Details In Journal Entry

    Hi All, I need BP Code,Name,Address,Payment Terms and respective Debit and credit Details for a report.. i can get the Debit, credit and Transaction Details From OJDT and JDT1 ... am not having any clear idea on how to get the respective BP details(B

  • Getting Java 1.4.2_10 to work along side of 1.5.0_06 in IE

    I'm trying to use IBM's Tivoli Enterprise Portal through IE but it only will take java 1.4.2_10 which shouldn't be a problem except I have clients that also need version 1.5.0_06. I've tried a lot of different settings in IE and in the two different

  • Retain custom order in albums when exporting to different iPhoto library?

    Hi all. To ease resource consumption, I'm placing many of my 20,000 iPhoto9 items into a new iPhoto9 library. I have many albums with pictures in custom order. Any recommendations on how to retain that order when copying the photos/ albums to the new