Go Back   MacRumors Forums > iPhone, iPod and iPad > iPod

Reply
 
Thread Tools Search this Thread Display Modes
Old Oct 21, 2005, 12:41 PM   #1
snowmoon
macrumors 6502a
 
Join Date: Oct 2005
Location: Albany, NY
Send a message via AIM to snowmoon
TECHNICAL: HQ video for iPod w/sample vid

I don't have a iPod yet, so I have been relying on the eye and judgement of others, all of whom have been happy with the results. I am not a programmer or someone interested in spearheading changes to applications already out there, if you have a favorite app, forward this thread to the author and see what happens.

I WILL NOT ANSWER NON-TECHNICAL QUESTIONS ABOUT THESE APPS OR WHAT I HAVE DONE. So don't ask me to help you unless you know what you are doing already!

My goal was to create high quality video that looked GOOOOOOOOD when hooked to a TV, somewhere between broadcast and DVD quality while keeping the bitrate to a reasonable ammount. Secondary is the quality when viewed on the iPod screen. It looks like that "reasonable" ammount is falling into the range of 9-13mb/minute ( VCD bitrates ). You can go lower, but you will loose quality in some scenes, but not all.

I was working under windows, but the main tool used was ffmpeg and that should be availible for about every OS known to man at this point. Specifically I was using the ffmpeg from pspvideo9. For pre-conversion scaling and cleaning I used AviSynth. Because of some weird reason ffmpeg won't do 23.976 ( rounds up to 23.98 and that leads to audio sync issues ). So my Avisynth did an AssumeFPS and rescaled the audio to match. I also allplies light spatial and temporal smoothing to reduce the very high levels of grain in this particular movie. I then did a very simple 2-pass encode in ffmpeg. I have tried and tried to play with more advanced settings with ffmpeg, but nothing really resulted in higher quality. Tron is, IIRC, 2.05:1 so i trimmed it down to 2:1 and scaled it to 640x320 for my testing. One technical note was I converted to RGB before scaling as this lead to fewer problems with color artifacts from scaling raw 4:2:0 color data.

First pass - standard

ffmpeg -i input.avs -vcodec xvid -vtag mp4v -vprofile SP -4mv -qscale 2 -pass 1 -passlogfile log -acodec aac -ab 96 -f mov out.mov

Second Pass - optimized for iPod

ffmpeg -i input.avs -vcodec xvid -vtag mp4v -vprofile SP -4mv -qmax 8 -bufsize 4096 -maxrate 2350 -b 1100 -pass 2 -passlogfile log -acodec aac -ab 96 -f mov out.mov

-b is the bitrate and I have had good luck setting it to ~ 1/2 the final average bitrate in the first pass. bufzise/maxrate is a precaution against VBR runaway.

And... drumroll please... here is the compression sample from Tron.

http://u2.rit.albany.edu/~ew2193/tron81.mov ( 20MB mov file )

More From "The Fifth Element"

http://u2.rit.albany.edu/~ew2193/tfe-pass2-1100.mov ( 23.3MB .mov 9.32MB/min ) - excellent

http://u2.rit.albany.edu/~ew2193/tfe-pass2-900.mov ( 19.6MB .mov 7.84MB/min ) - ok


ADMINS: This is a compression sample that cuts a dozen or so 300 frame chunks from the movie. I firmly believe this falls under "fair use" but I will pull the link if you feel otherwise.



APPLE: If you see this... please fix the Display Aspect Ratio (DAR) playbeck bug. If you do I can finally create broadcast quality video consistantly and within your specs! Thanks!

EDIT: Oct 25th 1:34pm EST Added -vtag mp4v to make sure that output will have a "conforming" FourCC code.

Last edited by snowmoon; Oct 25, 2005 at 01:35 PM.
snowmoon is offline   0 Reply With Quote
Old Oct 21, 2005, 12:48 PM   #2
Lacero
macrumors 601
 
Lacero's Avatar
 
Join Date: Jan 2005
Hmmm.. does ffmpeg encode H.264?

I think scaling to 320x240 and then compressing will give the best results, as opposed encoding at a different size and allowing the iPod to scale dynamically. This results in lower sharpness and increased CPU usage.

I think Apple has the best settings, something like H.264 encoded at 600Kb/s or so. AAC 128Kbps stereo.

