Ask Your Question
0

VideoWriter filename doesn't accept certain charactars

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

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
1

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

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

Comments

1

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 -0600 )edit

Question Tools

Stats

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

Seen: 221 times

Last updated: Nov 10 '13