View the contents of mpeg2ts file created using Android media framework

166 views
Skip to first unread message

Hema A

unread,
Dec 9, 2011, 2:46:29 AM12/9/11
to android-...@googlegroups.com, android...@googlegroups.com

Hi All,

I have extended the MediaRecorder class to support reading from a raw video file. I am using the MediaRecorder class to create the output as Mpeg2TS file with H264 encoding.

recorder = new MediaRecorder();
recorder.setVideoSource(MediaRecorder.VideoSource.MYSOURCE); //Extended media source - my implementation
recorder.setOutputFormat(MediaRecorder.OutputFormat.OUTPUT_FORMAT_MPEG2TS);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
recorder.setOutputFile("/mnt/sdcard/output.ts");

I could get the output file "output.ts". But i could not play it on any of the available players like VLC player. I could not also play it from Gallery application on the same emulator where its recorded.

Can anybody provide suggestions as to how i can view the contents of the ts file?

Please note when i had done the same specifying output format as MediaRecorder.OutputFormat.THREE_GPP. I could play the output file in 3gp format using VLC player.

Thanks,
Hema

Alexy

unread,
Dec 11, 2011, 1:34:51 AM12/11/11
to android-porting
Hi,

I believe you would have already tried disabling High Quality Audio
Resampling as mentioned in

http://www.afterdawn.com/guides/archive/how_to_play_ts_files.cfm

if that is the case, you could try mpeg2 analyzer's like

http://www.pjdaniel.org.uk/mpeg/

and

http://www.softpedia.com/get/Multimedia/Video/Other-VIDEO-Tools/MPEG2-TS-Packet-Analyser.shtml

to see if the stream has any issue


-Alexy

Juan Ramon Morandeira

unread,
May 11, 2012, 2:54:39 PM5/11/12
to android...@googlegroups.com, android-...@googlegroups.com
Hi Hema:

I am dealing with the same problem. Did you find any solution yet?

Thanks,

Juan
Reply all
Reply to author
Forward
0 new messages