the_content
filter is as good as other filters are. The issue is that it is supposed to be run inside a loop with the glogal $post
correctly set to current post in the loop. So, you could do something like this (not tested, just written here as example):
$content_before_category = get_theme_mod( 'content_before_category', false );
if ( $content_before_category ) {
global $post;
// get_page() is deprecated; use get_post() instead
// $page_id = get_page( $content_before_category );
$post = get_post( $content_before_category );
// Setup global post data with our page
setup_postdata( $post );
// Output the content
the_content();
// Reset global post data
wp_reset_postdata();
}
If you prefer to run your custom filters, you can. The problem you have with embedded content is that you have not run the auto embbed filter; just add it:
global $wp_embed;
add_filter( 'mytheme_content_filter', array( $wp_embed, 'autoembed') );