Media (Intel® 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
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.

Rotation isn't immediate

Colin_L_
Beginner
286 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
286 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, 

0 Kudos
Reply