ffmpeg - 使用 ffmpeg 从 RTSP 流录制视频和音频数据

标签 ffmpeg

我正在尝试使用 FFMPEG 录制视频数据。我使用了以下命令

ffmpeg -i 'rtsp://..' -vcodec copy -acodec copy -t 3600 -y file.mp4



我收到以下错误
Seems stream 0 codec frame rate differs from container frame rate: 180000.00

(180000/1) -> 90000.00 (180000/2)
Input #0, rtsp, from 'rtsp://10.17.8.138:554/h264.sdp?res=half&x0=0&y0=0&x1=1280&   

y1=1024&
qp=20&doublescan=0&bitrate=65535&ssn=20':
Duration: N/A, bitrate: N/A
Stream #0.0: Video: h264, yuv420p, 640x512, 90k tbr, 90k tbn, 180k tbc
Output #0, mp4, to 'file.mp4':
Stream #0.0: Video: 0x0000, yuv420p, 640x512, q=2-31, 90k tbn, 90k tbc
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
[NULL @ 0x84c16d0]error, non monotone timestamps 50 >= 50
av_interleaved_write_frame(): Error while opening file

任何机构都可以帮助我吗?

最佳答案

粘贴输出的这些部分:

Input #0, rtsp, from 'rtsp://10.17.8.138:554/h264.sdp
[...]
Output #0, mp4, to 'file.mp4':
Stream #0.0: Video: 0x0000, yuv420p, 640x512, q=2-31, 90k tbn, 90k tbc

告诉我 FFmpeg 安装不知道如何编码 H.264 视频。这可能是因为未内置 libx264 支持。运行:
ffmpeg -codecs | grep libx264

看看是否存在支持。如果没有,请使用 libx264 支持重建并重试。

关于ffmpeg - 使用 ffmpeg 从 RTSP 流录制视频和音频数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9644648/

相关文章:

ffmpeg - 将立体声文件转换为单声道但保留峰值和 RMS 响度

c++ - ffmpeg Bmp 到 yuv : Crash at sws_scale

FFMPEG:将 YUV 数据转储到 AVFrame 结构中

node.js - Fluent ffmpeg如何用户保存回调

c# - 允许用户上传 .MOV 视频文件并在网站上显示

python - 检测视频文件中的人脸

bash - 如何在 macOS 中永久使 ffmpeg 可从 bin/bash 中识别

ffmpeg - 使用 ffmpeg 修剪 mp3 时如何跳过图像错误

php - 在php中找到正确的FFmpeg路径

video - 用于移动设备的 ffmpeg 视频编码