星号播放找不到视频文件

星号播放找不到视频文件

我想用 Asterisk 版本 14.7.6 播放视频文件 (h264)。它在 Raspberry Pi 上运行。

我假设播放应用程序是我的最佳选择。但是当 Asterisk 尝试访问该文件时,我收到以下错误:

[May 29 18:19:41] WARNING[1306][C-00000001]: file.c:774 ast_openstream_full: File MyVideo.h264 does not exist in any format
[May 29 18:19:41] WARNING[1306][C-00000001]: file.c:1247 ast_streamfile: Unable to open MyVideo.h264 (format (h264|ulaw)): No such file or directory
[May 29 18:19:41] WARNING[1306][C-00000001]: app_playback.c:494 playback_exec: Playback failed on SIP/7041-00000000 for MyVideo.h264

以下是我的系统上一些相关配置文件的片段:

/etc/asterisk/extensions.conf:

...
exten => 111,1,Answer()
exten => 111,n,Playback(MyVideo.h264)
exten => 111,n,Hangup()

/etc/asterisk/asterisk.conf:

[directories](!) ; remove the (!) to enable this
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astdbdir => /var/lib/asterisk
astkeydir => /var/lib/asterisk
astdatadir => /usr/share/asterisk
astagidir => /usr/share/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk
...

Asterisk CLI 中的“核心显示编解码器”:

sipserver*CLI> core show codecs
Disclaimer: this command is for informational purposes only.
        It does not indicate anything about your configuration.
      ID TYPE  NAME         FORMAT           DESCRIPTION
------------------------------------------------------------------------------------------------
      30 image png          png              (PNG Image)
       5 audio g726         g726             (G.726 RFC3551)
       3 audio alaw         alaw             (G.711 a-law)
       1 audio g723         g723             (G.723.1)
      19 audio speex        speex            (SpeeX)
      20 audio speex        speex16          (SpeeX 16khz)
      21 audio speex        speex32          (SpeeX 32khz)
      23 audio g722         g722             (G722)
      24 audio siren7       siren7           (ITU G.722.1 (Siren7, licensed from Polycom))
      31 video h261         h261             (H.261 video)
      32 video h263         h263             (H.263 video)
       7 audio adpcm        adpcm            (Dialogic ADPCM)
      41 audio silk         silk8            (SILK Codec (8 KHz))
      42 audio silk         silk12           (SILK Codec (12 KHz))
      43 audio silk         silk16           (SILK Codec (16 KHz))
      44 audio silk         silk24           (SILK Codec (24 KHz))
      27 audio g719         g719             (ITU G.719)
      33 video h263p        h263p            (H.263+ video)
      34 video h264         h264             (H.264 video)
      18 audio g729         g729             (G.729A)
       8 audio slin         slin             (16 bit Signed Linear PCM)
       9 audio slin         slin12           (16 bit Signed Linear PCM (12kHz))
      10 audio slin         slin16           (16 bit Signed Linear PCM (16kHz))
      11 audio slin         slin24           (16 bit Signed Linear PCM (24kHz))
      12 audio slin         slin32           (16 bit Signed Linear PCM (32kHz))
      13 audio slin         slin44           (16 bit Signed Linear PCM (44kHz))
      14 audio slin         slin48           (16 bit Signed Linear PCM (48kHz))
      15 audio slin         slin96           (16 bit Signed Linear PCM (96kHz))
      16 audio slin         slin192          (16 bit Signed Linear PCM (192kHz))
       2 audio ulaw         ulaw             (G.711 u-law)
      17 audio lpc10        lpc10            (LPC10)
      26 audio testlaw      testlaw          (G.711 test-law)
      40 audio none         none             (<Null> codec)
      37 video vp9          vp9              (VP9 video)
      36 video vp8          vp8              (VP8 video)
       4 audio gsm          gsm              (GSM)
      35 video mpeg4        mpeg4            (MPEG4 video)
      22 audio ilbc         ilbc             (iLBC)
      38 text  red          red              (T.140 Realtime Text with redundancy)
      39 text  t140         t140             (Passthrough T.140 Realtime Text)
      28 audio opus         opus             (Opus Codec)
      29 image jpeg         jpeg             (JPEG image)
       6 audio g726aal2     g726aal2         (G.726 AAL2)
      25 audio siren14      siren14          (ITU G.722.1 Annex C, (Siren14, licensed from Polycom))