The iPod outputs TV at QVGA quality so the extra resolution is wasted, I believe.
Lacero is offline   0 Reply With Quote
Old Oct 21, 2005, 12:51 PM   #3
snowmoon
Thread Starter
macrumors 6502a
 
Join Date: Oct 2005
Location: Albany, NY
Send a message via AIM to snowmoon
Quote:
Originally Posted by Lacero
Hmmm.. does ffmpeg encode H.264?

I think scaling to 320x240 and then compressing will give the best results, as opposed encoding at a different size and allowing the iPod to scale dynamically. This results in lower sharpness and increased CPU usage.

I think Apple has the best settings, something like H.264 encoded at 600Kb/s or so. AAC 128Kbps stereo.

The iPod outputs TV at QVGA quality so the extra resolution is wasted, I believe.
1) Only for iPod only viewing, yet it's a waste. If you read my introduction the intent was focused on video that looked good on the TV out rather than on the screen.

2) Only for iPod only viewing

3) NO, it's already been shown to output higher quality.
snowmoon is offline   0 Reply With Quote
Old Oct 21, 2005, 01:18 PM   #4
cbiffle
macrumors member
 
Join Date: Jun 2005
Location: Tempe, AZ
Just out of curiosity, everyone has read Apple's info on the accepted formats?

http://www.apple.com/quicktime/tutor...tingvideo.html

Down at the bottom it's pretty specific about what will and will not work.

If you're on the Mac and have a lot of spare time (QT export to H.264 is sloooow) try my app Enpod.

It's really, really preliminary, but it works for me.
cbiffle is offline   0 Reply With Quote
Old Oct 21, 2005, 01:25 PM   #5
snowmoon
Thread Starter
macrumors 6502a
 
Join Date: Oct 2005
Location: Albany, NY
Send a message via AIM to snowmoon
Quote:
Originally Posted by cbiffle
Just out of curiosity, everyone has read Apple's info on the accepted formats?
Of course, but there are so many problems with that list... the fact of the matter it doesn't even play .mp4 files created from the reference tools, nor does it properly obey DAR and PAR issues in the files either ( ie works in QT, not on iPod dispite being a dirt simple change ). Those specs are inacurate and a joke. It will take time for the users to figure out what the device will really do, and what I have done is a first step.

This was targeted far high quality video out for the weekend warrior who wants to carry around a few DVD's far watching whereever he happens to be. Or for that great family video that you have authored, but don't want to cripple it by encoding it to 320x240 ( crap ).
snowmoon is offline   0 Reply With Quote
Old Oct 21, 2005, 01:30 PM   #6
madmaxmedia
macrumors 68030
 
Join Date: Dec 2003
Location: Los Angeles, CA
Send a message via Yahoo to madmaxmedia
Quote:
Originally Posted by cbiffle
Just out of curiosity, everyone has read Apple's info on the accepted formats?

http://www.apple.com/quicktime/tutor...tingvideo.html

Down at the bottom it's pretty specific about what will and will not work.

If you're on the Mac and have a lot of spare time (QT export to H.264 is sloooow) try my app Enpod.

It's really, really preliminary, but it works for me.
Awesome, thanks!!!
madmaxmedia is offline   0 Reply With Quote
Old Oct 21, 2005, 01:40 PM   #7
madmaxmedia
macrumors 68030
 
Join Date: Dec 2003
Location: Los Angeles, CA
Send a message via Yahoo to madmaxmedia
Quote:
Originally Posted by snowmoon
My goal was to create high quality video that looked GOOOOOOOOD when hooked to a TV, somewhere between broadcast and DVD quality while keeping the bitrate to a reasonable ammount. Secondary is the quality when viewed on the iPod screen. It looks like that "reasonable" ammount is falling into the range of 9-13mb/minute ( VCD bitrates ). You can go lower, but you will loose quality in some scenes, but not all.

I was working under windows, but the main tool used was ffmpeg and that should be availible for about every OS known to man at this point. Specifically I was using the ffmpeg from pspvideo9. For pre-conversion scaling and cleaning I used AviSynth. Because of some weird reason ffmpeg won't do 23.976 ( rounds up to 23.98 and that leads to audio sync issues ). So my Avisynth did an AssumeFPS and rescaled the audio to match. I also allplies light spatial and temporal smoothing to reduce the very high levels of grain in this particular movie. I then did a very simple 2-pass encode in ffmpeg. I have tried and tried to play with more advanced settings with ffmpeg, but nothing really resulted in higher quality. Tron is, IIRC, 2.05:1 so i trimmed it down to 2:1 and scaled it to 640x320 for my testing. One technical note was I converted to RGB before scaling as this lead to fewer problems with color artifacts from scaling raw 4:2:0 color data.
You did an awesome job, great test!!

