avFileType
parameter. You no longer need to use the Format Converter script.Composite recording mode generates one M3U8 file and multiple TS files which include the audio and video of all or specified user IDs in a channel. You can use FFmpeg to convert an M3U8 file to MP4 or use Agora's Format Converter script to batch convert multiple TS files into MP4 or audio formats.
You can use FFmpeg to convert an M3U8 file to MP4. Install FFmpeg and run the following command:
ffmpeg -i input.m3u8 -vcodec copy -acodec copy -absf aac_adtstoasc output.mp4
Where input.m3u8
is the name of the M3U8 file to convert, and output.mp4
is the name of the MP4 file to output. For more information about the parameters used in this example, see the FFmpeg Documentation.
You can use Agora's Format Converter script to batch convert TS files to MP4 or audio formats, including MP3, WAV, and AAC.
Recommended systems for transcoding:
To run the script, you need to install FFmpeg 3.3 or later and Python 2, version 2.7 or later (Except Python 3).
Ensure that the recorded files are stored in an accessible directory.
Download the Agora Format Converter Script script and decompress it.
Use the following command:
python format_convert.py <directory> <source_format> <destination_format>
Where:
directory
: Directory of the source files.
source_format
: Format of the source files. source_format
must be in lowercase:
mp3
, wav
, or aac
.mp4
or ts
.destination_format
: Format to which you want to convert the source files. destination_format
must be in lowercase:
mp3
, wav
, or aac
.mp4
or ts
.When you run the command, the script will search for all files in the specified format in the directory and convert them to the target format. The converted files have the same name as the source files, except for the suffix.
To convert all the MP4 files under /home/testname/testfolder
to TS format, use the following command:
python format_convert.py /home/testname/testfolder/ mp4 ts