I am having some trouble getting the last step of the transcoding to work (sending transcoded files back to WPMU file server). I have installed the latest versions of everything (from svn and WPMU 2.8.6). I am running on two Debian machines.

I have defined the following blogs for testing:

http://mytestsite.com (blog_id = 1, main blog, server one)
http://blog1.mytestsite.com (blog_id = 2, test blog, server one)
http://video.mytestsite.com (blog_id = 3, dedicated transcoding server)

I have configured the following in video-config.php on the transcoding server:
define ( ‘MY_VIDEO_SERVER’, get_option(‘siteurl’) );
define ( ‘MY_VIDEO_STATS_SERVER’, get_option(‘siteurl’) );
define ( ‘MY_VIDEO_FILE_SERVER’, ‘http://mytestsite.com’ );
define ( ‘MY_VIDEO_TRANSCODER’, ‘http://video.mytestsite.com’ );

The call to video-finaltouch.php is correct in the error_log:

The problem comes in video-finaltouch.php processing. The call to switch_to_blog() switches okay (to blog_id = 2 in my test setup). The subsequent call to get_attached_file fails to return anything – we need the path to the original uploaded file here. The result is that the files get transferred, but with no path/name info they get stored as /wp-content/blogs_std.mp4, etc).

I have determined that the call to get_post_meta() inside get_attached_file() is failing. switch_to_blog() cleans up the cache as part of switching, and for some reason get_post_meta() fails to actually get anything (and it is trying to get _wp_attached_file for blog_id = 2, post_id = 56). The database record exists, but the cache is failing to get refreshed.

If I change the following in video-config.php on the transcoding server, everything works like a charm:
define ( ‘MY_VIDEO_FILE_SERVER’, ‘http://blog1.mytestsite.com’ );

The resulting call for finaltouch is:

The call to switch_to_blog still occurs, but WP figures out that we are not really changing blogs, so the cache is not cleared and everything works perfectly.

Am I missing something? Should I be using the main blog as the MY_VIDEO_FILE_SERVER? That seems logical. The problem appears to be deeper in post meta data caching on switch_to_blog. Has anyone else run across this issue?

Any guidance or ideas would be greatly appreciated!