I just played back on my iPod, it works great with no scaling artifacts and no skipping, etc. either.

I won't be able to play on a TV until tonite, but will compare this video with the episode of Lost I bought. This will confirm once and for all what will be possible. But it looks like H264 will be great for portable content, and MPEG4 will be great for TV output.

The video you made has excellent quality, with very few compression artifacts. I didn't look over it with a magnifying glass, but watched it fullscreen on my 15" PowerBook and it looks great. 10 Megabytes per minute, I think that will be the standard for creating iPod content for TV out... It's nice and easy to remember too.

It's only a matter of time before freeware programs are created on Mac and Win to rip DVD's to MPEG4 with settings similar to yours.
madmaxmedia is offline   0 Reply With Quote
Old Oct 21, 2005, 01:54 PM   #8
snowmoon
Thread Starter
macrumors 6502a
 
Join Date: Oct 2005
Location: Albany, NY
Send a message via AIM to snowmoon
Quote:
Originally Posted by madmaxmedia
It's only a matter of time before freeware programs are created on Mac and Win to rip DVD's to MPEG4 with settings similar to yours.
That's half the reason for this thread. To give developers a starting point that is known to work well.
snowmoon is offline   0 Reply With Quote
Old Oct 21, 2005, 02:02 PM   #9
freeny
macrumors 68020
 
freeny's Avatar
 
Join Date: Sep 2005
Location: Location: Location:
the setting i found best for tv viewing are as followed;

using handbrake,
mp4
1100 kbps (ive set higher but not enough difference to justify file size increase)
2-pass encoding (makes a great difference and well worth the time!)
48000Hz
160 Bitrate.
480 widest pixel ratio (as long as hight or width dont exceed 480 pixels)

equals broadcast quality but just short of dvd.
8-9mb per minute

hope this helps.
freeny is offline   0 Reply With Quote
Old Oct 21, 2005, 02:05 PM   #10
snowmoon
Thread Starter
macrumors 6502a
 
Join Date: Oct 2005
Location: Albany, NY
Send a message via AIM to snowmoon
Quote:
Originally Posted by freeny
equals broadcast quality but just short of dvd.
8-9mb per minute

hope this helps.
Making it 640xY means that you are only scaling it once in each direction vs 480xY you are scaling twice in each direction. Although most scenes will probably look ok, you are distroying fine detail. As soon as apple obeys the DAR flags you will be able to have MUCH more flexability in scaling, but until that time 640xY is the way to go.

Those are close to the setting I recommend except you don't have buffer overrun protection. If handbrake has an option to add options "-bufsize 4096 -maxrate 2200" will help make sure that this video does not skip on complex video.

Last edited by snowmoon; Oct 21, 2005 at 02:08 PM.
snowmoon is offline   0 Reply With Quote
Old Oct 21, 2005, 02:05 PM   #11
madmaxmedia
macrumors 68030
 
Join Date: Dec 2003
Location: Los Angeles, CA
Send a message via Yahoo to madmaxmedia
Quote:
Originally Posted by freeny
the setting i found best for tv viewing are as followed;

using handbrake,
mp4
1100 kbps (ive set higher but not enough difference to justify file size increase)
2-pass encoding (makes a great difference and well worth the time!)
48000Hz
160 Bitrate.
480 widest pixel ratio (as long as hight or width dont exceed 480 pixels)

equals broadcast quality but just short of dvd.
8-9mb per minute

hope this helps.
That's another option, using 480 wide to save on storage. But I think VGA at 10MB per minute will be optimal. It just needs good encoding, as OP did.
madmaxmedia is offline   0 Reply With Quote
Old Oct 21, 2005, 02:55 PM   #12
freeny
macrumors 68020
 
freeny's Avatar
 
Join Date: Sep 2005
Location: Location: Location:
Quote:
Originally Posted by snowmoon
Making it 640xY means that you are only scaling it once in each direction vs 480xY you are scaling twice in each direction. Although most scenes will probably look ok, you are distroying fine detail. As soon as apple obeys the DAR flags you will be able to have MUCH more flexability in scaling, but until that time 640xY is the way to go.

