caffe icon indicating copy to clipboard operation
caffe copied to clipboard

Can I adjust quality & output time of output video?

Open mintlatte opened this issue 9 years ago • 11 comments

First, I wonder why quality of output video is lower than input video. What kind of things influence quality? And Can I improve quality?

Second I experienced delay between input of webcam and output of ssd. Maybe 1~1.5sec? Is the reason of delay desktop performance? (I use gtx750ti / i5-6600)

Thank you.

mintlatte avatar Mar 09 '17 07:03 mintlatte

Check DetectionOutputLayer visualization part for your first question

weiliu89 avatar Mar 09 '17 16:03 weiliu89

Caffe uses the opencv and ffmpeg libraries for video input and output.

http://stackoverflow.com/questions/25998799/specify-compression-quality-in-python-for-opencv-video-object

JimKlingshirn avatar Mar 10 '17 02:03 JimKlingshirn

I will try that. Thank you so much!

mintlatte avatar Mar 13 '17 00:03 mintlatte

Have you figured this out ?

pnambiar avatar Mar 13 '17 18:03 pnambiar

No, I do yet... But I found that cv::Mat image (it was input of VisualizeBBox) was produced by TransformInv in data_trasnformer.cpp.

So I think it is maybe major thing that determine quality.

mintlatte avatar Mar 14 '17 00:03 mintlatte

ok. I will look into that file. So it looks like a caffe issue. Please let me know know if you make any progress.

pnambiar avatar Mar 14 '17 11:03 pnambiar

Have you ever run ssd_pascal_video by 07++12+COCO/SSD_512x512 model? I run that and I thought its quality of result was better than 300x300 model. But just what i thought, its output fps was too slow.

mintlatte avatar Mar 14 '17 23:03 mintlatte

No not yet. I modified the script to run COCO/SSD_300X300 model. I will try with 07++12+COCO model.

thanks, -P

pnambiar avatar Mar 15 '17 19:03 pnambiar

A simple way to create high quality video with openCV is to write individual frames to disk using cv::imwrite, instead of using videoWriter. Save them as consecutively numbered frames in png format, and create the final video using an ffmpeg command shell. This gives you total control over the compression codec, and compression quality.

On Wed, Mar 15, 2017 at 12:27 PM, pnambiar [email protected] wrote:

No not yet. I modified the script to run COCO/SSD_300X300 model. I will try with 07++12+COCO model.

thanks, -P

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/weiliu89/caffe/issues/486#issuecomment-286852890, or mute the thread https://github.com/notifications/unsubscribe-auth/AFEZviVH3o5gIzu99C4upEi1Iys0KKLEks5rmDutgaJpZM4MXufb .

JimKlingshirn avatar Mar 16 '17 20:03 JimKlingshirn

@JimKlingshirn
The resolution is pretty bad for the real-time output as well (even when we are not writing to a video file). So I'm assuming the problem is not with the VideoWriter

pnambiar avatar Mar 27 '17 20:03 pnambiar

The reason is because it resizes the input image to 300x300, which does not have high quality.

weiliu89 avatar Apr 03 '17 07:04 weiliu89