Мне приходилось записывать видео с IP-камеры (Sony SRG 300SE) в спешке. Я сделал это, запустивDemux H264 из (уже записанный) необработанный поток RTSP на жестком диске
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" ! ...
, что приводит к "Нет действительного URL RTSP был предоставлен" (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
Есть ли способ получить по крайней мере видео из этот поток?
Update: 4. cat recording.raw | ffmpeg -i - -c:v copy -c:a copy recording.mp4
приводит к pipe:: Invalid data found when processing input
в FFmpeg 3.2.2, и следующее в старой сборки:
[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 - это тишина (хотя это могло бы быть и так).
Спасибо заранее, Pascal
Попробуйте 'ffmpeg -f rtsp -i файл: //recording.raw -c: v copy -c: копировать запись. mp4' или 'cat recording.raw | ffmpeg -i - -c: v copy -c: копия record.mp4' – Mulvya
Спасибо. Первый не работает вообще: FFMPEG завершает работу с файлом: /// [путь] /recording.raw: соединение отклонено Последний дает мне файл, содержащий только поток AAC, без видео. Если я опустил опцию '-an', я получаю' Выходной файл # 0 не содержит никакого потока ', как если бы во входном файле не было потока H264. –
@aergistal, возможно, у вас есть идея. – Mulvya