Media (Intel® oneAPI Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools from Intel. This includes Intel® oneAPI Video Processing Library and Intel® Media SDK.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

Rotation isn't immediate

Colin_L_
Beginner
143 Views

I'm joining together videos from the front and back camera on Android using Intel INDE Media for Mobile libraries. Each video is recorded from a different camera and may require different rotation angles. When I join the video and watch it, the result is that playback appears to jump before each joined video starts and then rotation occurs about 20-100ms after the next video segment begins. This causes a jarring shift where the video flips cameras and is upside down briefly.

Is this the intended behavior of the RotateEffect and is there any way to make its behavior more immediate and seamless?

Here is the relevant rotation code:

            for (File file : files) {
                try {
                    com.intel.inde.mp.Uri uri = new com.intel.inde.mp.Uri(file.getAbsolutePath());
                    mediaComposer.addSourceFile(uri);

                    MediaFileInfo mediaFileInfo = new MediaFileInfo(new AndroidMediaObjectFactory(getActivity().getApplicationContext()));
                    mediaFileInfo.setUri(uri);
                    Long duration = mediaFileInfo.getDurationInMicroSec();

                    VideoEffect rotateEffect = new RotateEffect(mRotationAngles.get(i), factory.getEglUtil());
                    rotateEffect.setSegment(new Pair<>((long) currentTime, currentTime + duration));
                    Log.d(TAG, "Rotation angle: " + mRotationAngles.get(i) + " time: " + currentTime + " " + (currentTime + duration));
                    mediaComposer.addVideoEffect(rotateEffect);
                    currentTime += duration;
                    i++;
                } catch (Exception e) {
                    e.printStackTrace();
                }

                file.deleteOnExit();
            }

Also, this is unrelated, but I'd love to have some way to flip my video horizontally while transcoding to properly handle the selfie camera. Is there some hidden functionality I'm unaware of in the SDK that can handle this?

0 Kudos
1 Reply
Harshdeep_B_Intel
143 Views

Hi,

We are not able to reproduce the issue you are seeing with above code snippet. Can you please provide us a reproducer of the issue with snapshot of the same. You can directly send me the package using private message including reproducer, input bit streams and snapshot for above issue.

Thanks, 

Reply