Media (Intel® oneAPI Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.
3001 Discussions

INTEL NDE Media For Android : Lost frames and broken parameters



I am making an application on android that needs to be able to cut 1 second out of a video and store it on the device as a separate video file.
So if I have a video of 10 seconds it would turn into 10 videos of 1 second.

I am using the "Intel INDE Media for Mobile Library" on eclipse to achieve this.

I ran into the following problem while using the library : 

1 :  When I cut 1 second off a video on a NTSC device it returns a video of around 0,8 seconds.
2 :  When I transcode a video of any size or length on a NTSC device, it will lose a couple of milliseconds on the end.
3 :  The Framerate parameter for the VideoTranscoder doesn't work!
4 :  When transcoding the application will crash when you have android version 17 or lower.

1 and 2 :

So basically anything I transcode will lose milliseconds when running on a NTSC device.
Even when I don't add a segment it will still lose milliseconds.

The following code is what i am using to transcode the video : 

public class ComposerCutCoreActivity extends ComposerTranscodeCoreActivity {

    private long segmentFrom = 0;
    private long segmentTo = 0;

    protected void getActivityInputs() {

        Bundle b = getIntent().getExtras();
        srcMediaName1 = b.getString("srcMediaName1");
        dstMediaPath = b.getString("dstMediaPath");
        mediaUri1 = new Uri(b.getString("srcUri1"));

        segmentFrom = b.getLong("segmentFrom");
        segmentTo = b.getLong("segmentTo");

    protected void setTranscodeParameters(MediaComposer mediaComposer) throws IOException {

        configureVideoEncoder(mediaComposer, videoWidthOut, videoHeightOut);


        MediaFile mediaFile = mediaComposer.getSourceFiles().get(0);

       // What I am trying to achieve.
       Long begin = 0;
       Long end = 1000000;
       mediaFile.addSegment(new Pair<Long, Long>(begin , end));

        // The original code.
        //mediaFile.addSegment(new Pair<Long, Long>(segmentFrom, segmentTo));

    protected void printDuration() {

    	TextView v = (TextView)findViewById(;
        v.setText(String.format("duration = %.1f sec\n", (float)(segmentTo - segmentFrom)/1e6));
        v.append(String.format("from = %.1f sec\nto = %.1f sec\n", (float)segmentFrom/1e6, (float)segmentTo/1e6));

This code is a direct copy from the example application with a little change ( I am using this as an example ).
The example application can be found here :

Android Device Used : Xperia™ Z2 Tablet (SGP511)

3 : 

Changing the Video Framerate doesn't work.
I could change the Framerate to 1, 10 or 60 Fps and it would not even show the slightest difference.

I am using the following code to change the Framerate : 


protected void configureVideoEncoder(MediaComposer mediaComposer, int width, int height) {

        VideoFormatAndroid videoFormat = new VideoFormatAndroid(videoMimeType, width, height);

        videoFormat.setVideoFrameRate(videoFrameRate); // The function that isn't working.


source :

 I think that setting the VideoIFrameInterval doesn't work either, but I am not entirely sure about that.

4 : 

Every time I try to transcode a video on an Android Device with SDK Version 17 or lower it will give the following error : 

From : Eclipse Logcat
E/AndroidRuntime(3039): Caused by: java.lang.NoClassDefFoundError:
E/AndroidRuntime(3039):     at<init>(
E/AndroidRuntime(3039):     at
E/AndroidRuntime(3039):     at

Android Device Used : Asus Transformer Pad Infinity (TF700T)

I want to make a working Demo version of this application and i would appreciate if anyone can help me with these problems.



0 Kudos
2 Replies


Thank you for the detailed reproducer on the issue. I will consult the team and update you with a fix or work around.



Hi Jonathan,

Let me answer your questions in reverse order:)

4. Android 4.3 is the lowest version supported by M4M due to android API limitations and different devices behavior in lower versions.

3. Video framerate change is not supported yet so transcoded file always has framerate of original file.

1-2. This issue is addressed on our side but the fix is not yet included in released version. If you are still interested to try binaries with these fixes taking into account answers on 3 and 4 please share your email address with me via "Send Message" and I will share binaries with you