Tag Archives: OS X

How to Use FFmpeg to Extract Audio from Video File Without Re-encoding

Try -c copy:

$ ffmpeg -i video.mp4 -c copy audio.aac

How ever you have to know the original audio format to extract audio without re-encoding, for example:

$ ffmpeg -i video.mp4
...
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    creation_time   : 2015-01-17 20:39:33
  Duration: 00:23:59.94, start: 0.000000, bitrate: 1983 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 1787 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
      creation_time   : 2015-01-17 20:39:33
      handler_name    : 264:[email protected]
    Stream #0:1(jpn): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 191 kb/s (default)
    Metadata:
      creation_time   : 2015-01-17 15:55:11
      handler_name    : Sound Media Handler
...

Then you should know what format and which track to extract.

How to Uninstall XQuartz on OS X

From http://xquartz.macosforge.org/trac/ticket/675:

  • launchctl unload -w /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
  • sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /private/etc/*paths.d/*XQuartz
  • sudo pkgutil --forget org.macosforge.xquartz.pkg

Update HP Laserjet Printer Firmware on OS X

If your printer firmware has official OS X version (for example LaserJet Pro MFP M476dn), just download the official DMG update and run it.

If your printer doesn’t have official firmware update for OS X, then you should:

  • Download the Windows version firmware (any version should be ok)
  • Extract the .exe using 7-Zip, you will get `product-update.acl`, this is the firmware update file
  • Open HP Utility (the official HP Printer Software shipped with your pinter)
  • On the menu, click “Show Advanced Options”, then you will see a “Update Firmware” icon
  • Click it and choose the `product-update.acl` we just extracted from the package, then click “Update”

Then your printer status will be “Printing”, during update your printer will get disconnected for 1-2 minute(s), then it will be back to normal and shown as “Ready” on your printer LED display.

If you don’t like HP softwares and you don’t have it on your OS X, you can also update it with the following steps:

  • Download Windows version firmware, extract it, the same as the “HP Utility” method
  • Open Terminal, type lpr ~/Downloads/product-update.acl (change the path to your real location)

Please note you have to set the printer you want to update as default printer, or you have to specify the printer with lpr or lp

Export Website RSA Private Key for Apache Server Certificate from OS X Server

If you’re using OS X Server and MAMP Pro at the same time, and you’d like to export OS X site certificates to use them for MAMP Pro sites, you can do the following:

  • Locate certificate (Category -> Certificates)
  • control + click -> Export… -> Certificate.p12

Next, I need to split the PKCS12 archive, to get the old private key out:

$ openssl pkcs12 -in site.p12 -nocerts -out site.key

Remove passphrase from the key (otherwise you have to enter it lots when you restart services.)

$ openssl rsa -in site.key -out site.unprotected.key

Read more: Renewing a SSL Certificate on OSX Server