【发布时间】:2017-05-19 03:21:25
【问题描述】:
我曾经不得不匆忙从 IP 摄像机 (Sony SRG 300SE) 录制视频。我通过启动来做到这一点
gst-launch-1.0 rtspsrc location="rtsp://192.168.0.100/video1" ! filesink location="recording.raw"
完美运行。 现在,我想从该文件中解复用音频和视频(aac 和 h264)。我现在知道在接收流时这样做会更聪明,但是我没有。
我已经试过了
-
gst-launch-1.0 rtspsrc location="recording.raw" ! ...,导致“未提供有效的 RTSP URL”(GStreamer 1.10.2); -
ffmpeg -i recording.raw -c:v copy -c:a copy recording.mp4,只会导致“处理输入时发现无效数据”(ffmpeg 3.2.2) -
gst-launch-1.0 filesrc location="recording.raw" ! application/x-rtp ! rtph264depay ! h264parse ! matroskamux ! filesink location=out.mkv,导致WARNING: from element /GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0: Could not decode stream. Additional debug info: gstrtpbasedepayload.c(503): gst_rtp_base_depayload_handle_buffer (): /GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0: Received invalid RTP payload, dropping
有什么方法可以让我至少从该流中获取视频吗?
更新:
4. cat recording.raw | ffmpeg -i - -c:v copy -c:a copy recording.mp4 在 ffmpeg 3.2.2 中导致 pipe:: Invalid data found when processing input,在旧版本中导致以下内容:
[aac @ 0x2d4b3a0] Format aac detected only with low score of 1, misdetection possible!
[aac @ 0x2d4c180] More than one AAC RDB per ADTS frame is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x2d4c180] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x2d4c180] Reserved bit set.
[aac @ 0x2d4c180] Prediction is not allowed in AAC-LC.
[aac @ 0x2d4c180] channel element 3.10 is not allocated
[aac @ 0x2d4c180] Assuming an incorrectly encoded 7.1 channel layout instead of a spec-compliant 7.1(wide) layout, use -strict 1 to decode according to the specification instead.
[aac @ 0x2d4c180] channel element 1.6 is not allocated
[aac @ 0x2d4c180] channel element 2.5 is not allocated
[aac @ 0x2d4c180] channel element 2.8 is not allocated
[aac @ 0x2d4c180] channel element 2.12 is not allocated
[aac @ 0x2d4c180] channel element 3.2 is not allocated
[aac @ 0x2d4c180] channel element 2.10 is not allocated
[aac @ 0x2d4c180] Reserved bit set.
[aac @ 0x2d4c180] Prediction is not allowed in AAC-LC.
[aac @ 0x2d4c180] Reserved bit set.
[aac @ 0x2d4c180] TNS filter order 15 is greater than maximum 12.
[aac @ 0x2d4c180] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x2d4c180] Inconsistent channel configuration.
[aac @ 0x2d4c180] get_buffer() failed
[aac @ 0x2d4c180] Reserved bit set.
[aac @ 0x2d4c180] Prediction is not allowed in AAC-LC.
[aac @ 0x2d4c180] channel element 1.5 is not allocated
[aac @ 0x2d4c180] Reserved bit set.
[aac @ 0x2d4c180] Pulse tool not allowed in eight short sequence.
[aac @ 0x2d4c180] Number of bands (30) exceeds limit (21).
[aac @ 0x2d4c180] Number of bands (16) exceeds limit (14).
[aac @ 0x2d4c180] Assuming an incorrectly encoded 7.1 channel layout instead of a spec-compliant 7.1(wide) layout, use -strict 1 to decode according to the specification instead.
[aac @ 0x2d4c180] Sample rate index in program config element does not match the sample rate index configured by the container.
...因此创建了一个仅 AAC 文件。据我所知,AAC 是沉默的(虽然可能是这种情况)。
提前致谢, 帕斯卡
【问题讨论】:
-
试试
ffmpeg -f rtsp -i file://recording.raw -c:v copy -c:a copy recording.mp4或cat recording.raw | ffmpeg -i - -c:v copy -c:a copy recording.mp4 -
谢谢。第一个根本不起作用:FFMPEG以
file:///[path]/recording.raw: Connection refused退出,后者给了我一个只包含AAC流的文件,没有视频。如果我删除-an选项,我会得到Output file #0 does not contain any stream,就好像输入文件中没有H264 流一样。 -
@aergistal 也许你有一些想法。
-
ffmpeg 在第二个命令中将输入格式识别为什么?显示控制台输出。
-
我编辑了我的帖子,向您展示发生了什么。
标签: video ffmpeg gstreamer h.264 rtsp