The app_mp4 application provides playback and recording of MP4/3GP files. It implements the following funtions:
mp4_save
Records the call into an mp4 file.
mp4save(filename,[options])
Description
The application saves the call audio and video and hit information into the mp4/3gpp file specified.
Note: If you are working with amr it's recommended that you use 3gp as your file extension if you want to play it with a video player.
Available options:
'v': activate loopback of video
'V': wait for first video I frame to start recording
'0'..'9','#','*': sets dtmf input to stop recording
Note: waiting for video I frame also activate video loopback mode.
Examples:
; record video to selected file exten => ._,1,mp4save(/tmp/save.3gp) ; record video and stop on '#' dtmf exten => ._,1,mp4save(/tmp/save.3gp,#) ; activate loopback of video exten => ._,1,mp4save(/tmp/save.3gp,v) ; wait for first videoto start recording exten => ._,1,mp4save(/tmp/save.3gp,V) ; wait for first videoto start recording ; and stop on '9' dtmf exten => ._,1,mp4save(/tmp/save.3gp,V9)
mp4_play
MP4/3GPP file playblack
mp4play(filename,[options])
Description
Plays the audio and video from an 3GPP/MP4 file.
Note: The file MUST be hinted.
Available options:
'n(x)': number of digits (x) to wait for
'S(x)': set variable of name x (with DTMFs) rather than go to extension
's(x)': set digits, which should stop playback
Examples:
; play video file to user exten => ._,1,mp4play(/tmp/video.mp4) ; play video file to user and wait for 3 digits exten => ._,1,mp4play(/tmp/test.mp4,'n(3)') ; play video file to user and wait for 3 digits and ; set them as value of variable DTMF_INPUT exten => ._,mp4play(/tmp/test.mp4,'n(3)S(DTMF_INPUT)') ; play video file, wait for 3digits or break on '#' exten => ._,1,mp4play(/tmp/test.mp4,'n(3)s(#)')