Two versions of the same shot can look equally good at first. The difference might be in the last few frames, where the subject moves too close to the edge or a background detail changes. This Streamlit exercise gives you a small review surface for spotting that difference. Put the clips side by side, compare three positions, then watch the version you plan to keep.
Decide what you want to compare
Imagine an orange paper pinwheel on a small stage. The prompt asks the wheel to turn while a blue cube stays still. Your review question is whether the full wheel remains visible. The angle of the blades can change freely. The distance between the wheel and the edge of the picture is what you check. In the illustration, the cube helps you distinguish a shift in the subject from a shift affecting the whole scene.
In this illustration, the blue cube gives you a reference when judging the pinwheel’s distance from the edge.
Use two short MP4 files you can work with. For a fresh test you can make two candidates with the AI VideoWeb free AI video generator. Its free form lists five seconds at 480p and accepts text or a complete opening and closing frame pair in order. It asks for verification and may queue the request. Download the clips before opening the local review app. If you already have two files, you can start with those.
Keep the brief beside the clips. When testing a prompt revision, note the one instruction you changed. A result can vary for other reasons, so two clips give you a decision about these two files. To make a broader claim, repeat the comparison and record the inputs.
Read three positions within each clip
Start with a virtual environment in a folder where you can run Python. Install the dependencies and save the code as clip_review.py. It accepts MP4s up to 25 MB and a reported frame count of at most 360. Those limits keep the example focused on short clips.
python -m pip install "streamlit>=1.62,<2" "opencv-python-headless>=4.10,<5"
streamlit run clip_review.py
from pathlib import Path
from tempfile import TemporaryDirectory
import math
import cv2
import streamlit as st
MAX_BYTES = 25 * 1024**2
MAX_FRAMES = 360
def sample_clip(data):
if not data or len(data) > MAX_BYTES:
raise ValueError("Choose a nonempty MP4 no larger than 25 MB.")
with TemporaryDirectory() as folder:
path = Path(folder) / "clip.mp4"
path.write_bytes(data)
capture = cv2.VideoCapture(str(path))
try:
if not capture.isOpened():
raise ValueError("This MP4 could not be opened.")
reported = capture.get(cv2.CAP_PROP_FRAME_COUNT)
if not math.isfinite(reported) or not 1 <= reported <= MAX_FRAMES:
raise ValueError("Choose a short clip with a known frame count up to 360.")
count = int(reported)
samples = [("Opening", 0), ("Middle", (count - 1) // 2), ("Last", count - 1)]
requested = {index for _, index in samples}
frames = {}
for index in range(count):
ok, frame = capture.read()
if not ok:
break
if index in requested:
frames[index] = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
if frames.keys() != requested:
raise ValueError("The decoder did not reach every requested frame.")
return [(label, index, frames[index]) for label, index in samples]
finally:
capture.release()
def main():
st.title("Two-clip frame review")
st.caption("Compare positions within each clip. Frame numbers start at zero.")
for col, label in zip(st.columns(2), ("Version A", "Version B")):
with col:
clip = st.file_uploader(label, type=["mp4"], key=label, max_upload_size=25)
if clip is None:
continue
try:
for name, index, frame in sample_clip(clip.getvalue()):
st.image(frame, caption=f"{name} · frame {index}", width="stretch")
except (ValueError, cv2.error) as error:
st.error(str(error))
if __name__ == "__main__":
main()
The code reads forward to the three requested indexes. It converts OpenCV’s color order to RGB for display. Each upload gets a separate temporary file that goes away after decoding. If the decoder stops early, the app reports an error and asks you to try a shorter or more widely supported file. Streamlit file uploader reference · OpenCV VideoCapture reference
Compare equivalent positions within the two clips. A change in the blade angle is expected, while a change in framing deserves a closer look.
The middle in this app is a position in the reported frame count. With different frame rates or durations, the labels describe relative progress, so they are useful for comparing the opening, midpoint and ending of each version. For a timing decision in seconds, use timestamps in your editor. Local checks with two synthetic five-second MP4s sampled frames 0, 14 and 29 from one file and 0, 29 and 59 from the other. Those files test the sampling code.
Turn the comparison into one edit decision
Look at the opening pair first. Do the subject and the reference object both appear? Then check the middle and last pairs. If Version B loses the tip of a blade at the edge while A keeps the whole wheel visible, you have a specific reason to replay A. If both lose the subject, revisit the prompt and ask for more space around the full pinwheel. The source illustrations show how to make that judgment.
Use the stills to decide which part of the moving sequence to replay.
Play the chosen clip from start to finish once at the intended speed. Look for a brief jump, a flicker or an unwanted camera movement between the sampled frames. Note what happened and where. A useful review note points to a specific change, such as “the right blade leaves the frame near the end.” That tells the next person what to fix.
Disclosure: This article was prepared by the AI VideoWeb team at FLAQ TECH PTE. LTD., with AI assistance for writing and illustrations.


