public void StartRecord(string channel) { Method = RecordMethod.Manual; FileName = GetOutputFileName(channel, Method, 0); string channellink = GetChannelLink(channel, ""); string arguments = String.Concat("-hide_banner -protocol_whitelist \"concat,file,subfile,http,https,tls,rtp,tcp,udp,crypto\" -i \"", channellink, "\"", " -c copy ", "\"", Parameter._outputFullPath, "\\", FileName, "\""); //Debug.WriteLine(arguments); ExecuteFfmpeg(arguments); }
private string GetOutputFileName(string channel, RecordMethod recordMethod, int retry_times) { TimeStamp stamp = new TimeStamp(); string fileName = string.Concat("rmtv-record_", stamp.GetTimeStamp(), "_", channel.ToLower(), "_", recordMethod.ToString().ToLower(), (retry_times != 0 ? string.Format("(reconnected{0:D2})", retry_times) : ""), ".mp4"); return(fileName); }
public void StartRecord(string channel, string channellink, int duration, int retry_times) { Method = RecordMethod.Scheduled; FileName = GetOutputFileName(channel, Method, retry_times); channellink = GetChannelLink(channel, channellink); string arguments = String.Concat("-hide_banner -protocol_whitelist \"concat,file,subfile,http,https,tls,rtp,tcp,udp,crypto\" -i \"", channellink, "\"", " -t ", duration, " -c copy ", "\"", Parameter._outputFullPath, "\\", FileName, "\""); //if (GlobalVar._isSaveLog) // arguments += " 2> \"log.txt\""; //Debug.WriteLine(arguments); ExecuteFfmpeg(arguments); _process.WaitForExit(); }