Author Topic: Resizing video  (Read 2004 times)

Offline aKa.SkUlL

  • Newbie
  • Member
  • Posts: 81
    • View Profile
Resizing video
« on: August 03, 2012, 07:56:11 PM »
how do i resize a video source while maintaining the aspect ratio?? :-\

Offline J_Darnley

  • Global Moderator
  • Member
  • *****
  • Posts: 397
    • View Profile
Re: Resizing video
« Reply #1 on: August 04, 2012, 01:15:19 AM »
By using some math or by letting the software do it for you!
Knowledgeable about: cmd.exe, ffmpeg, x264

Offline aKa.SkUlL

  • Newbie
  • Member
  • Posts: 81
    • View Profile
Re: Resizing video
« Reply #2 on: August 04, 2012, 03:14:42 AM »
http://imageshack.us/photo/my-images/109/capturezzx.png/
the source resolution is 720x576 but why does it show display size as 1021x436

Offline AnonCrow

  • Member
  • Posts: 36
    • View Profile
Re: Resizing video
« Reply #3 on: August 04, 2012, 07:21:41 AM »
720x576 , with your automatic cropping settings to remove 70 pixels from top and bottom and 2 pixels from right-> 718x436

With the aspect ratio of 16/9 applied to make the pixels square:
(16/9) / (720/576) * 718 = ~1021 --> 1021x436


Offline aKa.SkUlL

  • Newbie
  • Member
  • Posts: 81
    • View Profile
Re: Resizing video
« Reply #4 on: August 04, 2012, 06:25:09 PM »
how did you calculate this

Offline J_Darnley

  • Global Moderator
  • Member
  • *****
  • Posts: 397
    • View Profile
Re: Resizing video
« Reply #5 on: August 05, 2012, 01:02:06 AM »
Display Aspect Ratio = Frame size * Sample Aspect Ratio

"(16/9) / (720/576)" is the SAR
"(16/9) / (720/576) * 718" multiply the frame width by this to get the display width
Therefore the display size is "1021x436"
Knowledgeable about: cmd.exe, ffmpeg, x264

Offline aKa.SkUlL

  • Newbie
  • Member
  • Posts: 81
    • View Profile
Re: Resizing video
« Reply #6 on: September 05, 2012, 01:44:28 AM »
what happens when we don't set DAR?

Offline J_Darnley

  • Global Moderator
  • Member
  • *****
  • Posts: 397
    • View Profile
Re: Resizing video
« Reply #7 on: September 05, 2012, 09:45:49 AM »
If you don't set some kind of aspect ratio information when making a video, everything (that I can think of) assumes that pixels are square.  Put another way, if the video is 100x200 it will be shown at a 1:2 ratio.
Knowledgeable about: cmd.exe, ffmpeg, x264

Offline aKa.SkUlL

  • Newbie
  • Member
  • Posts: 81
    • View Profile
Re: Resizing video
« Reply #8 on: September 12, 2012, 05:05:15 AM »
is it necessary to use tune - animation for anime source?

Offline Kigaruna

  • Member
  • Posts: 28
    • View Profile
