Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Help! I'm trying to playback H.264 raw stream using MediaStreamSource in the WindowsPhone emulator.My 264 stream file is encoded by JM10.1 encoder on level 3.0 baseline profile.But now the emulator can only display the first frame of the stream. How can I get the other frames rendered and displayed?
Here are my GetSampleAsync function codes.I guess something is wrong in this functon.But I can't find it out.
C#
protected override void GetSampleAsync(MediaStreamType mediaStreamType)
                {
                    MediaStreamDescription mediaStreamDescription = new MediaStreamDescription(MediaStreamType.Video, mediaStreamAttributes);
                    Dictionary<MediaSampleAttributeKeys, string> mediaSampleAttributes = new Dictionary<MediaSampleAttributeKeys, string>();
                   
                    MediaStreamSample mediaStreamSample = new MediaStreamSample(mediaStreamDescription, mediaStream, 0, mediaStream.Length, 0, mediaSampleAttributes);
                    this.ReportGetSampleCompleted(mediaStreamSample);
                } 
Posted

Hi,

especially in case of things like video playback, emulators are often buggy (not really buggy, but buggy implementation of Video/Audio Codecs).

Already tried it directly on phone?

With Best Regards
 
Share this answer
 
Comments
Lanalkiss 10-Mar-12 5:31am    
Thank you so much for your advice!
I've not tried it directly on phone since I don't have a WindowsPhone right now. Also,I have tried to playback .mp4 and .wmv file using MediaElement on the emulator and it works well. So I guess it's not the emulator's problem. Anyway,I will buy a phone and try the problem directly on it. Hope everything turns right.
BatataSharp 28-Oct-14 13:38pm    
Hey, Lana, please help me with my inssue, what i need to do to implement MediaStreamSource to read and playbay H264 raw file? I cant, and im trying to make it for a long time. But im beginner with it. Can you help me with this trouble?Thks
El_Codero 10-Mar-12 5:39am    
Oh I would borrow some phone first?It is just a first starting point (for me) to check on device directly in case of such video playback problems.
Lanalkiss 17-Mar-12 2:40am    
Hi,Ranft!
I have tried it directly on phone,but it still can't work.Only the first frame is rendered.How can I find the problem?Thanks a lot!
Lanalkiss 19-Mar-12 23:42pm    
Hi,
Finally I found what a small mistake I made.When I set the MediaElement.AutoPlay Property to "true"(the default value is "true",somehow I changed it before),then everything turns right!
Thank you all the same!
MediaElement.AutoPlay Property must not be "false"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900