Wednesday, February 12, 2014

Converting wmv to mp4 (for online video player)

It has been a while since I last blogged. Too many things have been happening.

Anyhow, here is another entry. This time, it was because of work that I needed to build pages to run videos uploaded by different individual staff for an internal system.

First problem I had was that the file was too large to be uploaded. No other work-around found unless the staff themselves contact me, pass me the file, and I personally perform an FTP upload.

However, the file can go up to 4 GB and that is really too large. Researched the web and found that MP4 files can be easily converted to a smaller WMV file by using window movie maker. While the guide on "How to Reduce Video Size" refers to an older version of windows movie maker, the steps are still applicable in principle. On windows 7, I just need to open the MP4 file (and wait for it to be loaded into movie maker), tweak whatever I want to (it was a video recording from phone, so I had to rotate it) and save as a movie. Done! So from a 4GB+ file, it became a 1GB+ file.

Then I found that the player I am going to use (Flowplayer) supports MP4, and another few more encoding... and I don't think WMV is one of them. Thank God I found that a WMV can easily be converted to an MP4 by a program I already have installed, i.e. VLC as per the guide found here. I guess most people would have a VLC as it virtually play every video encoding found on the web (or at least those common ones). However, the guide is also on an older VLC version, but still the principle is applicable.

So in case my link would be dead in the future, here are the steps I have take:
1. Open VLC
2. Click on Media->Convert/Save
3. On the File tab, click "Add" and choose the WMV file. Then click the "Convert/Save" button
4. Select a destination and the Profile (as in the encoding). For MP4, it was the first choice (Video - H264 + MP3 (MP4))
5. Wait for the file to be converted
6. Try playing the converted file once done

Thinking that the job is over, I tested it with my web browser. Unfortunately, I discovered that somehow the encoding cannot be played on the web. No problem at all using VLC.

After much digging around the web for 1.5 days and tested a few software that were full of malware, I found a great open source tool (and 100% clean without malware too)! After reading a great write up on HTML5 Videos, I proceed to downloaded Handbreak, as per the recommendation no. 8. (Note: if anyone reading this and is looking for a video converter, one should google the software name alongside with the word "malware" and see if there are any indication that it is loaded with malware. Learnt this the hard way).

At first, I attempted to convert the video to MP4 using the WMV file. But it didn't work. There were no video, only audio. Then I thought I had nothing to loose if I try using the MP4 converted using VLC. When I saw that the processes started running (and taking up lots of resources too!) I somehow knew that this could be working. Once the process completed, I went ahead and test with both VLC and my HTML5 player (using Flowplayer). It work!

Phew! For now, this closes my chapter of research. Hopefully my steps here are still valid for reference in the future. Who knows what new software capability would be... or... what new bugs are introduced later. For example, I actually upgraded my VLC to version 2.1.3 from an earlier version which I did not note, and it can no longer convert. Crashed every time I attempt to convert. I have just uninstall it and re-install, but have not tried to convert again since I found the solution using Handbrake.

No comments:

Post a Comment