Jump to content
thewireguys

Name That Compression!!!

Recommended Posts

Ok lets play a game. Below are 10 images from IP cameras and encoders ranging from D1 to 5MP with all 4 compressions MJPEG, MPEG-4, H.264 and JPEG2000. All cameras where recording to the servers in different compressions, I exported the video and then I exported the JPEG images from the video export. This is not a trick question everything is legit. Now this goes out to cglaeser he says he can correctly identify the compression and if he can I will give him %5 of his next order.

 

Anyone name the manufactures?

 

1

5226297968_e9f026cf4f_o-1.jpg

 

2

5226298066_506bf7acfa_o-1.jpg

 

3

5225701279_e525087c43_o-1.jpg

 

4

5226297956_041a4936c7_o-1.jpg

 

5

5225701209_7607fe13c1_o-1.jpg

 

6

5225701123_376c25aa5e_o-1.jpg

 

7

5226297766_24fc92c330_o-1.jpg

 

8

5226297878_59bd194fcf_o-1.jpg

 

9

5225701339_51b9f1eae3_o-1.jpg

 

10

5226297712_3be55359e9_o-1.jpg

Edited by Guest

Share this post


Link to post
Share on other sites

Can you repost as png files? The compression artifacts from JPEG are the same has three out of four video formats you used.

Share this post


Link to post
Share on other sites
Can you repost as png files? The compression artifacts from JPEG are the same has three out of four video formats you used.

 

I can't export them as png I could convert them but then what is the difference?

Share this post


Link to post
Share on other sites

Thanks for posting the images. I was expecting you to show similar scenes with two or more encodings, but I know that can be a lot of work. The time I typically need the best forensic detail is at night with movement. In my experience with the Panasonic 502 and the Axis Q7404 encoder, that's when JPEG really starts to pull away from H.264.

 

Here is a simple example. It was not yet dark, so the H.264 artifacts are not as severe as the middle of the night, but you can already see the differences in the late afternoon. The vehicle was moving at a relatively slow speed of 10 mph in both images.

 

test1-1.jpg

 

test2-1.jpg

 

Recently I needed the best possible detail on a vehicle image taken at night. Adobe Photoshop can sometimes provide additional detail by pushing the sharpen filter. Here are examples of this technique applied to the two images above. (Be sure and look at the expanded images).

 

test1s-1.jpg

 

test2s-1.jpg

 

Can you guess which image used MJPEG versus H.264. I'm sure you can. Take a close look at the tires in both images. In the JPEG sharpened image, you can definitely see the shape of the tires. In the H.264 sharpened image, the detail is lost due to the motion smearing of H.264. There are other differences in detail if you take the time to compare the two images, particularly where a high contrast region is moving. This H.264 smearing gets worse at night.

 

Now, let's review one of your images that has been sharpened. Which compression do you think was used to record this image?

 

cctv-1.jpg

 

Best,

Christopher

Share this post


Link to post
Share on other sites
Now, let's review one of your images that has been sharpened. Which compression do you think was used to record this image?

There is no way to separate the slow shutter speed which led to that extreme blurring to deblocking filter in H.264 which softens the detail. Indeed, I would say that the slow shutter speed filtered far more detail than the codec ever did.

Share this post


Link to post
Share on other sites
There is no way to separate the slow shutter speed which led to that extreme blurring to deblocking filter in H.264 which softens the detail. Indeed, I would say that the slow shutter speed filtered far more detail than the codec ever did.

 

Yes, slow shutters result in a loss of detail, but that's not the question being asked. The question is, which codec provides more forensic detail in low light movement? MJPEG or H.264? Some are suggesting that H.264 compression is so good that you can't even tell the difference between MJPEG and H.264. What are your thoughts regarding that question?

 

Best,

Christopher

Share this post


Link to post
Share on other sites
Also I would adjust your h.264 settings you can clean that up alot.

 

