Publish recorded streams

Corrado Steri

New Member
I have all my streams with the correct epoch time in my record folder, on the same machine i have an apache server where the stream is published live, how can i publish on same page on a side all the recorded files for that stream? Is there a way to publish all the recorded files with correct tme and not epoch?
 

Max

Administrator
Staff member
Good day.
Please clarify your case:
1. What WCS build do you use?
2. How do you publish streams to server: WebRTC from browser, RTMP from OBS/XSplit/ffmpeg, anything else?
3. Do you have any problems with recording time stamps?
4. Do you want to play recording files from server?
 

Corrado Steri

New Member
1 - 5.2.346
2 - RTSP webcam to server and webrtc from server to browser
3 - No problems, i get them in epoch, would be nice to have them in local time
4 - No can be played from browser, just need to publish the available files
 

Max

Administrator
Staff member
To publish the recording files, you can use VOD capturing. Please note that recordings are placed to /usr/local/FlashphonerWebCallServer/records folder, and files to be capured as VOD should be placed to /usr/local/FlashphonerWebCallServer/media folder. So you should copy the files needed by post-recording script.
 

Corrado Steri

New Member
I do not understand how the script can move the files knowing the names, i have been on it all day yestarday but did not understand it.
 

Max

Administrator
Staff member
You can merge these two folders
1. Move all files from record to media
2. Remove the record folder
3. Add symlink
Code:
ln -sf /usr/local/FlashphonerWebCallServer/media  /usr/local/FlashphonerWebCallServer/record
Or, you can use a script like this
Bash:
# Get the stream name
STREAM_NAME=$1
# Get the recording file full path
SRC_PATH=$2
# Declare destination path
DST_PATH=/usr/local/FlashphonerWebCallServer/media
# Extract recording file name
FILE_NAME=$(basename $SRC_PATH)
# Move recording file to the new location
mv $SRC_PATH $DST_PATH/$FILE_NAME
 
Last edited:

Corrado Steri

New Member
I do not have a media directory in /usr/local/FlashphonerWebCallServer
Actually all my server files are in FlashphonerWebCallServer-5.2.576-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx directory, is it normal? I changed the code with all xxxxx

Corrado
 

Max

Administrator
Staff member
If you installed server properly, it should have two folders. One is symlink.

Example:
Code:
ls -la /usr/local | grep Flash
lrwxrwxrwx   1 root root   84 Apr  8 17:42 FlashphonerWebCallServer -> /usr/local/FlashphonerWebCallServer-5.2.570-be20ed565889000662d1bdab5eae46392c0d68af
drwxr-xr-x  12 root root  131 Apr  8 17:42 FlashphonerWebCallServer-5.2.570-be20ed565889000662d1bdab5eae46392c0d68af
So if you don't have this folder, you can create it manually.

Example:
Code:
ln -sf /usr/local/FlashphonerWebCallServer-5.2.570-be20ed565889000662d1bdab5eae46392c0d68af /usr/local/FlashphonerWebCallServer
 

Corrado Steri

New Member
I have /usr/local/FlashphonerWebCallServer, it is a symlink, so all ok here, but i don't have media inside it, nor inside FlashphonerWebCallServer-5.2.576-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 

Max

Administrator
Staff member
E.g., using the code from the Embed Player example in an HTML page.
For example,
Code:
<iframe id='fp_embed_player' src='https://WCS:8888/embed_player?urlServer=wss://WCS:8443&streamName=vod://record1.mp4&mediaProviders=WebRTC,Flash,MSE,WSPlayer' marginwidth='0' marginheight='0' frameborder='0' width='20%' height='20%' scrolling='no' allowfullscreen='allowfullscreen'></iframe>
<iframe id='fp_embed_player' src='https://WCS:8888/embed_player?urlServer=wss://WCS:8443&streamName=vod://record2.mp4&mediaProviders=WebRTC,Flash,MSE,WSPlayer' marginwidth='0' marginheight='0' frameborder='0' width='20%' height='20%' scrolling='no' allowfullscreen='allowfullscreen'></iframe>
 

Corrado Steri

New Member
Thanks, what i don't get but it is me i guess is how i can have a list of the media folder showing just file names (dates) on a webpage that one can click on and watch the video from that date. i mean populate the list authomatically by the content of the media folder files and show them on a page and be clickable, after the click the player opens and plays the video.
 

Max

Administrator
Staff member
i mean populate the list authomatically by the content of the media folder files and show them on a page and be clickable, after the click the player opens and plays the video.
The question is slightly beyond the sope of this forum.
Please try to use third side webserver (Apache, nginx etc) with PHP module. The media folder content can be listed to array with the following PHP call
PHP:
$files = array_diff(scandir($path), array('.', '..'));
Then you can form the webpage with list of files with links or buttons. JavaScript code can be used to form the iframe tag to play the selected file on button click.
Please use external resources to know more about PHP and JavaScript usage.
 
Top