@@ -718,105 +718,6 @@ public void onClick(DialogInterface dialog, int which)
718718 }
719719 };
720720
721- /**
722- * Command for cutting video
723- */
724- private void executeCutVideoCommand (int startMs , int endMs )
725- {
726- File moviesDir = Environment .getExternalStoragePublicDirectory (
727- Environment .DIRECTORY_MOVIES
728- );
729-
730- String filePrefix = "cut_video" ;
731- String fileExtn = ".mp4" ;
732- String yourRealPath = videoInfo .file .getAbsolutePath ();
733- File dest = new File (moviesDir , filePrefix + fileExtn );
734- int fileNo = 0 ;
735- while (dest .exists ())
736- {
737- fileNo ++;
738- dest = new File (moviesDir , filePrefix + fileNo + fileExtn );
739- }
740-
741- Log .d (TAG , "startTrim: src: " + yourRealPath );
742- Log .d (TAG , "startTrim: dest: " + dest .getAbsolutePath ());
743- Log .d (TAG , "startTrim: startMs: " + startMs );
744- Log .d (TAG , "startTrim: endMs: " + endMs );
745- outputDestination = dest ;
746-
747- final String [] complexCommand = {"-ss" , "" + startMs / 1000 , "-y" , "-i" , yourRealPath , "-t" , "" + (endMs - startMs ) / 1000 ,"-vcodec" , "mpeg4" , "-b:v" , "2097152" , "-b:a" , "48000" , "-ac" , "2" , "-ar" , "22050" , dest .getAbsolutePath ()};
748-
749- FFmpegResponseHandler handler = new FFmpegResponseHandler (videoInfo .durationMs , progressDialog , _transcodeResultHandler );
750- FFmpegUtil .call (complexCommand , handler );
751-
752- stopVideoPlayback ();
753- }
754-
755- /**
756- * Command for compressing video
757- */
758- private void executeCompressCommand ()
759- {
760- File moviesDir = Environment .getExternalStoragePublicDirectory (
761- Environment .DIRECTORY_MOVIES
762- );
763-
764- String filePrefix = "compress_video" ;
765- String fileExtn = ".mp4" ;
766- String yourRealPath = videoInfo .file .getAbsolutePath ();
767-
768-
769- File dest = new File (moviesDir , filePrefix + fileExtn );
770- int fileNo = 0 ;
771- while (dest .exists ())
772- {
773- fileNo ++;
774- dest = new File (moviesDir , filePrefix + fileNo + fileExtn );
775- }
776-
777- Log .d (TAG , "startTrim: src: " + yourRealPath );
778- Log .d (TAG , "startTrim: dest: " + dest .getAbsolutePath ());
779- outputDestination = dest ;
780- String [] complexCommand = {"-y" , "-i" , yourRealPath , "-s" , "160x120" , "-r" , "25" , "-vcodec" , "mpeg4" , "-b:v" , "150k" , "-b:a" , "48000" , "-ac" , "2" , "-ar" , "22050" , dest .getAbsolutePath ()};
781-
782- FFmpegResponseHandler handler = new FFmpegResponseHandler (videoInfo .durationMs , progressDialog , _transcodeResultHandler );
783- FFmpegUtil .call (complexCommand , handler );
784-
785- stopVideoPlayback ();
786- }
787-
788- /**
789- * Command for extracting audio from video
790- */
791- private void extractAudioVideo ()
792- {
793- File moviesDir = Environment .getExternalStoragePublicDirectory (
794- Environment .DIRECTORY_MUSIC
795- );
796-
797- String filePrefix = "extract_audio" ;
798- String fileExtn = ".mp3" ;
799- String yourRealPath = videoInfo .file .getAbsolutePath ();
800- File dest = new File (moviesDir , filePrefix + fileExtn );
801-
802- int fileNo = 0 ;
803- while (dest .exists ())
804- {
805- fileNo ++;
806- dest = new File (moviesDir , filePrefix + fileNo + fileExtn );
807- }
808- Log .d (TAG , "startTrim: src: " + yourRealPath );
809- Log .d (TAG , "startTrim: dest: " + dest .getAbsolutePath ());
810- outputDestination = dest ;
811-
812- String [] complexCommand = {"-y" , "-i" , yourRealPath , "-vn" , "-ar" , "44100" , "-ac" , "2" , "-b:a" , "256k" , "-f" , "mp3" , dest .getAbsolutePath ()};
813-
814- FFmpegResponseHandler handler = new FFmpegResponseHandler (videoInfo .durationMs , progressDialog , _transcodeResultHandler );
815- FFmpegUtil .call (complexCommand , handler );
816-
817- stopVideoPlayback ();
818- }
819-
820721 /**
821722 * Get a file path from a Uri. This will get the the path for Storage Access
822723 * Framework Documents, as well as the _data field for the MediaStore and
0 commit comments