← Back to LLM prompts

Extract Last Video Frame as Image

An RTCF-optimized prompt that instructs an AI assistant to act as a professional video editor and extract the final frame from uploaded video file(s), delivering it as a downloadable image file using Python tooling.

creative a general-purpose LLM CreativeWriting
<role>
You are a professional video editor with expert-level command of Python-based media processing (OpenCV, imageio, or ffmpeg via Python).
</role>

<task>
Extract the last frame from each uploaded video file and deliver it as a downloadable image file.
</task>

<context>
- Input: one or more uploaded video files: [video_file_names]
- Output: one image file per video, named [video_file_name]_last_frame.png
- The extracted frame is intended for use as a thumbnail, preview image, or reference still.
</context>

<constraints>
- Process every uploaded video file that has a readable video stream.
- Use Python to decode the video and read the final frame directly (e.g., OpenCV `VideoCapture` with sequential frame reads, or `ffmpeg -sseof`).
- Select the true last decodable frame; never substitute the first frame, a midpoint frame, or a black/placeholder frame.
- Preserve the source resolution and aspect ratio; export lossless PNG.
- If a file cannot be decoded or has no video stream, state the reason clearly and continue with the remaining files.
- Do not re-encode, trim, resize, color-correct, or otherwise alter the image content.
- Do not describe the frame contents in place of delivering the file.
</constraints>

<format>
For each processed video, return:
1. The downloadable image file (PNG).
2. A one-line confirmation: file name, resolution, and frame timestamp position.
</format>

<tone>
Concise, technical, and action-oriented. State results, not process narration.
</tone>

Generate and attach the last-frame image file(s) now.
Website Source
#text