Fair enough, please post an example of how to do that. Pick any H.264 MP camera of your choosing. Drive your vehicle by at night, once using MJPEG and once using H.264. Post the images with each codec, and let us review the detail in the two images.

 

Best,

Christopher

Share this post


Link to post
Share on other sites

This is all fascinating, but there are far too many variables at play to make any valid comparisons.

 

Scenes, lighting conditions, shutter speeds, CCD sensors, lenses, how well the compression algorithm is implemented, whether hardware acceleration is used or not, and any number of other factors may cause the differences you see in the images.

 

The only way to scientifically compare H.264 compression to JPEG compression is to start out with the same (uncompressed) image, run it through the compression algorithms, and compare the outputs. That's the only way to control all the other variables except the one you wish to measure.

Share this post


Link to post
Share on other sites
Yes, slow shutters result in a loss of detail, but that's not the question being asked. The question is, which codec provides more forensic detail in low light movement? MJPEG or H.264? Some are suggesting that H.264 compression is so good that you can't even tell the difference between MJPEG and H.264. What are your thoughts regarding that question?

 

Best,

Christopher

Thanks for asking .

 

I think the answer is complicated . Putting detail resolution aside for a moment, for MJPEG to match H.264 in overall visual quality, you would need 10X the data rate if not more. Invert that and you will have a very poor image at the 10X lower data rate if you used MJPEG. There would be so many compression artifacts that detail will not be recognizable in MJPEG.

 

Now, there is an inverse argument and that is what you are making. Some of efficiency in H.264 comes from built-in filtering. This is designed as to remove visible compression artifacts in exchange for loss of detail. This is what I mentioned in my previous post. To the extent you don't care about low data rate, and could jack up the bit rate until MJPEG is free of compression artifacts, then it will indeed produce a sharper image.

 

So to a great extent, this question has to do with the data rate in use. There are also other variables such as quality of the H.264 implementation (which varies a ton).

Share this post


Link to post
Share on other sites
This is all fascinating, but there are far too many variables at play to make any valid comparisons.

 

No need to get overly complicated. The claim is that H.264 captures the same detail as MJPEG. I propose the following simple test. Pick your favorite H.264 camera. Drive the same vehicle at the same speed through the field of view at night. Capture the scene using MJPEG and then again using H.264. Grab the best image from each codec and post them. Let us see if indeed H.264 can capture the same detail.

 

Best,

Christopher

Share this post


Link to post
Share on other sites
I think the answer is complicated . Putting detail resolution aside for a moment, for MJPEG to match H.264 in overall visual quality, you would need 10X the data rate if not more.

 

No need to get complicated. Yes, H.264 uses considerably less bandwidth and is a very compelling solution for many applications. However, assume you have a setup with sufficient bandwidth, disk space, and processing power to use any available codec and you want the best possible forensic detail. Which codec would you choose? Which codec will provide more detail, particularly in low light with movement? MJPEG or H.264?

 

Best,

Christopher

Share this post


Link to post
Share on other sites
This is all fascinating, but there are far too many variables at play to make any valid comparisons.

 

No need to get overly complicated. The claim is that H.264 captures the same detail as MJPEG. I propose the following simple test. Pick your favorite H.264 camera. Drive the same vehicle at the same speed through the field of view at night. Capture the scene using MJPEG and then again using H.264. Grab the best image from each codec and post them. Let us see if indeed H.264 can capture the same detail.

 

Best,

Christopher

everyone knows MJpeg is better quality in general.

Share this post


Link to post
Share on other sites
No need to get complicated.

Well the systems we deal with are complicated so the answer is also complicated. Here is a sample. In any motion compensated codec like H.264/MPEG-4, you can set what is called the keyframe distance. If you set this to say, half a second, then the codec generates a full video frame and compresses it in a similar manner to M-JPEG every 0.5 seconds (or more often as it sees fit). So imagine if I am encoding at 10 fps and I set the keyframe distance to 0.1 seconds. If you do that, then the encoder will essentially degenerated into a fancy M-JPEG codec, generating a full frame of video 10 times a second as M-JPEG would.

 

So if it the motion compensation that you are worried with in these codecs, it can easily be defeated (assuming the encoder gives you that parameter as it should).

 

I say "fancy' because H.264 has a more advanced keyframe compression scheme than M-JPEG. The fanciness comes from two things:

 

1. A better transform and entropy coder. Compression lingo for it simply being more efficient than MJPEG in how it generates these still frames but with no loss in fidelity.

 

2. Loop filter. This is a dual-edged source. What this does is that it attempts to soften the compression blocks so that the edges are not visible. I am sure you have seen blocking distortion when data rates are too low. H.264 blends those pixels together. Alas, there is no free lunch and that blending can also remove some picture detail. And H.264 can get quite aggressive in how it does this, providing very pleasing but soft images.

 

Loop filter can be disabled two ways: one is by a flag in the encoder but it is rare to see that in consumer space. The flag is available in professional encoders and some Blu-ray movies for example are encoded with it off. The second way which is kind of indirect is to give the encoder ample bandwidth. The encoder varies the strength of its deblocking filter based on how much compression artifacts exist. If the data rate is very high and there is little to no blocking artifacts, then it doesn't filter much if any pixels.

 

Net, net, if you set the keyframe distance to the timing of your frame rate and given H.264 encoder very high data rate (similar to what M-JPEG would take), you wind up with a better M-JPEG comperssion engine.

 

As the old saying goes, I prefer to teach you how to fish than giving you simple answers that you can't prove beyond asserting it.

 

However, assume you have a setup with sufficient bandwidth, disk space, and processing power to use any available codec and you want the best possible forensic detail. Which codec would you choose? Which codec will provide more detail, particularly in low light with movement? MJPEG or H.264?

I will give you the simple answer you want: M-JPEG. But I wish you would do some experimentation as others have done to see if there is a real trade off there. You might find that H.264 at half to a quarter of the data rate of MJPEG produces the same and maybe even better quality at times. Experiment with above tricks and search for work others have done.

 

Speaking of other people's work, there are a ton of consumer still/video cameras now that encode both in MJPEG and AVCHD which is another name for H.264. Youtube is full of comparsion videos, some of which are well done. Check out these samples but before you play them, be sure to click on the pop up in the youtube player and select 720p and select HD aspect ratio.

 

 

http://www.youtube.com/watch?v=Y3x_lRfuem0

 

These two are kind of revealing as they are done in a way to bring out differences more clearly. Look at the bleeding on the color wheel in the H.264. Might want to open two browser windows and hit play on both at the same time.

 

 

PS sure would be nice if this forum allowed embedding of these videos as I can on other forums .

Share this post


Link to post
Share on other sites

And one more which may come closer to the application we have here:

 

Pause the video when the cars go by and see if you can read the license plates.

Share this post


Link to post
Share on other sites

there is also loss in quality during the conversion to youtube's mp4, I found facebook does a much better job at the conversion, but I dont like to link to that as facebook video has limitations.

So much so I decided to just host mine on my own site for now:

 

Eg: Low quality video to begin with but shows the difference: look at the BW camera.

http://www.youtube.com/watch?v=utspe2XBCBY

http://www.bahamassecurity.com/player/?q=/files/private/video/Geovision%20GV800%20Night%20Quad.mp4

Share this post


Link to post
Share on other sites
Well the systems we deal with are complicated so the answer is also complicated. Here is a sample. In any motion compensated codec like H.264/MPEG-4, you can set what is called the keyframe distance. If you set this to say, half a second, then the codec generates a full video frame and compresses it in a similar manner to M-JPEG every 0.5 seconds (or more often as it sees fit). So imagine if I am encoding at 10 fps and I set the keyframe distance to 0.1 seconds. If you do that, then the encoder will essentially degenerated into a fancy M-JPEG codec, generating a full frame of video 10 times a second as M-JPEG would.

 

I repeat, you are trying to complicate this thread when the topic is really simple. Just use the best frame rate for each codec and post your results. If that's a high frame rate for H.264, then fine, use a high frame rate.

 

 

I will give you the simple answer you want: M-JPEG.

 

" title="Applause" /> " title="Applause" /> " title="Applause" /> Thank you, thank you, thank you, for finally addressing the subject of the original thread. " title="Applause" /> " title="Applause" /> " title="Applause" />

 

But I wish you would do some experimentation as others have done to see if there is a real trade off there.

 

Hello? Are you serious? I have done many controlled experiments comparing MJPEG and H.264 with moving vehicles and people in low light, and I posted an example in this thread. Who else besides me has posted even one example of a controlled experiment comparing these two codecs of moving objects in low light?

 

Youtube is full of comparsion videos, some of which are well done.

 

So you posted videos of a bush?

 

Let's do quick review, shall we. In another thread that began this discussion, I said that I use MJPEG because it provides more forensic detail in low light than H.264. Another forum member said H.264 provides as much detail as MJPEG, and further, that H.264 provides so much detail that you can't even tell the difference between the two codecs. Fine, I'm a student of CCTV and I'm willing to learn. Convince me. Show me some examples. But please don't show me images or videos of paint drying or bushes in the mid day sun. Post some examples of movement (vehicle or people) in low light that compares the detail of the two codecs.

 

Best,

Christopher

Share this post


Link to post
Share on other sites
I repeat, you are trying to complicate this thread when the topic is really simple. Just use the best frame rate for each codec and post your results. If that's a high frame rate for H.264, then fine, use a high frame rate.

I said nothing about frame rates. Read my post again. Keyframe distance is not frame rate.

 

Hello? Are you serious? I have done many controlled experiments comparing MJPEG and H.264 with moving vehicles and people in low light, and I posted an example in this thread.

 

Who else besides me has posted even one example of a controlled experiment comparing these two codecs of moving objects in low light?

I am not writing my answers just for you. I am writing them for everyone. Hence, the advice I gave to investigate these things were general and not take the quickie answer you demanded from me. Your posts did not show evidence that you had tried all the options in H.264. It was devoid of any encoding parameters for example. So I am unclear why you think I should have assumed you had done exhaustive tests of these codecs.

 

So you posted videos of a bush?

A bush that was moving with the exact one in the other codec making the comparison easy and tells you a ton. With motion compensated codecs, it is very hard to do freeze frame comparisons as you did as the very next frame may be sharper than the one you posted. I realize that having a few soft frames may not be good in this application and hence my suggestion to adjust the keyframe distance.

 

Let's do quick review, shall we. In another thread that began this discussion, I said that I use MJPEG because it provides more forensic detail in low light than H.264. Another forum member said H.264 provides as much detail as MJPEG, and further, that H.264 provides so much detail that you can't even tell the difference between the two codecs. Fine, I'm a student of CCTV and I'm willing to learn. Convince me. Show me some examples. But please don't show me images or videos of paint drying or bushes in the mid day sun. Post some examples of movement (vehicle or people) in low light that compares the detail of the two codecs.

 

Best,

Christopher

Christopher, I was not the one who started the argument with you so don't understand the tone of voice you are using with me. I am not here to answer your challenge or settle a bet. I am here to explain how the technology works. If that is not what interests you, then kindly target your posts at someone else.

Share this post


Link to post
Share on other sites
I am not writing my answers just for you. ... don't understand the tone of voice you are using with me.

 

Oh, I don't know, could it have been this ...

 

But I wish you would do some experimentation as others have done to see if there is a real trade off there.

 

... punctuated with video of a bush.

 

Best,

Christopher

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×