wmv vs mp4 process time. Which one is better for opencv?

asked 2015-11-16 22:23:28 -0500

zms gravatar image

updated 2015-11-16 22:49:21 -0500

Today I had accidentally converting a video file to mp4 instead of only using wmv. I found out that, if I'm using wmv, my processing time for each frame can go to 10ms perframes whereas the same video converted to mp4 only at 2ms per frames. Here is the side by side comparison. So which one I should go in opencv processing in real-time?

image description

edit retag flag offensive close merge delete



I suppose that is linked to the compression, so a more compressed file should be read faster, but compression may also affect the quality of the frames... I would say that your approach is answering your question: if mp4 doesn't affect your processing and results, then it is better to use mp4 for having a faster application.

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-11-17 02:30:34 -0500 )edit

Some other points you should consider:

  1. portability... wmv is not so friendly out of Microsoft
  2. In real-time you should check maximum time too. Some codecs might have non constant processing time. This mean that sometimes, processing time might be higher of its average. For example, it's look your input stream is at 29fps(~34ms). Both codecs have enough performance in average but if sometimes the codec will requires more than 34ms you could lost a frame from the input stream. In this case you have to use a buffer.
pklab gravatar imagepklab ( 2015-11-17 06:01:18 -0500 )edit

Overall using a lossy compression in computer vision and image processing applications is a NO GO since the image artefacts generated by the compression can influence the final result....

StevenPuttemans gravatar imageStevenPuttemans ( 2015-11-19 07:17:29 -0500 )edit