推流时使用了如下命令
ffmpeg -re -i "/home/z/sample-mp4-file.mp4" -vcodec h264 -acodec aac -f rtsp -rtsp_t
出现
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2523520] Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible!
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2523520] moov atom not found sample-mp4-file.mp4: Invalid data found when processing input
- 可能是因为没有文件,或者文件损坏不完整,检查视频在外部能否正常播放
执行以下命令时
ffmpeg -re -i "/home/z/sample-mp4-file.mp4" -vcodec h264 -acodec aac -f rtsp -rtsp_transport tcp rtsp://127.0.0.1/live/test
出现
[aac @ 0x778f80] The encoder ‘aac’ is experimental but experimental codecs are not enabled, add ‘-strict -2’ if you want to use it.
- 在输出的路径前加上
-strict -2
,例如我上面的命令,最终要输出到 rtsp://127.0.0.1/live/test 里,那么我在这个路径前面加上-strict -2
:
ffmpeg -re -i "/home/z/sample-mp4-file.mp4" -vcodec h264 -acodec aac -f rtsp -rtsp_transport tcp -strict -2 rtsp://127.0.0.1/live/test
> 参考:[“编码器”aac“是实验性的,但实验编解码器未被启用”](https://www.it1352.com/751570.html)