Saturday, May 26, 2018

Fastest way to merge MOV files by using ffmpeg



There was full of sunshine over the week. I wanted to keep some of the video in my dash camera to celebrate summer. The weather was nicely recorded, but it was all saved in separate MOV files for 1 min each. I wanted to combine them into a single file for sharing over YouTube.

Obviously there were bunch of software of doing this, but many of them take too much time for processing. (My CPU fan worked damn hard to cool off). I didn't need to re-encode the files.
There must be some smarter way.

I turned out using ffmpeg. It gave exactly what I needed. The merge of 6 files (6 mins) only took about 1 - 2 mins. This was amazing fast compare with using other software. Thanks ffmpeg!


  1. Install ffmpeg (it is free)
  2. Copy all the mov files into a new blank folder
  3. Create a text file (files.txt) with all the files to be merged in order with the format like this

    file 'file1.mov'
    file 'file2.mov'
    file 'file3.mov'
    file 'file4.mov'
    file 'file5.mov'
    file 'file6.mov'
  4. Run this command in the folder
    ffmpeg -safe 0 -f concat -i files.txt -vcodec copy -acodec copy merged.MOV
  5. The output file merged.mov is ready.
Here is the batch script to do the whole thing nice and easy


@echo off
del merged.mov
del files.txt
for %%i In (*.mov) DO echo file '%%i' >>files.txt
ffmpeg -safe 0 -f concat -i files.txt -vcodec copy merged.MOV





What a lovely day!


Saturday, January 27, 2018

Brokerage fee comparison at a glance - Hong Kong


Trading Value and brokage fee in HKD
BrokerMinimumRate5,00010,000100,000
Bank of China (Gold
Star)
1000.200%100.00100.00200.00
Bank of East Asia
Supreme Gold
800.250%80.0080.00250.00
Bright Smart500.067%50.0050.0066.80
China Construction Bank00.180%9.0018.00180.00
Citigold1000.200%100.00100.00200.00
DBS Treasures00.250%12.5025.00250.00
Fubon Bank800.250%80.0080.00250.00
Hang Seng Bank1000.250%100.00100.00250.00
HSBC1000.250%100.00100.00250.00
Interactive Brokers180.080%18.0018.0080.00
SHK direct880.138%88.0088.00138.00
Standard Chartered Bank00.200%10.0020.00200.00

WinnerChina Construction BankChina Construction Bank &
Interactive Brokers
Bright Smart
Fee9.0018.0066.80

Additional cost
– SFC Transaction Levy 0.0027% of the transaction amount
– Stock Exchange Trading Fee 0.005% of the transaction amount
- Stamp Duty 0.1% of the transaction amount
Date: 1/27/2018



Wednesday, January 24, 2018

Listing all tables in a database and their row counts and sizes



CREATE TABLE #RowCountsAndSizes (TableName NVARCHAR(128),rows CHAR(11),     
       reserved VARCHAR(18),data VARCHAR(18),index_size VARCHAR(18),
       unused VARCHAR(18))

EXEC       sp_MSForEachTable 'INSERT INTO #RowCountsAndSizes EXEC sp_spaceused ''?'' '

SELECT     TableName,CONVERT(bigint,rows) AS NumberOfRows,
           CONVERT(bigint,left(reserved,len(reserved)-3)) AS SizeinKB
FROM       #RowCountsAndSizes
ORDER BY   NumberOfRows DESC,SizeinKB DESC,TableName

DROP TABLE #RowCountsAndSizes


Source: https://www.sqlmatters.com/Articles/Listing%20all%20tables%20in%20a%20database%20and%20their%20row%20counts%20and%20sizes.aspx

Wednesday, August 23, 2017

Engine part names


https://i.pinimg.com/originals/61/3f/69/613f6997b566882fca77970717899380.jpg

Monday, May 22, 2017

How to find text in entire workbook


Your eyes are not built for searching text in a boring excel file.

To protect your eyes, you have to know what the computer can do for you.

Make good use of the "find and replace" can save your eyes from bleeding.


Applying SMA10/20, SMA20/50 as trading signals

This is the comparison for results before and after applying SMA10/20 and SMA20/50 in the stock trader. Background Trading 3 stock ma...