Patent attributes
A client device accesses a video input stream from an intermediate device for display. The client device analyzes the video input stream to determine that the video input stream matches a template indicating a portion of the video input stream that is created by the intermediate device. Based on the video input stream matching the template, a video output stream generated by the client device is modified to include the portion of the video input stream generated by the intermediate device. For example, commercials transmitted from a national content provider to a smart TV via a set-top box may be replaced with targeted commercials. During the replacement, informational messages or menus generated by the set-top box may be detected and the replacement video altered by the smart TV to include the messages or menus generated by the set-top box.