Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8542875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:10:14+00:00 2026-06-11T12:10:14+00:00

I want to capture video from my activity This is my source code mTempVideoPath

  • 0

I want to capture video from my activity

This is my source code

mTempVideoPath = Environment.getExternalStorageDirectory().getName() + File.separatorChar + "Android/data/" + this.getPackageName() + "/files/" + System.currentTimeMillis() + ".mp4";

File videoFile = new File(mTempVideoPath);
                            try {
                                if(videoFile.exists() == false) {
                                    videoFile.getParentFile().mkdirs();
                                    videoFile.createNewFile();
                                }

                            } catch (IOException e) {
                                Log.e(getCallingPackage(), "Could not create file.", e);
                            }
                            mCurrentVideoURI = Uri.fromFile(videoFile);

                            Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE );
                            intent.putExtra( MediaStore.EXTRA_OUTPUT, mCurrentVideoURI);
                            // preventing it from listing items that aren't on the SD card
                            intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
                            intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
                            startActivityForResult(intent, CAPTURE_VIDEO);

But i get this error:

09-17 18:25:28.945: E/AndroidRuntime(30253): FATAL EXCEPTION: main
09-17 18:25:28.945: E/AndroidRuntime(30253): java.lang.NullPointerException
09-17 18:25:28.945: E/AndroidRuntime(30253):    at java.io.File.fixSlashes(File.java:185)
09-17 18:25:28.945: E/AndroidRuntime(30253):    at java.io.File.<init>(File.java:134)
09-17 18:25:28.945: E/AndroidRuntime(30253):    at com.sec.android.app.camera.CamcorderEngine.renameTempFile(CamcorderEngine.java:1467)
09-17 18:25:28.945: E/AndroidRuntime(30253):    at com.sec.android.app.camera.CamcorderEngine.doStopVideoRecordingSync(CamcorderEngine.java:965)
09-17 18:25:28.945: E/AndroidRuntime(30253):    at com.sec.android.app.camera.CeStateRecording.handleRequest(CeStateRecording.java:69)
09-17 18:25:28.945: E/AndroidRuntime(30253):    at com.sec.android.app.camera.CeRequestQueue.startFirstRequest(CeRequestQueue.java:123)
09-17 18:25:28.945: E/AndroidRuntime(30253):    at com.sec.android.app.camera.CeRequestQueue.access$200(CeRequestQueue.java:32)
09-17 18:25:28.945: E/AndroidRuntime(30253):    at com.sec.android.app.camera.CeRequestQueue$MainHandler.handleMessage(CeRequestQueue.java:60)
09-17 18:25:28.945: E/AndroidRuntime(30253):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-17 18:25:28.945: E/AndroidRuntime(30253):    at android.os.Looper.loop(Looper.java:137)
09-17 18:25:28.945: E/AndroidRuntime(30253):    at android.app.ActivityThread.main(ActivityThread.java:4507)
09-17 18:25:28.945: E/AndroidRuntime(30253):    at java.lang.reflect.Method.invokeNative(Native Method)
09-17 18:25:28.945: E/AndroidRuntime(30253):    at java.lang.reflect.Method.invoke(Method.java:511)
09-17 18:25:28.945: E/AndroidRuntime(30253):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
09-17 18:25:28.945: E/AndroidRuntime(30253):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
09-17 18:25:28.945: E/AndroidRuntime(30253):    at dalvik.system.NativeStart.main(Native Method)

I run on Galaxy S2, ICS!

Help me please!

Thanks you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T12:10:16+00:00Added an answer on June 11, 2026 at 12:10 pm

    I found out the great solution here : VerifiyAndSetParameter error when trying to record video

    The MediaStore.EXTRA_OUTPUT DOES NOT work correctly and has issues.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to write an application to video capture from web-cams in linux. Is
I use ffmpeg to capture screenshot from video. Here is the command code: ffmpeg
I want to develop an application in java to capture video from webcam and
I want to develop a java application to capture video from a usb web
Actually I want to get video capture by camera of frame rate 30 from
I want to capture a video from a real webcam, apply filters with openCv
I want to build application which needs to be able to capture video from
I want to capture images from video using xuggle. Add xuggle-xuggler-3.0.660.jar in lib folder.
I want to capture live video streams to .mp4 file. I have downloaded H264
Basiclly, I want to capture audio/video. Run it through a mp4 muxer and save

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.