Category Archives: Technologies

How to Trim, Cut or Combine MP4 Files Without Re-Encoding

Motivation:

  • You have MP4 files with unwanted portions. You want to trim these portions.
  • You want to cut a MP4 file into files with equivalent length for uploading to specific storage that limits length of an uploaded video.
  • You want to combine multiple MP4 files into single file for copying to specific storage in a single upload.

Trimming MP4 file:

  1. Download XMedia Recode.
  2. Unzip the downloaded package.
  3. Click on the XMedia Recode.exe file to open the application.
  4. Open a MP4 file.
  5. Under the Format tab set
    Profile = Custom
    Format = MP4
    File Extension = mp4
  6. Click the Video tab and set Mode = Copy on the middle panel.
  7. Click the Audio tab and set Mode = Copy on the middle panel.
  8. Click the Filters/Preview tab and set Start Time and to (End Time) value text boxes.
  9. Click the Add to queue button (with the + icon) on the tool bar.
  10. Click the Encode button on the tool bar.

Splitting MP4 file to multiple files with equivalent length:

    1. Download XMedia Recode.
    2. Unzip the downloaded package.
    3. Click on the XMedia Recode.exe file to open the application.
    4. Open a MP4 file.
    5. Under the Format tab set
      Profile = Custom
      Format = MP4
      File Extension = mp4
    6. Click the Video tab and set Mode = Copy on the middle panel.
    7. Click the Audio tab and set Mode = Copy on the middle panel.
    8. Click the Filters/Preview tab and specify appropriate time range for each file, for example from 00:00:00:0000 to 00:09:00:0000.
    9. Click the Add to queue button (with the + icon) on the tool bar.
    10. Click the Encode button.

    Repeat the procedure for the same file with different time ranges.

    For example use time range from 00:09:00:0000 to 00:18:00:0000 for creating the second file, then time range from 00:18:00:0000 to 00:27:00:0000 for creating the third file, etc.

    Combining multiple MP4 files into single MP4 file:

    1. Download ffmpeg.
    2. Unzip the downloaded package.
    3. Copy MP4 files to the bin folder.
    4. Create vidlist.txt with the content below in the bin folder.
    file 'Part 1.mp4'
    file 'Part 2.mp4'
    file 'Part 3.mp4'
    file 'Part 4.mp4'
    file 'Part 5.mp4'
    file 'Part 6.mp4'

    4. Open Command Prompt, navigate to the bin folder and execute the command below.

    ffmpeg -f concat -safe 0 -i vidlist.txt -c copy output.mp4

    How to Put Your eBooks into Kindle or Apple Books or Google Play Books

    Motivation:

    You have an ebook with .epub or .mobi format in your MacBook or PC.
    You want to put it into your iPhone or iPAD so that you can read it on the go.

    Solution 1:

    1. Upload your ebook to iCloud Drive.
    2. Install Kindle or Apple Books or Google Play Books on your iPhone or iPAD.
    3. Login your Kindle or Apple or Google account.
    4. Open the Files app to go to iCloud Drive.
    5. Open the ebook.
    6. Tap the Share icon in the lower left hand corner.
    7. Select Kindle or Open in iBooks or Play Books.

    Solution for Google Play Books:

    1. Install Google Play Books on your iPhone or iPAD..
    2. Log in Google Play Book website using your Google account.
    3. Upload your ebook in EPUB format to Google Play Book website.
    4. Open Google Play Books on your iPhone or iPAD.

    How to add multiple IPs to an Amazon EC2 virtual machine

    Motivation:

    You have a Server 2008 R2 machine on Amazon EC2.

    You want to secure multiple domains using different  SSL/TLS certificates.

    Server 2008 R2 does not support Server Name Indication (SNI). Therefore you need to add multiple IPs to Server 2008 R2 machine to use different SSL/TLS certificates.

    Solution:
    1. Create an EC2 virtual machine.
    2. Click on Network Interfaces tab.
    3. Click Create Network Interface button or select an existing network interface and select Actions > Attach.
    4. Click on a network interface ID, click Actions, click Manage IP Addresses, click on the network interface name (beginning with eth…), click the Assign new IP Address button, enter a private IP Address (e.g. 172.30.0.32), click the Save button, click the Confirm button.
    5. Click Elastic IPs tab, click the Allocate Elastic IP address button, click the Allocate button, optionally name the new allocated IP.
    6. Select the new allocated IP, click on Actions , click Associate Address, choose Network interface, then choose a private IP of the network interface with which the elastic IP will be associated, click the Associate button.
    7. Login Windows.
    8. View the network configuration using below command, note the Default Gateway and DNS Servers information.
    ipconfig /all

    9. Open Control Panel\All Control Panel Items\Network and Sharing Center.

    10. Click Change adapter settings link, click a Local Area Network Connection Network.

    11. Manually enter one IP address, Default Gateway and DNS Servers information.

    12. Click Advance… button to open Advanced TCP/IP Settings screen, and add the private IPs in the 4th step to the machine.

    13. Restart the machine.

    If you get any issue then try limit the number of private IPs of a network interface to 4 (including the default private IP).

    How to Change Language of an EPUB File

    Problem:

    You have an EPUB file encoded with a wrong language tag.
    Therefore when you use the Read aloud feature of the Google Play Books application the book is read aloud in a wrong language.

    Solution:
    1. Download the EPUB file to a PC.
    2. Change the extension from EPUB to ZIP.
    3. Open the .ZIP file.
    4. Open the content.opf file using the Notepad app.
    5. If you cannot file this content.opf file then please navigate to the OEBPS folder.
    6. Find the tag <dc:language> and change its value (e.g. from <dc:language>en</dc:language>to <dc:language>vi</dc:language>).
    7. If you cannot find the tag <dc:language> then just add a new tag right above the </metadata> tag (e.g.
      <dc:language>vi</dc:language>
      </metadata>
    8. Save the content.opf file and rezip the EPUB file.
    9. Change the file extension from ZIP to EPUB.

     

    How do we make an image look darker using Photoshop?

    How do we make an image look darker using Photoshop?

    • Use Ctrl+J to duplicate the image layer
    • Click on the top layer and change the blend mode to either Multiply or Overlay
    • Go to Image > Adjustments > Levels
    • Adjust the middle node (sliding right makes darker image, sliding left makes lighter image) till you get your desired outcome.

    How do we change a layer’s opacity?

    • Right click a layer > Blending Options…
    • Change the Opacity value

    How do we straighten a photo (transform perspective while cropping)?

    • Hold down the Crop tool and select the Perspective Crop tool
    • Draw a marquee around the distorted object. Match the edges of the marquee to the rectangular edges of the object.
    • Press Enter (Windows) or Return (Mac OS) to complete the perspective crop.

    How do we crop a photo with 4×6 ratio?

    • Hold down the Crop tool and select the 2:3 (4:6) from the drop down box on the top panel.
    • Resize the grid to appropriate size.
    • Right click on the image and select Crop.

    How do we horizontally straighten a photo?

    • Hold down the Ruler tool and draw a line as the new horizontal.
    • Click Straighten Layer on the top panel.