I Think This Is A Bug (video Call File) 11.25.1 And 13.13.1

Home » Asterisk Users » I Think This Is A Bug (video Call File) 11.25.1 And 13.13.1
Asterisk Users 4 Comments

I can create an audio call file and specify Application: Playback and Data: a path to the audio file, it calls the phone and plays the audio message just fine.

I am trying to do the same with a video file. I specify Application:
Playback and Data: the path to the video file (no ending of course), and I do specify also the Codecs: h264,h263 etc…

Asterisk reports:

*File /tmp/video does not exist in any format
*>* Unable to open /tmp/video (format ulaw|h263|h264)*

Looking then at the code and attaching with the debugger. the ast_openstream_full() function has this condition:

if (!fileexists_core(filename, NULL, preflang, buf, buflen, file_fmt_cap) || !ast_format_cap_has_type(file_fmt_cap, AST_MEDIA_TYPE_AUDIO)) {

}

So fileexists_core() returns 1 but the next call to ast_format_cap_has_type() fails. because its looking for AST_MEDIA_TYPE_AUDIO and the file is a video file. Nowhere is the an AST_MEDIA_TYPE_VIDEO.

I can use the call file to setup a video call between two video softphones just fine. However using the call file to call a phone and play a video is not working at all for me.

Am I on the right track?

Is this supposed to work? if so how since there is no check of the AST_MEDIA_TYPE_VIDEO?

Thanks,

Jerry

4 thoughts on - I Think This Is A Bug (video Call File) 11.25.1 And 13.13.1

  • Hi Jerry,

    I just had a look through the code, and from what I can tell, what you’re trying to do is not supposed to work, exactly. It appears that what Asterisk expects is to be given a filename, such as “myplayback”. Asterisk will first search for an audio version of the file (like myplayback.gsm or myplayback.opus), and open that as an audio stream. If that succeeds, it then will also see if there is an accompanying video stream (such as myplayback.h264). If it then finds that video, then the result will be that Asterisk will play the audio from the audio file and the video from the video file.

    What this means is that Asterisk does not properly handle:
    * Files that have audio and video streams contained within
    * Video files without accompanying audio

    This is one of those times where Asterisk’s handling of video is not user-friendly and in general ass-backwards and terrible. If you have a tool that can extract the audio to its own file, then you would be able to run your scenario, presumably.

    It would be a welcome addition for Asterisk to be able to open a single file containing video and accompanying audio and be able to play those back.

    Mark Michelson

  • Hi Mark,

    Thanks for your reply… I just tried what you suggested on only got audio. I created a wav file and put it in the /tmp directory just like the video.h264 file. So /tmp has video.h264 and video.wav both. I then placed the call and only heard the audio from the wav file.

    I used this for my call file:
    Channel: SIP/2002
    Context: testing Extension: 999999
    Priority: 1
    Application: Playback Codecs: h263,h264,vp8,g722,ulaw,alaw,wav Data: /tmp/video

    My Bria 4 softphone uses the h263 and h264 codecs and of course wav file audio. Based on your look of the code did I miss something to trigger the playing of the video file?
    I can extract the audio out to a seperate file – so not a show stopper for me.

    No errors showed up on the Asterisk CLI when I did my test.

    Thanks so much,

    Jerry

  • I don’t see anything obvious in the code that would have prevented the video from playing back. Unfortunately, the debug from Asterisk isn’t going to be especially helpful here, with one exception. If you have core debug at level 1 or higher, then when Asterisk detects the video file, it will say:

    “Ooh, found a video stream, too, format h264”

    If you see that message, that at least means that Asterisk is finding the video file as expected. If you don’t see that, then it’s likely that Asterisk is unaware of the h264 file format type. It may be that you don’t have the format_h264.so module loaded. It may be that there was an error that occurred when that module was loading, causing it not to be able to load properly.

    If you are seeing that debug message, it at least means that Asterisk attempted to play back the video file, but something else in the process caused the video not to play back as expected. The first thing you could check is packet captures to see if Asterisk is even attempting to send video to the softphone. If so, then it’s likely that there is some sort of codec mismatch happening (likely something in the format parameters). If Asterisk is not even attempting to send any video, then it likely means that there is some other issue. It may be a bug, or it may be some erroneous condition in the environment. Hard to tell yet though.

    Mark Michelson

  • Hi Jerry,

    You don’t say how you created the video file?

    Asterisk video support is v. basic. It can only playback video it created using it’s own specific file format for the video file. In general you cannot use it to playback videos created by 3rd party tools.

    What does work (if you have asterisk configured correctly)….

    Invoke Asterisk Record() from a video capable sip client (e.g. linphone/jitsi should work fine here) and which is configured to support audio&video. Make a call. Asterisk will create the audio file and an accompanying video file (e.g. .h264) in the same directory. Now invoke Asterisk Playback() to play the files back. If the SIP client and Asterisk negotiate the same video codec that was used to record the initial call then Asterisk will play back both audio+video streams.

    Note: Asterisk does no video transcoding.

    Note: If video plays back at the wrong speed it’s possibly a result of https://issues.asterisk.org/jira/browse/ASTERISK-26554.

    Regards,

    Ian Hi Mark,

    Thanks for your reply… I just tried what you suggested on only got audio. I created a wav file and put it in the /tmp directory just like the video.h264 file. So /tmp has video.h264 and video.wav both. I then placed the call and only heard the audio from the wav file.

    I used this for my call file:
    Channel: SIP/2002
    Context: testing Extension: 999999
    Priority: 1
    Application: Playback Codecs: h263,h264,vp8,g722,ulaw,alaw,wav Data: /tmp/video

    My Bria 4 softphone uses the h263 and h264 codecs and of course wav file audio. Based on your look of the code did I miss something to trigger the playing of the video file?
    I can extract the audio out to a seperate file – so not a show stopper for me.

    No errors showed up on the Asterisk CLI when I did my test.

    Thanks so much,

    Jerry