An Efficient Video Editing Application for Android based Technologies

Objective: Smartphone industry is growing day by day.According to studies, maximum smartphone users watch videos on their smartphones.With the time, android operating system is becoming popular due to the applications which are based on android SDKsthat attract the attention of the mobile phone users. Methods: However, with the increase of its popularity video editing in android devices is becoming a complex task for many reasons as well like poor video quality after editing, slow editing process, editing tool crashes while editing etc. There is a need of an attractivetool and an efficient environmentto deal with such complex tasks. Findings: This study discusses the novel and easy-to-use interface of video editing in android devices. The developed tool can perform video encoding which generates number of frames per second. We have applied image processing techniques to add images or text to any frame of video and can apply different effects like covers, sepia, gamma, rotation, snow. Then the tool can regenerate video from the frames produced after editing and application of various effects. Application:The resultant video will be quality conscious and can be generated in multiple formats like MP4, 3GP, and MOV reliably. *Author for correspondence


Introduction
Digital video deals with capturing and applying image processing techniques tostore moving objects to display them on screens like computers and android phones. With the advancement in the technology, things are getting smarter and digitizing in the form of digital cables, digital cameras, and digital audio and digital videos. Smart tools and techniques are available which provides a friendly environment to the users 1 . Through these tools, simple. Now it is easier to capture the favourite moments of your life. Like recordings of wedding ceremonies, parties, group photos with your loved ones and much more. The problem is how to edit videos? How to remove unwanted things from videos? How to add effects to the video? Is it possible to edit on a computer or android phone? And many similar questions arise in our minds. The answer to above questions is yes all video editing problems can be solved efficiently on computers as well as on android phones by using tools and techniques.

Video Editing Tools Consists of Following Things
Video Effects and video transitions: Video effect and transition allow us to add special effects to the video. It enables you to control light properties such as colour, direction, light spreading and intensity. Extract effect creates grayscale images and eliminates unwanted colour from videos while editing. ProcAmp effect allows adjusting video clips brightness, hue, contrast, and saturation 5 . Shadow effect brightens shadows on objects on the basis of surrounding pixels. It also includes colour correction, black and white clips, temporal smoothing and scene detect. To invert colour information in the video, it uses invert video effects. Dissolve effect is used to blend video clips together 6 . If you want old movie scene in your video you can use old movie effects. Similarly, you can also add slow and fast motion effects to your videos. Video enhancement: Video enhancement gives existing videos a new better look. It reduces noise from video clips to make objects more detectable 7,8 . There is a large number of video enhancement techniques. The user can apply these techniques in different directions to maintain highest video quality 9 . It consists of pixel/scale interpolation which is for image or video resizing from a pixel grid to another pixel grid 10 . Blurry video looks quite odd, to make it look better to use video sharpening. Enhancement technique includes contrast enhancement which increases frames quality for human visual. It also improves haze elimination, light enhancement, and dynamic range.

Video compression:
The process in which video is packed into a smaller size than actual size by eliminating redundancy and without affecting video quality so that it can be sent easily and store efficiently 11 . A uncompressed Video file with high quality needs large space due to which it becomes memory expensive. In order to solve this problem, data compression techniques are applied to reduce the size of the video. The formats commonly used are MPEG4 (.mp4), AVI (.avi), QuickTime (.mov). Sharing high-quality images and videos on social Medias (WhatsApp, Facebook etc. . .) using smartphones is an issue due to bandwidth, requires time and large space. Today, there are many apps at play store for android devices that are performing this task but are not efficient and reliable.

Proposed Solution
A video is a sequence of images (frames) 12 . When it moves 25 frames per second, we get moving objects in video format. We can say that the capture and play a digital video is simple as of capturing 25 images at per second and play these images in a series at 25 images (frames) per second. Actually, it is a quite complex task and it takes a lot of processing and memory of the machine. An image having dimensions of 640 x 480 pixels with 24-bit colour which is equally 16.8 million colours which needs 1MB of disk space. In resultant, it needs 25 MB of each interval (second), and 1.5 GB each minute. If we change the screen resolution to higher dimension these results will exceed with more processing and memory as well. Digital videos are large enough, it is quite a complex task to capture and play this data at each second on mobile devices.

