Media Players

This is a discussion on Media Players within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Anyone ever tried to write their own Video Player?...

  1. #1
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784

    Media Players

    Anyone ever tried to write their own Video Player?

  2. #2
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    nope... but I'm guessing you're going to attempt it... and then realize you can't after about a week and give up
    EntropySink. You know you have to click it.

  3. #3
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    Why, is it not humanly possible?

  4. #4
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    It's possible... but to make something useful that more than just yourself and a handful of other people will want to use? ehh... that could take quite a long time... look at the media players that are out. It's taken MS and Quicktime years to make a viable player... and even then, you need all these damn codecs and whatnot to play all the pr0n.
    EntropySink. You know you have to click it.

  5. #5
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    I want to understand more about the media players. it might not be too difficult if one looked at some open source media players code. I was wondering if anyone here had done some of this work.

  6. #6
    Banned maes's Avatar
    Join Date
    Aug 2001
    Posts
    744
    Do you mean with something like directx and use the filters? If that is the case, then I'm trying to. Right now, I have an mp3 player, and when it is more or less a descent working program, I'm going to add the filters for mpeg, avi and possebly divx. I have no idea on how to create the filters but I hope I'll get there.

    If you mean realy realy hardcoded, like not useing directx or other graph library (just C/C++) then my answer is no

  7. #7
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    I don't like the sound of using DirectX for anything, but C/C++ is a good idea. Where do you get the filters? To tell you the truth I don't know much about it. I guess it all has to to with encoding/decoding from some protocol into binary.

  8. #8
    Banned maes's Avatar
    Join Date
    Aug 2001
    Posts
    744
    I once found some code in C and asm that would play an mp3 file but I couldn't get it to work. I think some files where missing. It was from Xing player (see attachment). But I wouldn't recomend it to anyone. And that is only the codec for mp3, no vision only sound. But I also read somewhere that the codec for divix is available on the net.

    I also don't know about Mediaplayers, But I think very few MP are made from the ground up. Most of them uses Windows Mediaplayer or Directx. I think even Win MP and the playa (from the Divx website) uses directx. I once screwed up my DirectX a bit and all the players a I tried had the same problem (they kept showing the frames, very anoying). That is why I think they all use directx. So I wouldn't recomend building from scratch (but who am I )

    There is a source example on how to play avi, mpeg and mp3 (and other media types) in the DirectX SDK (under DirectShow)
    if you're interested, here is a bit of my mp3playing code (if you want the full code, just ask and I'll post it.)
    It basicly is your friend(sunlight)'s code but adapted to my needs
    Code:
    	IPin *pPin;
    	::CoInitialize(NULL); 
    	CoCreateInstance(CLSID_FilterGraph, NULL,CLSCTX_INPROC, IID_IGraphBuilder,(void **)&g_pGraphBuilder); 
    
    	g_pGraphBuilder->QueryInterface(IID_IMediaControl,(void **)&g_pMediaControl); 
    	g_pGraphBuilder->AddSourceFilter(wFilename, wFilename, &pSource); 
    	pSource->FindPin(L"Output", &pPin); 
    	g_pGraphBuilder->Render(pPin); 
    	
    	//IBasicAudio     *iba=NULL;
    	LONGLONG llPos = 0;
    
    	g_pGraphBuilder->QueryInterface(IID_IMediaSeeking, (void **)&g_pMediaSeeking);
    	g_pGraphBuilder->QueryInterface(IID_IMediaEventEx, (void **)&g_pMediaEventEx);
    	g_pGraphBuilder->QueryInterface(IID_IMediaControl,  (void **)&g_pMediaControl);
    	//g_pGraphBuilder->QueryInterface(IID_IBasicAudio, (void **)&iba);
        
    	g_pMediaSeeking->SetPositions(&llPos, AM_SEEKING_AbsolutePositioning, &llPos, AM_SEEKING_NoPositioning);
    	g_pMediaEventEx->SetNotifyWindow((OAHWND)m_hWnd, WM_GRAPHNOTIFY, 0);
    	g_pMediaControl->Run();
    	//iba->put_Balance(10000);
    	Cmp3::play=true;
    	Cmp3::SetSoundVolume(Cmp3::soundvolume);
    	Cmp3::ReadMP3Tag();
    	SAFE_RELEASE(pPin)
    in the attachment, there can be some additional files that my VC created but couldn't compile


    hmmm, problem! file is to big. I'll upload it to my site and then I'll post a link

  9. #9
    Banned maes's Avatar
    Join Date
    Aug 2001
    Posts
    744

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Speculative media
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 07-17-2008, 10:06 PM
  2. Personal Program that is making me go wtf?
    By Submeg in forum C Programming
    Replies: 20
    Last Post: 06-27-2006, 12:13 AM
  3. uninstalling windows media player 10
    By MisterSako in forum Tech Board
    Replies: 0
    Last Post: 05-27-2006, 11:53 AM
  4. Windows Media is not working!!!
    By hdragon in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 11-18-2005, 04:42 AM
  5. Codec Bitrates?
    By gvector1 in forum C# Programming
    Replies: 2
    Last Post: 06-16-2003, 08:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21