Scrolling motion detection within a video stream
Scrolling motion is detected within a video stream to output an indication of a scrolling motion vector for use in encoding a current picture of the video stream. A first line of pixels within a motion region of the current picture is identified. A second line of pixels matching the first line of pixels is identified within a last played picture of the video stream. The scrolling motion vector is determined based on a comparison of lines of pixels nearby the second line of pixels within the last played picture. The indication of the scrolling motion vector is then output for use in encoding the current picture.
1 . A method, comprising:
determining that more than a predefined threshold of blocks in a current frame of a video stream are text-graphic blocks;
classifying, in response to the determining, the current frame, prior to identifying a motion region of the current frame, as a text-graphic frame;
identifying, in response to classifying the current frame as a text-graphic frame, a first line of pixels within the motion region of the current frame;
identifying a second line of pixels matching the first line of pixels within a last played frame of the video stream;
determining, in response to classifying the current frame as a text-graphic frame, a scrolling motion vector for the current frame based on a comparison of lines of pixels near the second line of pixels; and
outputting an indication of the scrolling motion vector for encoding the current frame.
2 . The method of claim 1 , comprising:
recording a vertical motion vector as the scrolling motion vector when the lines of pixels match the second line of pixels.
3 . The method of claim 1 , wherein when the lines of pixels do not match the second line of pixels, comprising:
identifying a third line of pixels within the motion region;
identifying a fourth line of pixels matching the second line of pixels within the last played frame;
determining a new scrolling motion vector based on a comparison of lines of pixels near the fourth line of pixels; and
outputting an indication of the new scrolling motion vector for use in encoding the current frame.
4 . The method of claim 1 , wherein the first line of pixels is a colorful line that includes more than a threshold times of a neighbor color change.
5 . The method of claim 1 , comprising:
selecting the first line of pixels as a baseline to avoid misdetection caused by a mono background.
6 . The method of claim 1 , wherein the first line of pixels forms a vertical line.
7 . The method of claim 1 , comprising:
detecting the motion region in response to a mouse operation on a display.
8 . The method of claim 1 , comprising:
detecting the motion region based on a comparison of the current frame and a co-located block of the last played frame.
9 . A non-transitory computer readable medium storing instructions that, when executed by a processor, cause a performance of operations comprising:
determining that more than a predefined threshold of block in a current frame of a video stream are text-graphic blocks;
classifying, in response to the determining, the current frame, prior to identifying a motion region of the current frame, as a text-graphic frame;
identifying, in response to classifying the current frame as a text-graphic frame, a first line of pixels within the motion region of the current frame;
identifying a second line of pixels matching the first line of pixels within a last played frame of the video stream;
determining, in response to classifying the current frame as a text-graphic frame, a scrolling motion vector for the current frame based on a comparison of lines of pixels near the second line of pixels; and
outputting an indication of the scrolling motion vector for use in encoding the current frame.
10 . The non-transitory computer readable medium of claim 9 , the operations comprising:
recording a vertical motion vector as the scrolling motion vector when the lines of pixels the second line of pixels match.
11 . The non-transitory computer readable medium of claim 9 , wherein when the lines of pixels do not match the second line of pixels, the operations comprising:
identifying a third line of pixels within the motion region;
identifying a fourth line of pixels matching the second line of pixels within the last played frame;
determining a new scrolling motion vector based on a comparison of lines of pixels near the fourth line of pixels; and
outputting an indication of the new scrolling motion vector for use in encoding the current frame.
12 . The non-transitory computer readable medium of claim 9 , wherein the first line of pixels is a colorful line that includes more than a threshold times of a neighbor color change.
13 . The non-transitory computer readable medium of claim 9 , the operations comprising:
selecting the first line of pixels as a baseline to avoid misdetection caused by a mono background.
14 . The non-transitory computer readable medium of claim 9 , wherein the first line of pixels forms a vertical line.
15 . The non-transitory computer readable medium of claim 9 , the operations comprising:
detecting the motion region in response to a mouse operation on a display.
16 . The non-transitory computer readable medium of claim 9 , the operations comprising:
detecting the motion region based on a comparison of the current frame and a co-located block of the last played frame.
17 . A system, comprising:
a server device including a memory and a processor configured to execute instructions stored in the memory to:
determine that more than a predefined threshold of blocks in a current frame of a video stream are text-graphic blocks;
classify, in response to the determining, the current frame, prior to identifying a motion region of the current frame, as a text-graphic frame;
identify, in response to classifying the current frame as a text-graphic frame, a first line of pixels within the motion region of the current frame;
identify a second line of pixels matching the first line of pixels within a last played frame of the video stream;
determine, in response to classifying the current frame as a text-graphic frame, a scrolling motion vector for the current frame based on a comparison of lines of pixels near the second line of pixels; and
output an indication of the scrolling motion vector for use in encoding the current frame.
18 . The system of claim 17 , wherein the processor is configured to execute the instructions to:
record a vertical motion vector as the scrolling motion vector when the lines of pixels match the second line of pixels.
19 . The system of claim 17 , wherein when the lines of pixels do not match the second line of pixels the processor is configured to execute the instructions to:
identify a third line of pixels within the motion region;
identify a fourth line of pixels matching the second line of pixels;
determine a new scrolling motion vector based on a comparison of lines of pixels near the fourth line of pixels; and
output an indication of the new scrolling motion vector for use in encoding the current frame.
20 . The system of claim 17 , wherein the first line of pixels is a colorful line that includes more than a threshold times of a neighbor color change.
21 . The system of claim 17 , wherein the first line of pixels forms a vertical line.