mediainfo 扫描视频文件:

root@sipserver:~# mediainfo --fullscan MyVideo.h264
General
Count                                    : 322
Count of stream of this kind             : 1
Kind of stream                           : General
Kind of stream                           : General
Stream identifier                        : 0
Count of video streams                   : 1
Video_Format_List                        : AVC
Video_Format_WithHint_List               : AVC
Codecs Video                             : AVC
Complete name                            : MyVideo.h264
File name                                : MyVideo
File extension                           : h264
Format                                   : AVC
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format/Url                               : http://developers.videolan.org/x264.html
Format/Extensions usually used           : avc h264
Commercial name                          : AVC
Internet media type                      : video/H264
Codec                                    : AVC
Codec                                    : AVC
Codec/Info                               : Advanced Video Codec
Codec/Url                                : http://developers.videolan.org/x264.html
Codec/Extensions usually used            : avc h264
File size                                : 4976111
File size                                : 4.75 MiB
File size                                : 5 MiB
File size                                : 4.7 MiB
File size                                : 4.75 MiB
File size                                : 4.746 MiB
Overall bit rate mode                    : VBR
Overall bit rate mode                    : Variable
File last modification date              : UTC 2018-05-29 17:55:07
File last modification date (local)      : 2018-05-29 17:55:07

Video
Count                                    : 334
Count of stream of this kind             : 1
Kind of stream                           : Video
Kind of stream                           : Video
Stream identifier                        : 0
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format/Url                               : http://developers.videolan.org/x264.html
Commercial name                          : AVC
Format profile                           : [email protected]
Format settings                          : CABAC / 1 Ref Frames
Format settings, CABAC                   : Yes
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 1
Format settings, ReFrames                : 1 frame
Format settings, GOP                     : M=1, N=80
Internet media type                      : video/H264
Codec                                    : AVC
Codec                                    : AVC
Codec/Family                             : AVC
Codec/Info                               : Advanced Video Codec
Codec/Url                                : http://developers.videolan.org/x264.html
Codec profile                            : [email protected]
Codec settings                           : CABAC / 1 Ref Frames
Codec settings, CABAC                    : Yes
Codec_Settings_RefFrames                 : 1
Bit rate mode                            : VBR
Bit rate mode                            : Variable
Maximum bit rate                         : 1801984
Maximum bit rate                         : 1 802 kb/s
Width                                    : 800
Width                                    : 800 pixels
Height                                   : 480
Height                                   : 480 pixels
Sampled_Width                            : 800
Sampled_Height                           : 480
Pixel aspect ratio                       : 1.000
Display aspect ratio                     : 1.667
Display aspect ratio                     : 5:3
Resolution                               : 8
Resolution                               : 8 bits
Colorimetry                              : 4:2:0
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Chroma subsampling                       : 4:2:0
Bit depth                                : 8
Bit depth                                : 8 bits
Scan type                                : Progressive
Scan type                                : Progressive
Interlacement                            : PPF
Interlacement                            : Progressive
Buffer size                              : 2027200
Color range                              : Limited
colour_description_present               : Yes

我尝试过的:

  • 替换 Playback 参数以使用完整文件路径。例如:Playback(/root/MyVideo.h264)
  • 尝试mp4视频格式(更改编码和文件名)
  • 将视频文件放在我的“astdatadir”(/usr/share/asterisk/)中
  • 将视频文件放在我的声音目录中(/var/lib/asterisk/sounds/en/)
  • 将视频文件的权限更改为777
  • 在播放命令中省略文件扩展名。例如:Playback(MyVideo)
  • 将 Asterisk 降级至 11.16.0(从 14.7.6 降级)

我读过但没有帮助的一些文章:

答案1

您忘记了一件事:asterisk 不是视频播放器,而是 PBX。

只会播放生的由您当前用于视频的编解码器编码的文件。它不会播放其他视频格式,它会绝不尝试将视频转换为其他格式。

你有用记录应用程序在视频会话中获取原始文件。

将您获得的文件格式与您尝试播放的文件格式进行比较。

再次。视频格式或编解码器更改不是 asterisk 会尝试做的事情。使用 ffmepg 或其他库/播放器。

相关内容