Jintian Liang
Jintian Liang

Reputation: 51

Move "moov" atom to front of video natively in Android

I've noticed that the moov atom is placed at the end for many .mp4 videos. I'd like to relocate this atom to the front of the video so that I can enable progressive downloading. Is there a way to do this programmatically in Android without using any external libraries? I don't want to also include these binaries in the app. Thanks!

Upvotes: 5

Views: 1256

Answers (1)

Kirk_hehe
Kirk_hehe

Reputation: 489

I was working on the same problem. I found this library: https://github.com/ypresto/qtfaststart-java It is super nice to use. Here is the example:

try {
            QtFastStart.fastStart(fileIn, fileOut);
        } catch (IOException e) {
            // Handle
        } catch (QtFastStart.MalformedFileException e) {
            // Handle
        } catch (QtFastStart.UnsupportedFileException e) {
            // Handle
        }

compile 'net.ypresto.qtfaststartjava:qtfaststart:0.1.0'

Upvotes: 4

Related Questions