Re: Resizing video
« Reply #9 on: September 12, 2012, 10:23:33 AM »
no, if you mean japanese animation - beter use tune film. even tune grain may give better results (assuming you're not doing some small-sized encode for smartphone ^__^). but i'm not going to explain why, when and what i mean. Or do tests and see yourself.
« Last Edit: September 12, 2012, 10:27:18 AM by Kigaruna »

Offline aKa.SkUlL

  • Newbie
  • Member
  • Posts: 81
    • View Profile
Re: Resizing video
« Reply #10 on: September 16, 2012, 04:38:51 AM »
thanks

Offline J_Darnley

  • Global Moderator
  • Member
  • *****
  • Posts: 397
    • View Profile
Re: Resizing video
« Reply #11 on: September 16, 2012, 11:19:45 AM »
no, if you mean japanese animation - beter use tune film. even tune grain may give better results (assuming you're not doing some small-sized encode for smartphone ^__^). but i'm not going to explain why, when and what i mean. Or do tests and see yourself.

[citation needed]

Anime is not film.  It usually has more detail than western animation but people and movable objects are still large flat areas of colour with black lines surrounding them.  The animation tuning is till recommended for anime.
Knowledgeable about: cmd.exe, ffmpeg, x264

Offline Kigaruna

  • Member
  • Posts: 28
    • View Profile
Re: Resizing video
« Reply #12 on: September 24, 2012, 07:01:54 PM »
[citation needed]

Anime is not film.  It usually has more detail than western animation but people and movable objects are still large flat areas of colour with black lines surrounding them.  The animation tuning is till recommended for anime.
Why it is recommended? By who? For what type of encode?
It is true that anime is not film and tune film wasn't made for anime to begin with. And it applies some stuff that I consider bad for anime. But it produces better results than other presets. You talking about flat areas but this is exactly one of the reasons why tune animation is bad. These areas may look flat to you but they are gradients very often. animation tuning will make them flat indeed but this is not what you need for high quality encode. This is more true for 8bit encoding than 10bit of course. I'm not saying that film preset is "best" or something. It may introduce ringing etc. For "best" results when you want to preserve as much as possible, so called visually lossless encode, none of the presets actually fits for anime encoding and custom commandline needed.
Personally I only say tune animation is good for 3d stuff because x264 devs was saying so. I don't encode such stuff myself so not sure. Other than that tune animation is good only for very lossy encodes when you don't mind bluriness, banding etc. and/or if your crf too high (anything above crf18 for anime is not good quality and tune animation may hide artifacts)
What i'm saying doesn't need citations. Anyone who have experience in anime encoding will agree with me, more or less. Well they may recommend tune grain instead if you want preset and not custom commandline. But this is as much suboptimal as tune film (still better than animation)

If your goal is 70mb per episode encodes for use on your android smartphone - this is when you go tune animation. Is it necessary to use tune animation? Answering "yes" to such general question is pure misleading. You don't know what goals user have in mind. Not to mention that what kind of processing user does before encoding also matters, does "flat" areas really flat or not, etc. For average unprocessed anime source with high quality encode in mind, tune film is what good to recommend for newbies. Or make them learn and chose optimal commandline that will result what they expect to see. This is what I recommended. If you don't agree, you probably also want to learn about anime encoding or average user expectations.
« Last Edit: September 24, 2012, 07:53:38 PM by Kigaruna »

Offline J_Darnley

  • Global Moderator
  • Member
  • *****
  • Posts: 397
    • View Profile
Re: Resizing video
« Reply #13 on: September 25, 2012, 02:38:12 AM »
Why it is recommended? By who? For what type of encode?
I think Dark Shikari recommends it for cel-shaded animation.

Quote
Personally I only say tune animation is good for 3d stuff because x264 devs was saying so.
Now that does need a citation because I can show that one dev thinks otherwise: http://doom10.org/index.php?topic=450

Quote
Other than that tune animation is good only for very lossy encodes when you don't mind bluriness, banding etc. and/or if your crf too high (anything above crf18 for anime is not good quality and tune animation may hide artifacts)
What i'm saying doesn't need citations. Anyone who have experience in anime encoding will agree with me, more or less. Well they may recommend tune grain instead if you want preset and not custom commandline. But this is as much suboptimal as tune film (still better than animation)

If your goal is 70mb per episode encodes for use on your android smartphone - this is when you go tune animation. Is it necessary to use tune animation? Answering "yes" to such general question is pure misleading. You don't know what goals user have in mind. Not to mention that what kind of processing user does before encoding also matters, does "flat" areas really flat or not, etc. For average unprocessed anime source with high quality encode in mind, tune film is what good to recommend for newbies. Or make them learn and chose optimal commandline that will result what they expect to see. This is what I recommended. If you don't agree, you probably also want to learn about anime encoding or average user expectations.
Why are you a person to be trusted to represent everyone else?  I do agree that anything lower than 18 is not "good" quality but only "medium" and I admit that I don't have experience with encoding anime.  However, I would like to think that I know good quality when I see it.  I think you are right that some anime would benefit from setting that try to keep more fine detail but I disagree that you should recommend film for it all.  We could go on arguing without any evidence to back us up.  If you have some, I would love to see a comparison of film and animation tuning used when encoding anime.

As for
Quote
Is it necessary to use tune animation? Answering "yes" to such general question is pure misleading.
Yes, it is very misleading to say that any tuning is required and I would not say that.  I probably would have said "No, it is not required to use any tuning, but animation is the suggested one."
Knowledgeable about: cmd.exe, ffmpeg, x264

Offline Kigaruna

  • Member
  • Posts: 28
    • View Profile
Re: Resizing video
« Reply #14 on: September 25, 2012, 03:19:12 AM »
I think Dark Shikari recommends it for cel-shaded animation.
This is may be true, but for what kind of encodes? It is ok if you don't mind blurry picture with flattened gradients, banding and blockiness in high motion parts. Of course this is depends on crf/bitrate but you need noticeably more bits with tune animation to save yourself from seeing this. However I agree that for flash animation or some American crap like simpsons or anything by Disney, tune animation is good.

Now that does need a citation because I can show that one dev thinks otherwise
I may be wrong here. Maybe I misunderstood something. And I never tried to encode real 3D stuff, don't even have any source for this... If this is true than other than encoding simpsons, tune animation is useless.

Why are you a person to be trusted to represent everyone else?  I do agree that anything lower than 18 is not "good" quality but only "medium" and I admit that I don't have experience with encoding anime.  However, I would like to think that I know good quality when I see it.  I think you are right that some anime would benefit from setting that try to keep more fine detail but I disagree that you should recommend film for it all.  We could go on arguing without any evidence to back us up.  If you have some, I would love to see a comparison of film and animation tuning used when encoding anime.
It is your (or anyone else's) decision to trust or not to trust. I just say my opinion and described why it is like that. I also don't say "for everyone", I said I heard many opinions, and most of them more or less match.
As I said I don't think film is an optimal tuning for anime and I don't like to recommend it, but what to recommend then? Should I say that there is no tunings for anime and you have to build complicated commandline? Actually I do say this, just after I said about tune film.
« Last Edit: September 25, 2012, 03:22:18 AM by Kigaruna »

Offline SeanYamazaki

  • Member
  • Posts: 1
    • View Profile
Re: Resizing video
« Reply #15 on: December 08, 2012, 02:54:54 PM »
Display Aspect Ratio = Frame size * Sample Aspect Ratio

"(16/9) / (720/576)" is the SAR
"(16/9) / (720/576) * 718" multiply the frame width by this to get the display width
Therefore the display size is "1021x436"


Is there any real benefit to expanding the video out to its full resolution on encode? For most SD NTSC sources I usually use (after cropping) 720/AR, since that's the width stored on the disc. I can't really tell much difference between what the player upscales and an encoding that multiplies the width to expand the video.

Offline davidiam

  • Member
  • Posts: 1
    • View Profile
    • web hosting
Re: Resizing video
« Reply #16 on: January 24, 2013, 12:32:04 PM »
Im having the same problem  >:(