The transcoding tool includes the
ffmpeg modules. The Python script can merge the separated audio and video recorded files into one MPEG-4 file and the script relies on the
ffmpeg transcoding tool.
You can get
video_convert.py in the tools folder in On-premise Recording SDK. Decompress
ffmpeg, and make sure it is in the same directory as
video_convert.py with the following usage:
Usage: video_convert.py [options] Options: -h, --help -f FOLDER, --folder=FOLDER Convert folder -m MODE, --mode=MODE Convert merge mode, [0: txt merge A/V(Default); 1: uid merge A/V; 2: uid merge audio; 3: uid merge video] -p PFS, --fps=FPS Convert fps, default 15 -s --saving Convert Do not time sync -r RESOLUTION, --resolution=RESOLUTION Specific resolution to convert '-r width height' Eg: '-r 640 360'
||The directory of the file to be transcoded.|
||The transcoding mode:
||The parameter for setting the frame rate in both composite and individual recording. 15 fps is the default value.|
||The saving mode that indicates if the transcoding should be strictly synchronized with time; in other words, if the time interval when the user is not in the channel is in the recorded file. Make sure that you use this parameter together with -m = 1, 2 or 3. The default value indicates “always recording”.|
||The parameter for setting the resolution of transcoding in the “width height” format.|
UID_HHMMSSMS_av.mp4. To merge the audio and video files by the session:
UIDHHMMSSMSav.mp4file is generated.
UIDHHMMSSMSav.mp4file is generated for the new session.
triggerMode = 0is the automatic recording mode. The
-mparameter merges all audio and video files of one uid and generates a single
triggerMode = 1is the manual recording mode. The
stopparameters manage and separate the recorded files. Each
start/stopmakes one session, and the
-mparameter generates multiple
See the following figure for the different transcoding script options:
The transcoded MPEG-4 file supports the following players:
|Windows||Windows Media Player, KMPlayer, VLC Media Player|
|Mac||Mac QuickTime Player, Movist, MPlayerX, KMPlayer|
|iOS||iOS default player, VLC Media Player, KMPlayer|
|Android||Android default player, MX Player, VLC Media Player, KMPlayer|
You can start transcoding only if a
recording2-done.txt file exists in the recording folder. A
convert-done.txt file is generated after the transcoding is complete. Once the transcoding script is used, a
convert.log file is generated in the same directory as the audio and video files upon completion of the transcoding.