| Reply | « Previous Thread | Next Thread » |
|
Hi everybody!
I'm trying to play an mp4 file in a mobile app on my N93. The video is displayed correctly but there is no audio at all. If I play the file in Real Player everything works fine. I moved the file out of the archive as I was getting a prefetch error (-4). Now I am streaming it from the memory card. The mp4 file is about 2 megabytes in size - I created it using the imtoo mp4 converter. Below is the code I use to start the playback. Sorry for using the absolute file path, but this is an application that needs to run only once on that particular phone so there is no need any fancy file logic. I tried getting the VolumeControl and setting it to 100 but that didn't cause any changes. The audio is still not there :-| try { FileConnection conn = (FileConnection) Connector.open("file:///E:/myfile.mp4"); Player player = Manager.createPlayer(conn.openInputStream(), "video/mp4"); player.realize(); player.prefetch(); VideoControl control = (VideoControl) player.getControl("VideoControl"); if (control != null) { control.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, mediaScreen); control.setDisplayLocation(0,0); control.setDisplayFullScreen(true); control.setVisible(true); player.start(); } } catch (IOException e) { e.printStackTrace(); } catch (MediaException e) { e.printStackTrace(); } Best regards, Steff |
| DarthSteff |
| View Public Profile |
| Find all posts by DarthSteff |
|
Sometimes it's rather a better solution if you specify media location directly into the Manager.createPlayer(). The reason is quite simple: it does a lot of things automatically, so you shouldn't care about MIME types.
Player prefetching in most cases is done automatically, even if you call start() method just after the player creation. This is all because of the Player's state model. Also you probably should note, that if mobile phone's native software is supporting some media types, it is not always guaranteed that the mobile java would be able to do the same things (altrough it is using the same Real Player engine). |
|
have you tried to play some other type of media like 3gpp ?
Appears to be a phone problem more than of j2me. regards nimish |
| nimishjain15882 |
| View Public Profile |
| Find all posts by nimishjain15882 |
|
I have tried using 3gp but wasn't happy with the quality (especially the audio quality was very poor).
|
| DarthSteff |
| View Public Profile |
| Find all posts by DarthSteff |
|
Then it appears the file created is not of the correct format. You should try to create the MP4 file using some other software.
|
| nimishjain15882 |
| View Public Profile |
| Find all posts by nimishjain15882 |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| MP4 video playback problem with N70... | Mattloaf | Streaming and Video | 8 | 2007-03-29 11:50 |
| MP4 video on the Nokia N93 | Pepperami | Streaming and Video | 0 | 2007-01-22 00:47 |
| mpeg-4 h.264 avc not available on n93 | gphilpott | Streaming and Video | 2 | 2006-10-19 02:17 |
| playback 3gp or mp4 video | joppie_tjoa | Mobile Java General | 3 | 2006-03-10 05:41 |