Tuesday, January 28, 2014

Continuing MP3 Player Development?

Problems

There are at least 3 problems with Qt 4.8 + Phonon
  1. Unable to play some songs - well known issue with known solution?
  2. For some media, the timer might be off (by a lot, almost 3x). - well known issue.
  3. Dragging progress slider would make the position out of sync - this is a big issue for me since my main intent is to show lyrics in timely manner.
Comparing it with previous development under Ms. Visual C++ from Windows SDK
  1. I managed to resolve the same problem by manually adding WM ASF Reader Filter.
  2. Unknown - didn't display time in this version
  3. No problem on some media that exhibit this issue at Phonon, but a LAME-encoded media exhibits the same problem.
As I've mentioned in another post, I don't want to continue developing via Windows SDK because of dependency to .NET Framework 4.0. Specifically because installation of it on my Windows 7.0 64bit caused BSOD - and later found out this is not unique experience.

After I un-installed Qt 4.8 and installed Qt 5.2 I realized that Phonon has been dropped in favor of QMediaPlayer. After testing QMediaPlayer out:
  1. Same issue as Phonon - can't play some songs
  2. Unknown - forgot which song has the wrong timing - might update this later.
  3. Same issue as Phonon - SDK version is more reliable.

To be sure, I'm not suggesting that Windows SDK is better than Qt; simply that I had more success with Windows SDK thus far.

Confusions

First Confusion Stemming from Qt Bug Tracker

QtMultimediaKit would first try to apply WM ASF Reader Filter for mp4 playback.
Yes, it's different tool for different purpose; but my point is: if Qt can use WM ASF Reader Filter there, it should be usable for QMediaPlayer? There shouldn't be any licensing issue with Microsoft for filter usage.
The bug above has been deemed invalid by suggesting Media Foundation over DirectShow.
I've also read someone said Windows Media Player uses Media Foundation rather than DirectShow (to deflect criticism: WMP can play it, why can't yours?). But I used DirectShow in SDK version and managed to tackle the issue? Sigh.

Straying from topic for a bit; a guy here goes further by claiming that
Even the folks in the Qt irc channel told me not use QMediaPlayer on Windows. They suggested using SDL.
 Not sure how much truth in there, but I think using 3rd party codec is more reliable.

Second Confusion: What Codec Should I Use?

Previously I've considered going direct to FFmpeg/libav or Libavcodec but I read in wikipedia that:
  • GStreamer has made a wrapper for FFmpeg/libav
  • Phonon uses / supports it http://en.wikipedia.org/wiki/GStreamer#Distribution_and_adoption
Working on a wrapper will definitely make my work a lot easier, yet considering Phonon has the issues above, can I make the assumption that GStreamer is not a complete wrapper?

Third Confusion: Completeness

An often raised argument is the fact that MP3 implementations are heavily loaded with patents. To support all implementations mean to buy in those patents.
Although a lot of applications use FFmpeg/libav under the hood, each must've improved on it -- like applying the proper filter, properly calculating media duration and current position, etc.
Using Phonon and QMediaPlayer as reference, I highly doubt I'll be able to build an application that can play all MP3s smoothly.

Conclusion?

None for the time being; I need to try implementing WM ASF Reader Filter first, before deciding whether to go on ahead or drop it.

No comments:

Post a Comment