Those are close to the setting I recommend except you don't have buffer overrun protection. If handbrake has an option to add options "-bufsize 4096 -maxrate 2200" will help make sure that this video does not skip on complex video.
I was not aware that you could go up to 640pixels. can you really do this on mp4? havent tried it.
freeny is offline   0 Reply With Quote
Old Oct 21, 2005, 02:56 PM   #13
madmaxmedia
macrumors 68030
 
Join Date: Dec 2003
Location: Los Angeles, CA
Send a message via Yahoo to madmaxmedia
Quote:
Originally Posted by freeny
I was not aware that you could go up to 640pixels. can you really do this on mp4? havent tried it.
Uh, how many times do I have to say it works great on my iPod?
madmaxmedia is offline   0 Reply With Quote
Old Oct 21, 2005, 03:14 PM   #14
freeny
macrumors 68020
 
freeny's Avatar
 
Join Date: Sep 2005
Location: Location: Location:
Quote:
Originally Posted by madmaxmedia
Uh, how many times do I have to say it works great on my iPod?
DUDE! you just gave me a boner.
freeny is offline   0 Reply With Quote
Old Oct 21, 2005, 03:29 PM   #15
cube
macrumors G3
 
Join Date: May 2004
The iPod cannot play at 25 fps???
cube is offline   0 Reply With Quote
Old Oct 21, 2005, 03:30 PM   #16
snowmoon
Thread Starter
macrumors 6502a
 
Join Date: Oct 2005
Location: Albany, NY
Send a message via AIM to snowmoon
CUBE: I have no reason to believe it won't, but have not tried.
snowmoon is offline   0 Reply With Quote
Old Oct 21, 2005, 03:33 PM   #17
Scarpad
macrumors 65816
 
Join Date: Jan 2005
Quote:
Originally Posted by freeny
the setting i found best for tv viewing are as followed;

using handbrake,
mp4
1100 kbps (ive set higher but not enough difference to justify file size increase)
2-pass encoding (makes a great difference and well worth the time!)
48000Hz
160 Bitrate.
480 widest pixel ratio (as long as hight or width dont exceed 480 pixels)

equals broadcast quality but just short of dvd.
8-9mb per minute

hope this helps.
to my knowledge two pass is only beneficial when you are using varable bit rate encoding. When specifying a bitrate it does that bitrate thruout, CBR Constant bitrate
Scarpad is offline   0 Reply With Quote
Old Oct 21, 2005, 03:36 PM   #18
madmaxmedia
macrumors 68030
 
Join Date: Dec 2003
Location: Los Angeles, CA
Send a message via Yahoo to madmaxmedia
Quote:
Originally Posted by freeny
DUDE! you just gave me a boner.
Wait til you download and watch the Tron clip. Play it fullscreen your computer...

Hey snowmoon, can you do a short rip from a more demanding movie? Althoug h the Tron clip has some regular shots, the CGI shots are probably less demanding.

Maybe something like 30 seconds from an action sequence in the Matrix, that's always a popular choice. I mean I can sorta do it, but I'm not that great at tweaking settings, etc. and I have been having problems getting ffmpegx to work right on my Mac.
madmaxmedia is offline   0 Reply With Quote
Old Oct 21, 2005, 03:40 PM   #19
snowmoon
Thread Starter
macrumors 6502a
 
Join Date: Oct 2005
Location: Albany, NY
Send a message via AIM to snowmoon
Quote:
Originally Posted by madmaxmedia
Wait til you download and watch the Tron clip. Play it fullscreen your computer...

Hey snowmoon, can you do a short rip from a more demanding movie? Althoug h the Tron clip has some regular shots, the CGI shots are probably less demanding.

Maybe something like 30 seconds from an action sequence in the Matrix, that's always a popular choice. I mean I can sorta do it, but I'm not that great at tweaking settings, etc. and I have been having problems getting ffmpegx to work right on my Mac.
I;ll try and find something... CGI is demanding in its own way. I will also upload a 25fps shot and a 4:3 encode... give me a few hours though since Im at work right now.
snowmoon is offline   0 Reply With Quote
Old Oct 21, 2005, 04:00 PM   #20
madmaxmedia
macrumors 68030
 