Encoding Video
There is some necessary discussion on the importance of recording or compressing with frame rates. It comes from the difference in American video rates (30 frames per second) VS European (25 frames per second) 13 . Most of the mobile play quarter screen video at 30 frames per second.
It is recommended but not necessarily, to cut this rate by half of dropping frames at each second i.e. dropping every next frame and yielding up 15 frames per second. Similarly, doing this to 25 frames per second to European video, but in European video, we will get a fractional frame rate, 12.5 frames per second video (or 25 frames per 2 seconds). In our application we have encoded and compiled with the normal encoding technique as 25 frames per second in our tool, we can change this frame rate to any numbers up to 1000 frames per second as well, as we increase framing rate, the processing rate will also increase proportionally.

Editing
At this stage, we will get a sequence of images (frames) 25 frames per second of the complete video till the end. Now we have got all the detail series of images (frames) and we can add more information to these series of images (frames), in our application, we can add front covers, background images to the video frames and many other effects to these images (frames). As we can detect an object from video or can replace any object in a video. Such as if we want to replace some text with video at any interval, we can simply be doing that by applying different image processing techniques and by applying many algorithmic approaches. As many images (frames) contains unnecessary information or some kind of other objects, this is due to a noise or may be scratches on the frame, or probably a sort of light effects we want to replace them by doing copy some part of the image from somewhere and replacing that object with the same copied content. It seems too odd and looks a type of repetition on the image. So an efficient technique exists for performing such sort of small-scale noise removal or object replacement. Such as if we talk about replacing an object from the frame of the video we can apply Heeger and Bergen algorithm 14 . We can also enhance the quality of digital videos by enhancing the quality of these grabbed frames that we captured from video. In the domain of image processing or computer graphics image enhancement techniques are widely appreciated. The image enhancement techniques may be a Spatial domain or Frequency domain. In the Spatial domain, an image is a 2D matrix where pixels are combined and forms an image collectively. We can perform and analyze each pixel individually. In Spatial domain, the expression represents the image as shown in equation(i) 15 :

A (x, y) = M [T (x, y)]
(i) The intensity of a pixel with the coordinates of T(x, y) in the resultant image that is qualitatively enhanced image A, which is enhanced the resultant image. There are some more general methods for image enhancement in the spatial domain, i.e., grey scale manipulation, Histogram Equalization, Image Smoothing, Image Sharpening, and High boost filtering. Same enhanced results can be generated by frequency domain techniques and Fourier transformation. We usually calculate and perform the Fourier transform of the frame (image) that needs to improve quality. We simply multiply the result to a filter then take the inverse transformation of image to improve the frame quality. Frequency domain provides us more general methods and some algorithmic techniques which help to enhance image quality i.e., filtering and Homomorphic filtering plays a role in producing desires results. Similarly, we can perform different video compression techniques to perform certain data compression action. Minimum numbers of bits of an image or frame are represented by a technique called image compression. This technique works more efficiently when there is some redundancy in the image. There are some general redundancies exist in digital image processing i.e., Psycho-visual Redundancy, Inter-pixel Redundancy, and Coding Redundancy as well. We implement different methods for different types of redundancies. So, digital image compression categories in two sections i.e., lossy or lossless compression 16 . We can get a high compression ratio of Lossy compression with the ratio of, 50:1 or more. But the flaw with Lossy compression is the original data recovery cannot possible. In contrast, lossless compression recovers the original data completely since this reduces the ratio of compression about 2:1.

Video Decoding
The process of reconstruction of video from (edited) frames and get the required output video is a stage of video decoding. At this stage, we have implemented media encoding procedures with the help of H.264 Baseline profile decoder 17 . H.264 is a popular decoding mechanism 18 , for streaming digital videos 19,20 . There are many uses of H.264 decoder and these uses are subjective. However, there are many aspects of adapting this decoder and this depends on hardware and their availability. According to the last session we have grabbed 25 frames per second from the complete video, similarly here we join the frames with the same frequency at each interval. According to the previous discussion on image enhancement and image compression, when we will get the output video it will also enhance and compressed as well. The resultant video can be generated in multiple formats like MP4,3GP, and MOV. Meanwhile generating the video, our proposed tool also considers the quality of the video. It can generate low and high-quality videos respectively.

