templates – using add_filter in a template_redirect function?

I have certain pages that I would like to filter, replacing some tags, with a value. Rather than attempting to filter every page, I only want some pages, but to make it use even less resources (not even have it call a filter and copy the contents to a variable) the idea is to use template_direct to only set a the_content filter on certain pages. Is that okay or will it cause issues.

For example:

function my_template_redirect() {
  if (is_page(array(4, 6, 12))) {
    add_filter('the_content', 'my_page_filter4612');
  else if (is_page(array(5,17))) {
    add_filter('the_content', 'my_page_filter517');
add_action('template_redirect', 'my_template_redirect');