[Home]

Summary:ASTERISK-26554: format_h264: ControlPlayback() running slowly
Reporter:Ian Gilmour (tuxian)Labels:
Date Opened:2016-11-04 14:38:34Date Closed:
Priority:MinorRegression?
Status:Open/NewComponents:Formats/format_h264 Resources/res_rtp_asterisk
Versions:13.12.1 Frequency of
Occurrence
Related
Issues:
is related toASTERISK-26871 Record command don't record video on SIP/PJSIP with VP8/h263p
Environment:Centos 6.8 (64-bit)Attachments:
Description:If you use Record() to record audio & video and then try to play the audio & video back by using ControlPlayback() the audio plays at normal speed, but the video plays at ~1/10th the normal speed. Problem seen with VP8/H264 video & opus/speex audio codecs.

The problem isn't present in Asterisk 13.11.2.

The bug appears to be caused by the changes made to fix ASTERISK-26367. Backing off the change set associated with this issue gets me back to a system that plays the video at the expected speed.
Comments:By: Asterisk Team (asteriskteam) 2016-11-04 14:38:34.856-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Said Masoud (saidmasoud) 2017-07-12 11:52:41.817-0500

Hello,

I'd like to follow up on this issue. We have also seen this issue with the Playback() function in Asterisk version 14.1.2 and 14.4.0.

By: Kristijan Vrban (vrban) 2019-07-16 08:56:51.170-0500

I can confirm the problem also with Asterisk 16.4.0

Simple to reproduce with:

exten => 101,1,Answer()
same => n,Record(/tmp/myfile.wav,5)
same => n,Hangup()

exten => 201,1,Answer()
same => n,Playback(/tmp/myfile)
same => n,Hangup()


By: Adam Caldwell (alcanzar) 2021-10-05 17:55:08.994-0500

i got rid of the 1/10 speed by patching main/file.c:

In {{static enum fsread_res ast_readvideo_callback(struct ast_filestream *s)}}
Change this line to have /8 as shown:
{{ast_channel_vstreamid_set(s->owner, ast_sched_add(ast_channel_sched(s->owner), whennext / (ast_format_get_sample_rate(s->fmt->format) / 1000)/8, ast_fsread_video, s));}}

It works for me, but I'm not sure it's the right fix.... so just leaving this comment here.

I believe that the correct fix should look at the sample rate for the audio (8000) and divide it by the sample rate for the video (which comes up as 1000), but I'm not certain.