Ask Your Question
0

VideoWriter filename doesn't accept certain charactars

asked Nov 10 '13

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!

Preview: (hide)

1 answer

Sort by » oldest newest most voted
1

answered Nov 11 '13

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 "_".

Preview: (hide)

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 (Nov 11 '13)edit

Question Tools

Stats

Asked: Nov 10 '13

Seen: 234 times

Last updated: Nov 10 '13