Results and Discussion
Although there are many video editing tools for mobile platforms but our developed tool has covered all the aspects and features to edit a video. User-friendly envi-  Vol 12 (15) | April 2019 | www.indjst.org ronment makes any system popular and easy to use. We have considered the user friendliness and make it easy and simple. The first step is user will select the video from mobile gallery or storage as shown in Figure 1. The video selection procedure depends on user i.e., if user have selected a lengthy video then video encoding and decoding process will take more time to complete.
After selecting a video, user will press the frame button to create the frames from video. This stage is the decoding process and it will grab 25 frames per second from the complete video. After encoding process completed, it will show all the frames in the gallery video in detail. Figure 2 shows frames generating process.
After encoding video process (grabbing frames), user can add a front cover to video e.g. wishing valentine, birthday or wedding greetings shown in figure.3. The next stage is to add a caption or any image to cover photo to which we wish. This feature also covers the aspect to add watermark or any object to video. We can also consider it to add text or image to anywhere in the video. Figure 4 demonstrates the addition of caption or image to the cover photo or frame, e.g. user will click the caption button to add caption to the image. The caption adding mechanism is dynamic and the user can paste it anywhere to the image by dragging it to the screen. Similarly, our tool provides another feature to add and crop the image and paste it dynamically anywhere to the frame or front cover of the video. The user can adjust the cropped image by touching mobile screen and paste it anywhere to the image.
In the field of digital image processing, image process is that manipulating image (frame) with the help of mathematical operations by victimization any type of signal process that the input is a picture, a sequence of frames, or any video; the output could also be a picture or a group of features or parameters associated with the image. Usually, image processing involves using the picture as a 2D matrix and use different algorithmic techniques with the image. In our tool we have added different image processing techniques e.g., add different colour effects to the frames like sepia, gamma black, and white, snow, and also rotate the image at 90 degrees of angle. This makes the video attractive and more meaningful, for the sake of demonstration we have just added a few but we can add a lot more in a similar fashion. There are some screenshots to show the images to add these effects to a video; also, we highlighted the effects respectively in figure.5. In our developed tool, we have added a black and white effect; it is popular and widely using in image processing. Meanwhile, RGB (colour) images can be treated as black and white (grayscale) images. To develop this phe-

Grayscale
The grey scale picture YY dimension horizontally and XX dimension vertically demonstrated as a 2D matrix of size X*Y. It denotes the matrix as an image (X, Y) to represent the intensity values of pixels as [0,1] such that 0 represent white and 1 represent black respectively.

Snow Effect
In this effect we can add some noise in the image, we perform some random action to the image i.e., if the pixel intensity value of RGB image is maximum (0*CC) and it exceeds the threshold value then we have changed the intensity value to that pixel as white, and we can achieve snow effects as well.

Sharpen and Gamma effects
As we discussed in previous editing section, image sharpening and enhancement is the widely appreciated technique in digital image processing through which we can also enhance the video quality by applying these effects one by one to each frame of the video. We have adopted one of the techniques to achieve this goal by applying some high-pass filtering operations. Usually, some filters such as linear filters can be used as a high-pass filter but, the drawback to linear technique is, it provides some undesired output if the input image contains some unwanted information such as noise 21 . In results, among unwanted information and edge deduction can achieve if we apply appropriate median filter action besides some suitably weighted values. With similar actions, we have achieved our desired effects such as snowing, sharpening

Image Rotation
This technique is similar as rotating the image multiplying with some vector to the matrix and get the rotated output image, it applies some transformation in reverse. Vertical and horizontal rotation of an image can be shown using equations (ii), (iii). Figure 6 shows the original image and rotated image.

Decoding Video
The process of reconstruction of video from (edited) frames and get the required output video is a stage of video decoding 22 . At this stage, we have implemented media decoding procedures with the help of H.264 Baseline profile decoder 17 . According to encoding section  we have grabbed 25 frames per second from the complete video, similarly here we join the frames with the same frequency at each interval as shown in Figure 7. The output video can be generated in multiple formats like MP4,3GP and MOV and save in the mobile internal storage.

Conclusion and Future Work
An easy-to-use application for the android user for video editing. It takes video for editing from users and encode it. It generates frames on encoding. The user can edit generated frames according to requirements. By using image processingtechniques, we again join edited frames to get edited video. The resultant video is of high quality and can be in multiple formats like MP4, 3GP, and MOV. In future, we will make this application for iOS and add some more features to facilitate users. For example text searching so that user can search text from the video. The user can also add his voice or any audio/video in editing process in the video.