Wednesday, April 26, 2017

How to play .mts file in iOS

Leave a Comment

Currently im working with a wifi-camera device, which is able to send only videos in .mts format. As i have investigated in google, it leads to conclusion that it is not possible to play the video in iPhone or may be using Objective C.

Now my problem what is,

There is still many paid applications that allows us to play .mts files

PlayerXtreme is able to run files in almost any video format. It has currently the following formats covered:  3gp, asf, avi, divx, dv, dat, flv, gxf, m2p, m2ts, m2v, m4v, mkv, moov, mov, mp4, mpeg, mpeg1, mpeg2, mpeg4, mpg, mpv, mt2s, mts, mxf, ogm, ogv, ps, qt, rm, rmvb, ts, vob, webm, wm, wmv 

See the application: iTunes app

Player i m curently trying is AVPlayer lib

How can i start the coding to get this done in my app also?

Currently I'm trying solve by adding some python scripts to my project as a build.. and calling the same for converting to mp4 format.. anyone worked on py-ObjC Together in XCode pls give some idea..

1 Answers

Answers 1

MTS is a container format. You need to know what the video and audio codecs are, and see whether VideoToolbox and AudioToolbox (the underlying frameworks of AVPlayer) support those codecs.

Assuming H264 for video and AAC or AC3 for audio, libavcodec (part of ffmpeg) supports the MTS container. You can use that to demux the video and audio streams, and then use VTDecompressionSession and AudioQueueNewOutput (I think, I haven’t used that API in a while).

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment