H.264 or Photo JPEG for stock footage?

exe said

I used to encode everything to photo J-PEG, and recently I made some tests with a sunlight video. Photo jpeg has a 8 bit per channel output so you get 24 bits max without alpha channel, and the sun ray wasn’t so gradiently smooth. Than I changed my project settings to 16 bits per channel and encoded in h.264 at max quallity at 48 bits total without alpha and the sun ray was perfect smooth and the whole video looked amazing. So I think H.264 is the best option. There is only one problem though, if I make a h.264 in .mp4 format it’s perfect, I can set a constant 60 mbs for example, but quicktime mov h.264 doens’t have an option for constant bitrate it makes it variable just like the canon camera for example. But it still is better quality than photo j-peg.

You’ve jumped to the wrong conclusion, exe.

h.264 and pjpeg are both 8 bit codecs. How you processed the footage prior to encoding may have played a role in your test.

However, I will stress once again, that PJPEG compressed at full resolution will be indistinguishable to the original with the untrained eye. If it isn’t, you’re doing something wrong.

Try this test…
Import your original footage and the h.264 compressed version of the same into After Effects. Drop them into a comp, one on top of another and then set the blending mode of the top layer to difference. Turn the exposure control of the comp up to 10 or 12. Now you are seeing the differences between the two images. Where the images are identical, the pixels are black, where they are not, they will be some other color. Where there is more black in the image, the compression is truer to the original. Now do the same with PJPEG compressed at 100%. Whereas h.264 will show you some rather large compression blocks, PJPEG will be a fine pixel by pixel difference, much smaller in magnitude. If your color sub-sample was 4:4:4 on the original, you may see a very fine horizontal striping too, since PJPEG samples color 4:2:2.

Comparison

compare codec

Okay? Now can everyone stop saying h.264 is a better codec? It’s a very efficient codec; at its max quality, it remains an extremely lossy codec.

If I hear one more dissenting voice, I’m going to post the information from the color channel! :slight_smile:

1 Like

Capturing footage with h.264… then doing some kind of visual correction with software and rendering again to h.264… then having someone buy that footage for a project that is going to be possibly rendered yet again with h.264… that’s a triple lossy combo and sounds like a messy final output…but it seems neither buyers complain here in videohive nor reviewers see value in the added detail of photoJpeg… so maybe lossy is the way to go? :\

I remember favoring photojpeg to h.264 because h.264 didn’t play well with fast motion, unleashing artifacts everywhere… guess this choice depends of the subject.

Okay… so we can put this one to bed once and for all.

Ok, I made another few tests and I see you are right felt_tips, photo jpeg is better and I encoded in 16 bit per channel, But I have another question, from your experience which frame rate is better to use in videos for selling? pal 25 fps or ntsc 30 fps? Currently I use Pal 25 fps.

exe said

Ok, I made another few tests and I see you are right felt_tips, photo jpeg is better and I encoded in 16 bit per channel, But I have another question, from your experience which frame rate is better to use in videos for selling? pal 25 fps or ntsc 30 fps? Currently I use Pal 25 fps.

Tough call. I’m not sure whether the US or the European market is bigger.

Of course if you’re using h.264 or another interframe codec, it allows you to do 150fps… which is of course divisible by 30 and 25.

But you’re wasting space if you use it with PJPEG, you need to be a bit careful about what you do with your motion blur and you’ll probably have most customers scratching their heads. Maybe that’s an option for pre-renders in Ae projects.

Otherwise I couldn’t say. 24fps is a standard that is has a standard conversion method for both NTSC and PAL. I would probably go with that, but you’ll still have problems with anyone making a 30P progressive for the internet.

Incidentally, NTSC is 29.97, not 30fps.

Yes I think you’re right 24 fps maybe the way to go, but do you mean 24p (23,976)? and I didn’t really understand the part with the motion blur, incam I generally double the framerate value to get the shutterspeed, so for 24 or 25 I use shutterspeed 50.

thanx to all : )

h.624!!!

24 or 25 fps?

H.264 or Photo JPEG is very much abstract question which does not have generic answer.



What bitrate? What is content of video to compress? What is quality and preparation, is there any natural noise from camera sensor(if you are lucky to shot in RAW) or artificially added noise? What is output size limitation? What is playback system performance, etc …



So I will not say black or white - yes or no - Photo JPEG or H.264. Just will mention few observations from my experience here.


  1. If you try to compress clean video into H.264 you’ll get too much banding - you’ll need to prepare by adding some noise/grain first wich force H.264 codec to keep more details and have less banding. Same for Photo JPEG, but less noise may be added.


  2. f you have very dynamic and a lot of changes frame by frame - Photo JPEG is better solution.


  3. If you have static footage (like 90-95% of footage here btw) with not so many changes frame to frame - H.264 with proper preparation will look better with smaler size.


  4. H.264 have color change issue (but easy to correct) .


  5. Size does matter! If you encode 1 minute of surce Full HD video into H.264 and have less than 250-300 mb as result(quality 100%, multipass compression) then there is big probability you’l have banding or artifacts. Much better result if you have about 500-600 mb per minute as result. For photo JPEG usually at least 500 mb per minute of FullHD is OK, but around 1gb per 1min looks better.
    So if we are not talking abstract in real Videohive life H.264 (based on 1gb upload limit) in many cases is the only solution.


  6. If you encode H.264 from Camera into H.264 or Photo JPEG after some correction (color, etc) then its much better to clean reslted video by “remove grain” or by other technics first and then add some little noise before encoding. Otherwise encoding H.264 from camera into H.264 or even Photo Jpeg degrade video.


  7. Quicktime Pro is much better encoding into H.264 vs. Adobe AE/Premier since Quicktime Pro able to do multipass compression.



    So as conclusion what codec I like more? - It depends.

    Just few cents.


P.S. Ohh forget to mention also it depend how to playback. As I see Quicktime player is better player to check resulted video. If you ever try Windows Media Player (I tried it on XP and Win7) or some other players on Windws platform you will have different look for Photo JPEG and H.264. Windows Media Player adding contrast/saturation to the Photo JPEG so it looks different from H.264.



Best Regards,
Andrey

Cool Andrey I’ll keep in mind what you said, and btw I thought it through and realised that 24p (23,976 fps) is a more cinematic look for video.

exe said

Cool Andrey I’ll keep in mind what you said, and btw I thought it through and realised that 24p (23,976 fps) is a more cinematic look for video.

You are welcome! I prefere to use 25 fps because 24 fps is easily doable from 25fps (little slow down by interpret). And easy to do 30p from it also.

Best Regards,
Andrey

exe said

Yes I think you’re right 24 fps maybe the way to go, but do you mean 24p (23,976)? and I didn’t really understand the part with the motion blur, incam I generally double the framerate value to get the shutterspeed, so for 24 or 25 I use shutterspeed 50.

Shutter speed is always a function of frame rate. Think of it in degrees instead. A 180 degree shutter at 25fps will be 1/50th of a second and give the same motion blur effect as a 180 degree shutter at 120 fps which wil be 1/240th of a second.

If you shoot at 150 fps and then play it at 25fps, the footage is slow-mo and the motion blur appears normal. If you were to drop it onto a native 25fps timeline using its full 150fps frame rate, the motion blur will seem very clipped (as if you’d shot with a 30 degree shutter… kind of Saving Private Ryan / Rap video effect).

If you wanted to even this out, you’d need to shoot the original with an effective 1080 degree shutter. Impossible with a camera, as far as I know, but not impossible with computer generated motion graphics. The only slight problem comes if your 150fps footage also needs to work with 30fps, in which case you’d need a 900 degree shutter. So somewhere between the two is probably ideal.

As for 23.976, that’s the way that 24fps footage is interpreted for 29.97fps NTSC so that it divides neatly for the 3:2 pulldown required to split it across the 59.94 fields. Anyone using NTSC will know how to do this, so I’d stick to the round 24.

AndrVlad said
  1. f you have very dynamic and a lot of changes frame by frame - Photo JPEG is better solution.


  2. If you have static footage (like 90-95% of footage here btw) with not so many changes frame to frame - H.264 with proper preparation will look better with smaler size.


  3. If you encode H.264 from Camera into H.264 or Photo JPEG after some correction (color, etc) then its much better to clean reslted video by “remove grain” or by other technics first and then add some little noise before encoding. Otherwise encoding H.264 from camera into H.264 or even Photo Jpeg degrade video.



    Andrey
  1. I’d add that although H.264 gets its most optimal compression done when there’s little movement (because it’s an interframe codec), the perceived quality can drop significantly. Because certain color blocks only update occasionally, the lack of distracting movement in the shot can make those compression artefacts stand out.

  2. I couldn’t disagree more. Most remove grain plug-ins (and I’ve tested pretty much all of them) despite being incredibly clever - and some of them utterly unbelievable, nevertheless produce a heavily artefacted image - muddy, soft, smeary, ugly. They should be used with great restraint. Removing grain, then readding it adds a double layer of artefacts to your image. To be avoided at all costs. Grain removers are something I tend to use in an emergency if a shot has been badly underexposed or leaps out in an edit. In most cases, the results are deeply unsatisfactory.

AndrVlad said
exe said

Cool Andrey I’ll keep in mind what you said, and btw I thought it through and realised that 24p (23,976 fps) is a more cinematic look for video.

You are welcome! I prefere to use 25 fps because 24 fps is easily doable from 25fps (little slow down by interpret). And easy to do 30p from it also.

Best Regards,
Andrey

Easy 24p to 30p? You sure about that? If so, let me know how. :slight_smile:

You can go easily from 24p to 60i, using a 3:2 pulldown, (spreading the frames across fields with a 3:2 cadence as is standard for feature films on US TV). But easy 24p to 30p? Never heard of it. That’s always been done with an expensive Snell and Willcox standards converting machine, as far as I know, uses frame interpolation and introduces cadence / picture artefacts.

felt_tips said
AndrVlad said
exe said

Cool Andrey I’ll keep in mind what you said, and btw I thought it through and realised that 24p (23,976 fps) is a more cinematic look for video.

You are welcome! I prefere to use 25 fps because 24 fps is easily doable from 25fps (little slow down by interpret). And easy to do 30p from it also.

Best Regards,
Andrey

Easy 24p to 30p? You sure about that? If so, let me know how. :slight_smile:

You can go easily from 24p to 60i, using a 3:2 pulldown, (spreading the frames across fields with a 3:2 cadence as is standard for feature films on US TV). But easy 24p to 30p? Never heard of it. That’s always been done with an expensive Snell and Willcox standards converting machine, as far as I know, uses frame interpolation and introduces cadence / picture artefacts.

Yes, sure you are right in general. I meant not any video convertion from 25p to 30p but most part of what I do are easy convertable since I rare have footage with included sound and hardly related on sound as well as most timelapse/clouds/nature are easy to speed up or slow down with not much visual impact. :slight_smile:

Best Regards,
Andrey

AndrVlad said

Yes, sure you are right in general. I meant not any video convertion from 25p to 30p but most part of what I do are easy convertable since I rare have footage with included sound and hardly related on sound as well as most timelapse/clouds/nature are easy to speed up or slow down with not much visual impact. :slight_smile:

Best Regards,
Andrey

You don’t need to convert sound. It doesn’t have a frame rate.

What I was interested in was your easy technique for converting 24p or 25p picture to 30p. The numbers don’t divide. You will always have to repeat frames or interpolate frames. Either way, a messy and time-consuming business.

3:2 pull-down works by cunningly dividing whole progressive images across 60 fields using an irregular cadence that’s not too noticeable by the human eye.

My 150 or 120 fps trick for mograph has a similar basis… of finding a number that can be divided by both frame rates (120fps for 24p and 30p, 150fps for 25p and 30p).

So spill the beans Andrey… what’s your trick? :slight_smile:

felt_tips said
AndrVlad said

Yes, sure you are right in general. I meant not any video convertion from 25p to 30p but most part of what I do are easy convertable since I rare have footage with included sound and hardly related on sound as well as most timelapse/clouds/nature are easy to speed up or slow down with not much visual impact. :slight_smile:

Best Regards,
Andrey

You don’t need to convert sound. It doesn’t have a frame rate.

What I was interested in was your easy technique for converting 24p or 25p picture to 30p. The numbers don’t divide. You will always have to repeat frames or interpolate frames. Either way, a messy and time-consuming business.

3:2 pull-down works by cunningly dividing whole progressive images across 60 fields using an irregular cadence that’s not too noticeable by the human eye.

My 150 or 120 fps trick for mograph has a similar basis… of finding a number that can be divided by both frame rates (120fps for 24p and 30p, 150fps for 25p and 30p).

So spill the beans Andrey… what’s your trick? :slight_smile:

Ohh, It looks like I missed your answer. Simple interpret with new frame rate works great for many of my footage. So no trick. :slight_smile: But needed care for sound if it included and relate with video and of course not any footage can still looks natural after such conversion.

By the way in your trick with 120 or 150 fps how you keep natural motion blur in prerendered assets? Also if encode Photo JPEG then including into the project three different fps files 24p, 25p and 30p will have totally smaller size then just one file of 150fps.
H.264 shall be the absolute winner for such high frame rates.

Best Regards,
Andrey