Scan the line of Keats's "Ode on a Grecian Urn" from "When old age" to "ye need to know."
O Attic shape! Fair attitude! with brede
Of marble men and maidens overwrought,
With forest branches and the trodden weed;
Thou, silent form, dost tease us out of thought
As doth eternity. Cold Pastoral!
When old age shall this generation waste,
Thou shalt remain, in midst of other woe
Than ours, a friend to man, to whom thou say'st,
"Beauty is truth, truth beauty"---that is all
Ye know on earth, and all ye need to know. ~Keats
Scansion of poetic verses can sometimes be difficult because poets may employ variation of the meter, elision of syllables, or addition of a pause to create the meter. Syllable counting is useful for very simplistic verse that doesn't employ variation, elision, or pause, but it can--and often does--lead astray on scansion of complex verse. In the lines you are asking about, Keats attempts an artistic variation of the meter of the poem by altering the opening foot of one verse; his attempt is made with more or less success depending upon the opinion of the critic scanning the poem.
The preceding lines are in a steady iambic pentameter, which is five feet of a classic English rhythm da BA / da BA / da BA / da BA / da BA [the apostrophe' indicates stress for BA']:
O At' / -tic shape!' / Fair at' / -ti -tude!' / with brede'
Of mar' / -ble men' / and mai' / -dens o' / -ver -wrought,'
With for' / -est bran' / -ches and' / the trod' / -den weed';
Thou, si' / -lent form,' / dost tease' / us out' / of thought'
As doth' / e -ter' / -ni -ty.' / Cold Pas' / -tor -al!'
The last lines, from "When old age" through to "need to know," continue the same meter of five feet of iambs, but Keats varies the meter for "Beauty." On this opening foot, Keats uses trochaic rhythm, which is described as DA ba, with the stress on the first instead of second beat of a foot. With this variation, the scansion is as follows:
When old' / age shall' / this gen' / -er -a' / -tion waste',
Thou shalt' / re -main', / in midst' / of o' / -ther woe'
Than ours', / a friend' / to man,' / to whom' / thou sayst,'
"BEAU' -ty / is truth', / truth beau' / -ty"---that' / is all'
Ye know' / on earth,' / and all' / ye need' / to know.'
There is some debate on how the first two feet of "When old age shall ..." should be scanned. In British English, the verb "shall" would take sentence stress, and the introductory "when" of an adverbial clause would rarely take sentence stress, while the adjective "old" modifying "age" would take sentence stress: “When old' age shall'.” Therefore, there is little reason to suppose the scansion for those words would be anything other than iambic, which would render the line as iambic pentameter:
When old' / age shall' / this gen' / -er -a' / -tion waste', ...
Scansion is the formal term for marking the meter of a poem, which is the pattern of stressed and unstressed syllables in each line. A stressed syllable may sound “longer” than an unstressed syllable, so to scan a poem, you listen to how each syllable of each word sounds.
One way to tell whether a syllable is stressed or unstressed is to place your hand under your chin as you say the word aloud. When your jaw moves down, that syllable is a stressed syllable—it takes longer to say. Each group of two syllables (regardless of where the words themselves are) is called a foot, and there are many different types of feet. The most common is the iamb, in which the first syllable is unstressed, and the second is stressed.
The stresses in language help us understand the connotation, or meaning, of the words themselves. For example, think about the phrase, “Oh, sure,” which could also represent one metrical foot. If you stress the second word more than the first word, you sound sarcastic. But if you stress both words equally when you speak this phrase aloud, you sound like you’re in total agreement. This kind of double stressed foot is called a spondee.
Poets craft these rhythms to contribute to the overall meaning of the poems. John Keats’ “Ode on a Grecian Urn” describes the scenes depicted on an ancient urn, and much of the poem is a meditation on the nature of art, which is to say, the nature of trying to capture life through a lifeless object, which is a paradox. Keats explores many philosophical ideas in this poem, which he asserts in the final stanza.
The first five lines of this last stanza are mostly iambic pentameter, which is a meter in which each line has ten syllables, and the 2nd, 4th, 6th, 8th, and 10th syllables are stressed. However, in Keats’ poem, this pattern changes with the sixth line. If you say the lines aloud, they sound like this, with the stressed syllables in all capitals:
When OLD AGE SHALL this GENerAtion WASTE,
Thou SHALT reMAIN, in MIDST of OTHer WOE
Than OURS, a FRIEND to MAN, to WHOM thou SAY’ST,
“BEAUty is TRUTH, TRUTH BEAUty”—THAT is ALL
Ye KNOW on EARTH, and ALL ye NEED to KNOW.
Notice the three stressed syllables of “old age shall” and then again with “truth, truth beauty” in the ninth line, though the rest of the stanza keeps a strict iambic pentameter. By inserting spondees into his final stanza (“age shall” and “truth beauty”) Keats draws our attention to these “super-stressed” ideas, though the ultimate meaning behind these last lines has been debated.