Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Dave-F
Posts: 20
Registered: ‎02-20-2009
My Device: Not Specified

Flickering video

Hello

 

I have a video file here which is raw mpeg4.  The following code works and displays the video fine:

 

            FileConnection s                = (FileConnection) Connector.open("file:///SDCard/BlackBerry/video.dat");

            InputStream is                  = s.openInputStream();

            

            byte[] dataBuffer = new byte[1024*256];

            is.read(dataBuffer);

            

            ByteArrayInputStream is2 = new ByteArrayInputStream(dataBuffer);

            

            m_player = javax.microedition.media.Manager.createPlayer(is2,"video/mp4");

 

However, if I try and create an inputstream directly,  the video flickers horribly:

 

             FileConnection s                = (FileConnection) Connector.open("file:///SDCard/BlackBerry/video.dat");

            InputStream is                  = s.openInputStream();

            

            m_player = javax.microedition.media.Manager.createPlayer(is,"video/mp4");

 
Could anyone explain why?
 
Cheers,
 
 
Dave 
New Developer
fvquicke
Posts: 1
Registered: ‎11-21-2009
My Device: Not Specified

Re: Flickering video

Hi, we are encountering the same issue. Did you find any reason for this problem?

 

What is the disadvantage of using the first solution?

Developer
Dave-F
Posts: 20
Registered: ‎02-20-2009
My Device: Not Specified

Re: Flickering video

Hi

 

We changed platform.

 

Many thanks,

 

 

Dave

Developer
jdesmedt
Posts: 118
Registered: ‎06-24-2009
My Device: Not Specified

Re: Flickering video

About your first post: The flickering you had, did it always occur at the same time or was it random?

And your working solution: how does it work (for what I understand, your code example only feeds 256K to the Player, that doesn't seem like a large video...)

Developer
Dave-F
Posts: 20
Registered: ‎02-20-2009
My Device: Not Specified

Re: Flickering video

I cannot actually remember the issue as it was a long time ago.

 

I seem to remember it playing the video fine on emulator, but when moving to real hardware it seemed to ignore PTS values in the stream or some such.

 

It's all a long time ago, and I had to get something working quickly so I just used a different device.