5

I need to make mp4 videos eligible for 'streaming' by moving the moov atom to the start [videos are recorded in app by users of my application(so I do not know when a video will get recorded , from which device) (to be sent to my linux host) ] . People recommend mp4box for this purpose but , what exactly is mp4box ? what are those commands ? where do I type them? How do I use that tool for my android app? I don't know if I am missing something obvious but I really couldn't find answers to these basic questions.

Edit: What I mean is : mp4box , ffmpeg etc. doesn't look like 'add dependency to gradle and use it's classes' thing. According to a similar question , I can put moov atom to the start with this command :

'MP4Box -inter 500 original.mp4 -out fixed.mp4'

What is the way to implement this?

I'm open to other solutions too , like handling it on server side.

3 Answers3

1

GPAC contributor here. Please note that the best way to be answered is to raise your question at https://github.com/gpac/gpac/issues

MP4Box will put the 'moov' atom at the beginning of your file (according to your command-line).

There is an MP4Box_android project on the codebase (that is quite old) but wraps the MP4Box executable on Android: https://github.com/gpac/gpac/tree/master/applications/mp4box_android This is exactly what you need if you only know about MP4Box.

There is also a branch to port GPAC to Android Studio (the branch should be merged soon): https://github.com/gpac/gpac/tree/android_studio_osmo

R. Bouqueau
  • 451
  • 2
  • 5
  • Here it is the missing link for Android Studio project https://github.com/gpac/gpac/tree/master/applications/osmo4_android_studio – Duna Feb 05 '21 at 09:40
0

Basic intro about MP4Box is: MP4Box is a multimedia packager, with a vast number of functionalities: conversion, splitting, hinting, dumping and others. It is a command-line tool. It can import MPEG-4 video, DivX, XviD, 3ivx, h264 etc, audio streams and subtitles into the .mp4 container. The end result is a compliant MP4 stream. It can also extract streams from a .mp4. MP4Box is a command line tool, but can be used with graphical user interfaces such as YAMB or my MP4box GUI.

I think below given link is useful to you. It contains some introduction about mp4box and instructions to use: http://www.videohelp.com/software/mp4box

Dhaval Shah
  • 618
  • 6
  • 15
  • what is a command-line tool? I have never heard of it while training for android development. –  Aug 10 '16 at 09:13
  • The CLI(Command-line interface) was the primary means of interaction with most computer systems until the introduction of the video display terminal.Command-line tool is a similar to "command prompt" in our windows system, where user execute certain commands like cd, dir etc. to perform particular task. – Dhaval Shah Aug 10 '16 at 09:20
  • I've already read those definitions . I need a more beginner-friendly explanation on this whole topic. –  Aug 10 '16 at 09:32
0

Use ffmpeg for this purpose with -movflags faststart

i.e:

ffmpeg -hide_banner -i "Input Video.mp4" -movflags faststart -map 0 -c copy -y "Fixed Video.mp4"

You can use ffmpeg on Android