Ask Your Question

VideoWriter filename doesn't accept certain charactars

asked 2013-11-10 17:30:12 -0500

Foaly gravatar image

Hello everybody!

I was experimenting with cv::VideoWriter a bit today and I noticed something weird. I was trying to build the filename out of a name, the date and the current time. The string was correct, but my program kept crashing. I noticed that the crash was due to the ":" in the date represenation. When ever there is a ":" in the filename string passed to cv::VideoWriter the program crashes.

Can somebody tell me why that is? Or if this may be a bug. Thanks!

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2013-11-10 19:49:13 -0500

Depending on the OS that you are using (for example, Windows), ":" may not be a valid character for file names.

Your safest bet is to replace all the ":" in the file name with something else, such as "_".

edit flag offensive delete link more



Of course... I forgot it's not a valid character under windows. Maybe a describtiv error message would be nice, instead of a crash.

Foaly gravatar imageFoaly ( 2013-11-11 15:43:08 -0500 )edit
Login/Signup to Answer

Question Tools


Asked: 2013-11-10 17:30:12 -0500

Seen: 101 times

Last updated: Nov 10 '13