@@ -73,7 +73,6 @@ protected void onCreate(Bundle savedInstanceState)
7373 final TextView uploadVideo = findViewById (R .id .uploadVideo );
7474 TextView cutVideo = findViewById (R .id .cropVideo );
7575 TextView compressVideo = findViewById (R .id .compressVideo );
76- TextView extractImages = findViewById (R .id .extractImages );
7776
7877 tvLeft = findViewById (R .id .tvLeft );
7978 tvRight = findViewById (R .id .tvRight );
@@ -147,22 +146,6 @@ public void onClick(View v)
147146 }
148147 });
149148
150- extractImages .setOnClickListener (new View .OnClickListener ()
151- {
152- @ Override
153- public void onClick (View v )
154- {
155- if (selectedVideoUri != null )
156- {
157- extractImagesVideo (rangeSeekBar .getSelectedMinValue ().intValue () * 1000 , rangeSeekBar .getSelectedMaxValue ().intValue () * 1000 );
158- }
159- else
160- {
161- Snackbar .make (mainlayout , "Please upload a video" , 4000 ).show ();
162- }
163-
164- }
165- });
166149 extractAudio .setOnClickListener (new View .OnClickListener ()
167150 {
168151 @ Override
@@ -496,52 +479,6 @@ private void executeCompressCommand()
496479 videoView .pause ();
497480 }
498481
499- /**
500- * Command for extracting images from video
501- */
502- private void extractImagesVideo (int startMs , int endMs )
503- {
504- File moviesDir = Environment .getExternalStoragePublicDirectory (
505- Environment .DIRECTORY_PICTURES
506- );
507-
508- String filePrefix = "extract_picture" ;
509- String fileExtn = ".jpg" ;
510- String yourRealPath = getPath (MainActivity .this , selectedVideoUri );
511-
512- File dir = new File (moviesDir , "VideoEditor" );
513- int fileNo = 0 ;
514- while (dir .exists ())
515- {
516- fileNo ++;
517- dir = new File (moviesDir , "VideoEditor" + fileNo );
518-
519- }
520-
521- boolean result = dir .mkdir ();
522- if (result == false )
523- {
524- Toast .makeText (this , "Failed to create directory" , Toast .LENGTH_LONG ).show ();
525- return ;
526- }
527-
528- filePath = dir .getAbsolutePath ();
529- File dest = new File (dir , filePrefix + "%03d" + fileExtn );
530-
531- Log .d (TAG , "startTrim: src: " + yourRealPath );
532- Log .d (TAG , "startTrim: dest: " + dest .getAbsolutePath ());
533-
534- /* Remove -r 1 if you want to extract all video frames as images from the specified time duration.*/
535-
536- String [] complexCommand = {"-y" , "-i" , yourRealPath , "-an" , "-r" , "1" , "-ss" , "" + startMs / 1000 , "-t" , "" + (endMs - startMs ) / 1000 , dest .getAbsolutePath ()};
537-
538- FFmpegResponseHandler handler = new FFmpegResponseHandler (this , durationMs , progressDialog , _transcodeResultHandler );
539- FFmpegUtil .call (complexCommand , handler );
540-
541- stopPosition = videoView .getCurrentPosition (); //stopPosition is an int
542- videoView .pause ();
543- }
544-
545482 /**
546483 * Command for extracting audio from video
547484 */
0 commit comments