26 May '13 - 02:54 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: I can't see video,but just audio of .mp4 usin bass_mp4  (Read 539 times)
istownbull
Posts: 1


« on: 23 Mar '11 - 14:17 »
Reply with quoteQuote

Hi guys,

I am doing my thesis project using bass and have problem. I used bass_mp4 for streaming mp4 file from database. But I can only hear the sound, can't see it visually.

Here my code I use;
           byte[] buffer = null;
            FileInfo fInfo = new FileInfo(@"c:\hs.mp4");
            int numBytes = (int)fInfo.Length;
            FileStream fStream = new FileStream(@"c:\hs.mp4", FileMode.Open, FileAccess.Read);
            BinaryReader br = new BinaryReader(fStream);

            buffer = br.ReadBytes(numBytes);
           
         
            if (Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero))
            {

                GCHandle _hGCFile;

                _hGCFile = GCHandle.Alloc(buffer, GCHandleType.Pinned);
 
                int stream = Un4seen.Bass.AddOn.Aac.BassAac.BASS_MP4_StreamCreateFile(_hGCFile.AddrOfPinnedObject(), 0L, buffer.Length, BASSFlag.BASS_AAC_STEREO);

                if (stream != 0 && Bass.BASS_ChannelPlay(stream, true))
                {
                    // playing...
                   
                }
                else
                {
                    Console.WriteLine("Error = {0}", Bass.BASS_ErrorGetCode());
                }

           //     _hGCFile.Free();

Thanks in advance
Logged
radio42
Posts: 4012


« Reply #1 on: 23 Mar '11 - 17:20 »
Reply with quoteQuote

The bass_mp4 add-on only supports audio, but not video.
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines