Changing directly video saves too

General discussion about topics related to OpenMV.
OutoftheBOTS
Posts: 87
Joined: Tue May 29, 2018 4:15 am

Changing directly video saves too

Postby OutoftheBOTS » Wed May 30, 2018 11:45 pm

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.
User avatar
kwagyeman
Posts: 2191
Joined: Sun May 24, 2015 2:10 pm

Re: Changing directly video saves too

Postby kwagyeman » Thu May 31, 2018 12:37 am

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:

Code: Select all

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().
Nyamekye,
OutoftheBOTS
Posts: 87
Joined: Tue May 29, 2018 4:15 am

Re: Changing directly video saves too

Postby OutoftheBOTS » Thu May 31, 2018 1:28 am

I make a short video for you to see https://youtu.be/DlMzE2GRgvw
User avatar
kwagyeman
Posts: 2191
Joined: Sun May 24, 2015 2:10 pm

Re: Changing directly video saves too

Postby kwagyeman » Thu May 31, 2018 1:39 am

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.
Nyamekye,
User avatar
kwagyeman
Posts: 2191
Joined: Sun May 24, 2015 2:10 pm

Re: Changing directly video saves too

Postby kwagyeman » Thu May 31, 2018 1:41 am

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.
Nyamekye,
OutoftheBOTS
Posts: 87
Joined: Tue May 29, 2018 4:15 am

Re: Changing directly video saves too

Postby OutoftheBOTS » Thu May 31, 2018 1:58 am

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.
User avatar
kwagyeman
Posts: 2191
Joined: Sun May 24, 2015 2:10 pm

Re: Changing directly video saves too

Postby kwagyeman » Thu May 31, 2018 2:10 am

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/<username>/Desktop/video.mp4
Nyamekye,
OutoftheBOTS
Posts: 87
Joined: Tue May 29, 2018 4:15 am

Re: Changing directly video saves too

Postby OutoftheBOTS » Thu May 31, 2018 3:13 am

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 :)
User avatar
kwagyeman
Posts: 2191
Joined: Sun May 24, 2015 2:10 pm

Re: Changing directly video saves too

Postby kwagyeman » Thu May 31, 2018 4:04 pm

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...
Nyamekye,

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 8 guests