Changing directly video saves too

I want to record some of the FB stream in OpenMV IDE. If I use the record button at top right corner of IDE when I press stop it tries to save the output to the program folder and this causes windows to shutdown OpenMV IDE.

Is there anywhere I can change the place it tries to save otherwise the OpenMV IDE just crashes when I press stop record.

Hi, is this the latest version of OpenMV IDE? The IDE is explicitly coded to save data to the temp file directory. Can you show me a screen shot of what happens? Also, are your environmental variables okay? The IDE uses this method to find the temp folder:

QString QDir::tempPath()
Returns the absolute path of the system's temporary directory.

On Unix/Linux systems this is the path in the TMPDIR environment variable or /tmp if TMPDIR is not defined. On Windows this is usually the path in the TEMP or TMP environment variable. The path returned by this method doesn't end with a directory separator unless it is the root directory (of a drive).

See also temp(), currentPath(), homePath(), and rootPath().

I make a short video for you to see - YouTube

Hi, can you try adding a filename? I didn’t see one in the video?

Like call the file “video.mp4” or “video.gif” and then press save? Or, is it exiting when you press cancel or ESC?

In the code that fires this off there could be some weird race condition that causes a null ptr exception on your PC. I can re-generate OpenMV IDE tomorrow with a fix for this if this is the case.

Or is the IDE exiting while the dialog is open and you don’t press anything? If so, then I think I know what’s wrong and it’s definitely related to a timer still firing after I told it to stop.

Windows 10 terminates the IDE before I can press anything.

Windows 10 doesn’t like programs that try access directories it wants secure. Windows 10 is a bit of a pain in the butt at times it doesn’t like to play nice.

I have had this problem before with other programs. If the IDE was to instead try to save the MP4 file to the documents folder the same as it does when I save a .py script then Windows will play nice.

Okay, I see. Well, it could also be a null pointer issue… the code that does the record is called by a timer callback that gets canceled and causes a dialog popup when you press save. If the timer were to fire again after it was previously stopped this could cause an issue. But, I explicitly cancel the timer on the stop button being pressed. However, another event could be in the queue and get processed.

That said, I don’t have this problem on any machine I’ve tested which includes Macs, Mac VMs, Raspberry Pi, Windows PC, Windows VMs, Linux boxes, linux VMs, etc. Note that I use windows 10. The default folder path should be the documents folder.

Anyway, you can change the folder that gets opened by default by editing an INI file setting:

C:\Users<username>\AppData\Roaming\OpenMV\OpenMVIDE.ini

Make sure this says:

[OpenMVFFMPEG]
LastSaveVideoPath=C:/Users//Desktop/video.mp4

OpenMVIDE.ini did not have any [OpenMVFFMPEG] tag at all. Once I added the 2 lines of code to the ini file then everything worked fine :slight_smile:

Hi, given that fixed your issue… Your windows machine is likely very… Different… That only controls where I open a file browser window. So, your machine is killing the IDE based on it viewing a folder…