<commit_before># Run with ./run-tests.sh

test_ocr_on_live_video() {
    cat > test.py <<-EOF
	import stbt
	
	stbt.frames(timeout_secs=30).next()  # wait 'til video pipeline playing
	text = stbt.ocr()
	assert text == "Hello there", "Unexpected text: %s" % text
	
	text = stbt.ocr(region=stbt.Region(x=70, y=180, width=90, height=40))
	assert text == "Hello", "Unexpected text: %s" % text
	EOF
    stbt run -v \
        --source-pipeline="videotestsrc pattern=black ! \
                textoverlay text=Hello\ there font-desc=Sans\ 48" \
        test.py
}<commit_msg>GStreamer 1.4 support: Work around GStreamer overlay bug<commit_after># Run with ./run-tests.sh

test_ocr_on_live_video() {
    cat > test.py <<-EOF
	import stbt
	
	stbt.frames(timeout_secs=30).next()  # wait 'til video pipeline playing
	text = stbt.ocr()
	assert text == "Hello there", "Unexpected text: %s" % text
	
	text = stbt.ocr(region=stbt.Region(x=70, y=180, width=90, height=40))
	assert text == "Hello", "Unexpected text: %s" % text
	EOF
    stbt run -v \
        --source-pipeline="videotestsrc pattern=black ! \
                video/x-raw,format=BGR ! \
                textoverlay text=Hello\ there font-desc=Sans\ 48" \
        test.py
}
{'fraction_non_alphanumeric': 0.14285714285714285, 'fraction_numerical': 0.022988505747126436, 'mean_word_length': 2.970684039087948, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2711060', 'n_tokens_mistral': 456, 'n_tokens_neox': 427, 'n_words': 108}