signalwire / freeswitch

FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a versatile software implementation that runs on any commodity hardware. From a Raspberry PI to a multi-core server, FreeSWITCH can unlock the telecommunications potential of any device.
https://freeswitch.com/#getting-started
Other
3.62k stars 1.43k forks source link

pause_play command not working when playing video file #886

Open mxk1011 opened 4 years ago

mxk1011 commented 4 years ago

Describe the bug When using FS in a video conference, you can use command play to play a video file in the mux. This works as expected. But it is not possible to pause the recording.

To Reproduce Steps to reproduce the behavior:

  1. conference name play {full-screen=true}https://my-file-hoster.com/file.mp4
  2. conference name pause {full-screen=true}https://my-file-hoster.com/file.mp4 This will output 2020-10-04 00:25:53.202944 [INFO] conference_api.c:3841 Pause recording file

... but the file keeps playing with audio and video. When doing the command pause_play, you will get following error:

-ERR Member: 0 not found.
pause [<member_id>]

Expected behavior The played video file should stop playing

Package version or git hash FreeSWITCH Version 1.10.5-release-17-25569c1631~64bit (-release-17-25569c1631 64bit)

Trace logs

freeswitch@75718438e67e> conference 3dd163b0-0199-11eb-86a7-39b0df2e6d68 play {full-screen=true}https://my-file-hoster.com/file.mp4
+OK (play) Playing file {full-screen=true}https://my-file-hoster.com/file.mp4

2020-10-04 00:41:17.482959 [DEBUG] avformat.c:1665 sample rate: 48000, channels: 2
2020-10-04 00:41:17.482959 [INFO] avformat.c:1121 file /var/lib/freeswitch/storage/http_file_cache/2c6aa267a46402d1066f236109541a63.mp4 is seekable
Reinit context to 1920x1088, pix_fmt: yuv420p
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/lib/freeswitch/storage/http_file_cache/2c6aa267a46402d1066f236109541a63.mp4':
  Metadata:
    major_brand     : 
isom
    minor_version   : 
512
    compatible_brands: 
isomiso2avc1mp41
    encoder         : 
Lavf58.20.100
  Duration: 
00:02:28.66
, start: 
0.000000
, bitrate: 
2604 kb/s
    Stream #0:0
(und)
: Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 2472 kb/s
, 
25 fps, 
25 tbr, 
12800 tbn, 
50 tbc
 (default)
    Metadata:
      handler_name    : 
ISO Media file produced by Google Inc.
    Stream #0:1
(eng)
: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
 (default)
    Metadata:
      handler_name    : 
ISO Media file produced by Google Inc.
2020-10-04 00:41:17.502955 [DEBUG] avformat.c:1285 Opening file in mode: I420
Reinit context to 1920x1088, pix_fmt: yuv420p
2020-10-04 00:41:17.522953 [INFO] avformat.c:2447 start: 0 ticks: 1 ticks_per_frame: 2 st num:1 st den:12800 codec num:1 codec den:50 start: 0, duration:1901568 nb_frames:3714 q2d:0.000078
2020-10-04 00:41:17.522953 [DEBUG] avformat.c:2478 set start time: 1601772077537990 now: 1601772077537990 pts: 0
freeswitch@75718438e67e> conference 3dd163b0-0199-11eb-86a7-39b0df2e6d68 pause file.mp4
+OK Pause recording file file.mp4
-ERR non-existant recording 'file.mp4'

2020-10-04 00:41:34.722967 [INFO] conference_api.c:3841 Pause recording file file.mp4
2020-10-04 00:41:43.362974 [DEBUG] switch_core_media.c:3226 [VBR]: Correcting calculated ptime value from [180] to [20] to compensate for [8] lost packet(s)
freeswitch@75718438e67e> conference 3dd163b0-0199-11eb-86a7-39b0df2e6d68 pause https://my-file-hoster.com/file.mp4
+OK Pause recording file https://my-file-hoster.com/file.mp4
-ERR non-existant recording 'https://my-file-hoster.com/file.mp4'

2020-10-04 00:41:59.122967 [INFO] conference_api.c:3841 Pause recording file https://my-file-hoster.com/file.mp4
freeswitch@75718438e67e> conference 3dd163b0-0199-11eb-86a7-39b0df2e6d68 pause_play https://my-file-hoster.com/file.mp4
-ERR Member: 0 not found.
pause [<member_id>]
mxk1011 commented 4 years ago

As FS is downloading the HTTP file to temp storage, I tried this file path as well, but with the same result, that the video keeps playing:

freeswitch@75718438e67e> conference 3dd163b0-0199-11eb-86a7-39b0df2e6d68 pause /var/lib/freeswitch/storage/http_file_cache/2c6aa267a46402d1066f236109541a63.mp4
+OK Pause recording file /var/lib/freeswitch/storage/http_file_cache/2c6aa267a46402d1066f236109541a63.mp4
-ERR non-existant recording '/var/lib/freeswitch/storage/http_file_cache/2c6aa267a46402d1066f236109541a63.mp4'

2020-10-04 00:45:12.222985 [INFO] conference_api.c:3841 Pause recording file /var/lib/freeswitch/storage/http_file_cache/2c6aa267a46402d1066f236109541a63.mp4
mxk1011 commented 4 years ago
freeswitch@75718438e67e> conference 3dd163b0-0199-11eb-86a7-39b0df2e6d68 pause_play
+OK Pause

By doing this, the AUDIO of the currently playing file will stop, the video will continue

anthmFS commented 4 years ago

pause_play pause is for recordings

mxk1011 commented 4 years ago

@anthmFS not as per documentation here https://freeswitch.org/confluence/display/FREESWITCH/mod_conference Pause playback of file to a conference

image

Is there then another command to pause a playing file? As I see there is only a command to completely stop the playback (stop)

EDIT You are right, pause is unnecessary to use here as not for playback at all