Join Date: Dec 2003
Location: Los Angeles, CA
Send a message via Yahoo to madmaxmedia
Quote:
Originally Posted by snowmoon
I;ll try and find something... CGI is demanding in its own way. I will also upload a 25fps shot and a 4:3 encode... give me a few hours though since Im at work right now.
Okay, cool! Hopefully I will be able to check out TV output with your Tron sample tonite, and will post impressions. From other posts I am almost positive that the higher-res will result in a great TV picture, but I want to confirm with my own eyes with your test material.

If you want to be extra sure of test results, you can do a 320 x 240 encode of the Tron sample for comparison. I will actually just be comparing to my downloaded episode of 'Lost'. On my PowerBook screen the difference during fullscreen playback is quite obvious, I am expecting similar results on a TV. Maybe not quite as obvious, but still noticeable difference.

Last edited by madmaxmedia; Oct 21, 2005 at 04:03 PM.
madmaxmedia is offline   0 Reply With Quote
Old Oct 21, 2005, 04:01 PM   #21
freeny
macrumors 68020
 
freeny's Avatar
 
Join Date: Sep 2005
Location: Location: Location:
Quote:
Originally Posted by Scarpad
to my knowledge two pass is only beneficial when you are using varable bit rate encoding. When specifying a bitrate it does that bitrate thruout, CBR Constant bitrate
in handbrake it only says "average bitrate" weather its sticks to that i can only assume. all i know is that i did one version with 2 pass and one without. the one with 2 pass is very noticably better.
freeny is offline   0 Reply With Quote
Old Oct 21, 2005, 04:02 PM   #22
Scarpad
macrumors 65816
 
Join Date: Jan 2005
Quote:
Originally Posted by snowmoon
I;ll try and find something... CGI is demanding in its own way. I will also upload a 25fps shot and a 4:3 encode... give me a few hours though since Im at work right now.

I'd be interested in the resolution you will be using for your 4:3 encode.
Scarpad is offline   0 Reply With Quote
Old Oct 21, 2005, 04:45 PM   #23
freeny
macrumors 68020
 
freeny's Avatar
 
Join Date: Sep 2005
Location: Location: Location:
just ripped a video using handbrake,
mp4
1100 kbps
2-pass encoding
160 Bitrate.
at 640x480

ipod refused it

what did i do wrong?
freeny is offline   0 Reply With Quote
Old Oct 21, 2005, 04:51 PM   #24
madmaxmedia
macrumors 68030
 
Join Date: Dec 2003
Location: Los Angeles, CA
Send a message via Yahoo to madmaxmedia
Quote:
Originally Posted by freeny
just ripped a video using handbrake,
mp4
1100 kbps
2-pass encoding
160 Bitrate.
at 640x480

ipod refused it

what did i do wrong?
The only thing I can think of is that 640 x 480 may be too many pixels. It can for sure play back 640 x 320, which is the same number of pixels as 480 x 480.

Also, I assume you're using MPEG-4 Video codec, right?
madmaxmedia is offline   0 Reply With Quote
Old Oct 21, 2005, 04:54 PM   #25
freeny
macrumors 68020
 
freeny's Avatar
 
Join Date: Sep 2005
Location: Location: Location:
Quote:
Originally Posted by madmaxmedia
The only thing I can think of is that 640 x 480 may be too many pixels. It can for sure play back 640 x 320, which is the same number of pixels as 480 x 480.

Also, I assume you're using MPEG-4 Video codec, right?
correct.
so it may be a pixel ratio issue?
is this something that will only apply to widescreen ratios? ie 640x272?
only 230,400 pixels allowed?

Last edited by freeny; Oct 21, 2005 at 05:00 PM.
freeny is offline   0 Reply With Quote

Reply
MacRumors Forums > iPhone, iPod and iPad > iPod

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Looking for Neil P. Harris' AR Video App (Vid inside) dadudeness iPad Apps 0 Jul 2, 2013 04:24 AM
Do you have a rMBP? Here is a 4k sample fruitycups MacBook Pro 32 Apr 26, 2013 08:01 PM
Which vid card better for video editing? joeysarks Mac Basics and Help 0 Oct 31, 2012 02:24 PM
Poetic Atmosphere ipod touch 5 sample pics TedM iPod touch 15 Oct 23, 2012 07:44 AM

Forum Jump

All times are GMT -5. The time now is 05:38 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC