get_video_info
Extract detailed video metadata including duration, frame rate, and codec from a specified file path using the FFmpeg-MCP server’s processing capabilities.
Instructions
获取视频信息,包括时长,帧率,codec等
参数:
video_path (str): 输入视频文件路径
返回:
视频详细信息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| video_path | Yes |
Implementation Reference
- src/ffmpeg_mcp/cut_video.py:155-158 (handler)The core handler function that runs ffprobe to retrieve video stream information including duration, framerate, codec etc. in JSON format.def get_video_info(video_path: str): cmd = f" -v error -show_streams -of json -i {video_path}" return ffmpeg.run_ffprobe(cmd, timeout=60)
- src/ffmpeg_mcp/server.py:82-93 (registration)Registers the 'get_video_info' tool with the MCP server using @mcp.tool() decorator. Includes input parameter description in docstring and delegates execution to cut_video.get_video_info.@mcp.tool() def get_video_info(video_path: str): """ 获取视频信息,包括时长,帧率,codec等 参数: video_path (str): 输入视频文件路径 返回: 视频详细信息 """ return cut_video.get_video_info(video_path)