Audio FFMPEG未从RTSP流中录制音频

Audio FFMPEG未从RTSP流中录制音频,audio,video,ffmpeg,rtsp,Audio,Video,Ffmpeg,Rtsp,我正在尝试以HLS格式记录rtsp流。我需要录音和录像。使用下面的命令,视频和音频会被录制成一些流,比如来自互联网的测试rtsp流。至于我的IP摄像头,它不工作,这意味着视频被录制,但输出文件中没有音频 ./ffmpeg -i rtsp://10.0.8.152:554/media/live/1/1 -acodec copy -vcodec copy -hls_list_size 65535 -hls_time 2 "./live.m3u8" 这是我的IP摄像头在使用上述命令开始录制时的命令行

我正在尝试以HLS格式记录rtsp流。我需要录音和录像。使用下面的命令,视频和音频会被录制成一些流,比如来自互联网的测试rtsp流。至于我的IP摄像头,它不工作,这意味着视频被录制,但输出文件中没有音频

./ffmpeg -i rtsp://10.0.8.152:554/media/live/1/1 -acodec copy -vcodec copy -hls_list_size 65535 -hls_time 2 "./live.m3u8"
这是我的IP摄像头在使用上述命令开始录制时的命令行输出

ffmpeg version 3.0 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: --enable-gpl --enable-libx264 --enable-libfreetype --enable-filter=drawtext --prefix=../build_Mar-20-2016
  libavutil      55. 17.103 / 55. 17.103
  libavcodec     57. 24.102 / 57. 24.102
  libavformat    57. 25.100 / 57. 25.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 31.100 /  6. 31.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Guessed Channel Layout for  Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://10.0.8.152:554/media/live/1/1':
  Metadata:
    title           : NVT
    comment         : From NVT
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (Baseline), yuvj420p(pc), 1280x720, 15 fps, 15 tbr, 90k tbn, 30 tbc
    Stream #0:1: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s
Output #0, hls, to './live.m3u8':
  Metadata:
    title           : NVT
    comment         : From NVT
    encoder         : Lavf57.25.100
    Stream #0:0: Video: h264, yuvj420p, 1280x720, q=2-31, 15 fps, 15 tbr, 90k tbn, 15 tbc
    Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, 64 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[hls @ 0x33de8c0] Non-monotonous DTS in output stream 0:0; previous: 35985, current: 6000; changing to 35986. This may result in incorrect timestamps in the output file.
[hls @ 0x33de8c0] Non-monotonous DTS in output stream 0:0; previous: 35986, current: 11998; changing to 35987. This may result in incorrect timestamps in the output file.
[hls @ 0x33de8c0] Non-monotonous DTS in output stream 0:0; previous: 35987, current: 14998; changing to 35988. This may result in incorrect timestamps in the output file.
[hls @ 0x33de8c0] Non-monotonous DTS in output stream 0:0; previous: 35988, current: 23991; changing to 35989. This may result in incorrect timestamps in the output file.
[hls @ 0x33de8c0] Non-monotonous DTS in output stream 0:0; previous: 35989, current: 29990; changing to 35990. This may result in incorrect timestamps in the output file.
[hls @ 0x33de8c0] Non-monotonous DTS in output stream 0:0; previous: 35990, current: 35987; changing to 35991. This may result in incorrect timestamps in the output file.
frame=  114 fps= 20 q=-1.0 Lsize=N/A time=00:00:07.59 bitrate=N/A speed=1.32x    
video:924kB audio:60kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Exiting normally, received signal 2.

MPEG-TS流支持有限数量的音频编解码器,PCM a-law似乎不是其中之一

AAC是可接受的,可按如下方式使用:

ffmpeg -i rtsp://10.0.8.152:554/media/live/1/1 -c:a aac -c:v copy -hls_list_size 65535 -hls_time 2 "./live.m3u8"

.ts
文件中似乎不支持A-law。请尝试
-acodec pcm_s16le
谢谢您的评论,因此我无法使用pcm_s16le编解码器以HLS格式编写视频文件,并且我可以使用acodec copy
/ffmpeg-I以avi格式编写视频rtsp://10.0.7.122:554/media/live/1/2 -acodec pcm_s16le-vcodec副本“/out.avi”
。但我的最终要求是写file.ts格式