Friday, January 25, 2013

FFMPEG - Rescaling with high CPU usage

When you transcoding video with FFMPEG and encounter the following symptom

1. High CPU spin (for example, 99% CPU usage)
2. Long transcoding period with slow progress (for example, a 40s video file took more than 1 minute to transcode)

You may need to tweak your transcoding parameters.

This will usually happen when

1. Transcoding high quality 1920x1080 file.
2. Rescaling high quality 1920x1080 file to lower resolution

This is usually because FFMPEG trying to transcode/re-scale the file with original high quality framerate

So, when re-scaling a high quality file, you can try the following command

ffmpeg.exe -i "input.mp4" -r 15 -s 640x360 "output.mp4"

The above assuming that input.mp4 is high quality (15000 kb/s and above) with high resolution (1920x1080).

-r 15 will reduce the framerate to 15 frame per second. 15 fps is recommended as it has little different to human eyes

-s 640x360 is to re-scale 1920x1080 to 640x360. This will retain the aspect ratio of 16:9

Sunday, January 20, 2013

TCPDUMP - Packet size limited during capture HTTP truncated

In Linux environment, if you want to use command base to capture network packets, you can use the following command with TCPDUMP

tcpdump -i eth0 -w out.pcap

The above command will dump network packet for network interface eth0 to a file call out.pcap. This file is a pcap format which you can open by Wireshark.

The above command will use a default capture size of 96 bytes and the benefit of this is to create a small output file. However, the downside is that certain large packet information will be lost and you may not see a complete picture of network communication. Especially in Wireshark, such situation will display with a message "Packet size limited during capture HTTP truncated" for large packet

To solve this issue, use the following command

tcpdump -i eth0 -w out.pcap -s 0

-s 0 flag tell tcpdump to capture packet at original size (65535 bytes). And, this will create much larger output file.

Friday, January 11, 2013

HTML - Initiate Phone Call from HTML Page

This may not be something new, but, it is interesting to know that such feature exist for HTML.

In the past, we are used to putting mailto to initiate an email program when PC dominate the world

Moving toward the world of mobility, launching a mobile phone number from browser make more sense as most people access the web via mobile phones.

So, to include a phone number and launch the number to mobile phone dialer automatically when user click on the link, you can do the following

Western Digital TV Live - Roll Back Firmware

When my Western Digital TV Live Streaming Media Player was accidentally upgraded to firmware v1.11.14, I encounter lag, hang, unable to boot, etc.. issue. That is the main reason I hate to upgrade firmware as well.

The only choice I had is to revert the firmware to an older version, namely v1.10.13

It is rather easy and all information can be obtained at the WD knowledge base

Please follow the step in the article How to roll back the firmware on a WD TV Live Hub Media Center or WD TV Live Streaming Media Player

After rolling back, your WD TV Live should be back to normal

LDAP - Deleting an LDAP entry

To delete an ldif entry, one way is to put an changetype attribute and a value 'delete' in the ldif file For example dn: cn=so...