[asterisk-users] Opening video file to play

Jerry Geis jerry.geis at gmail.com
Mon Dec 19 08:35:36 CST 2016


I am trying to play a video file.
It is failing saying

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


I am setting the video codec h263 in the call file. File exists and is
readable by all.

looking at the code and attaching with the debugger.
The last line below is where its failing. Its passing the file exists part
and seems like its checking for AST_MEDIA_TYPE_AUDIO and of course its h263
video - so its failing.

Then I do not see any case for a AST_MEDIA_TYPE_VIDEO.

What am I missing here to call a softphone and play a video file?

Thanks,

Jerry
------------
struct ast_filestream *ast_openstream_full(struct ast_channel *chan, const
char *filename, const char *preflang, int asis)
{
        /*
         * Use fileexists_core() to find a file in a compatible
         * language and format, set up a suitable translator,
         * and open the stream.
         */
        struct ast_format_cap *file_fmt_cap;
        int res;
        int buflen;
        char *buf;

        if (!asis) {
                /* do this first, otherwise we detect the wrong writeformat
*/
                ast_stopstream(chan);
                if (ast_channel_generator(chan))
                        ast_deactivate_generator(chan);
        }
        if (preflang == NULL)
                preflang = "";
        buflen = strlen(preflang) + strlen(filename) + 4;
        buf = ast_alloca(buflen);

        if (!(file_fmt_cap =
ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT))) {
                return NULL;
        }
        if (!fileexists_core(filename, NULL, preflang, buf, buflen,
file_fmt_cap) ||
                !ast_format_cap_has_type(file_fmt_cap,
AST_MEDIA_TYPE_AUDIO)) {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20161219/36a4a006/attachment.html>


More information about the asterisk-users mailing list