RTSP流怎麼錄製

大牛直播錄像SDK可做爲單獨功能模塊使用(如同時多路錄像存檔),亦分佈於如下模塊,和其餘模塊組合調用html

  1. windows/android/iOS推送端SDK Demo;
  2. windows/android/iOS播放端SDK Demo;

大牛直播錄像SDK不一樣於普通錄像接口,更智能,和推送、播放、轉發、內置輕量級RTSP服務功能徹底分離,支持隨時錄像android

此外,大牛直播錄像SDK在錄像過程當中,支持切換不一樣URL,如兩個URL配置一致,則能夠錄製到同一個MP4文件,如不一致,可自動分割到下一個文件。windows

此外,大牛直播錄像SDK支持設置單個錄像文件大小、錄像路徑等,並支持純音頻、純視頻、音視頻錄製模式。網絡

從開始錄像,到錄像結束均有event callback上來,網絡堵塞、音視頻同步均作了很是友好的處理,大牛直播錄像SDK是目前市面上爲數很少真正好用的商業化錄像SDK。ide

相關接口實現:this

Windows平臺:code

/*
		設置本地錄像目錄, 必須是英文目錄,不然會失敗
		*/
		NT_UINT32(NT_API *SetRecorderDirectory)(NT_HANDLE handle, NT_PCSTR dir);

		/*
		設置單個錄像文件最大大小, 當超過這個值的時候,將切割成第二個文件
		size: 單位是KB(1024Byte), 當前範圍是 [5MB-800MB], 超出將被設置到範圍內
		*/
		NT_UINT32(NT_API *SetRecorderFileMaxSize)(NT_HANDLE handle, NT_UINT32 size);

		/*
		設置錄像文件名生成規則
		*/
		NT_UINT32(NT_API *SetRecorderFileNameRuler)(NT_HANDLE handle, NT_SP_RecorderFileNameRuler* ruler);


		/*
		設置錄像回調接口
		*/
		NT_UINT32(NT_API *SetRecorderCallBack)(NT_HANDLE handle,
			NT_PVOID call_back_data, SP_SDKRecorderCallBack call_back);

		/*
		啓動錄像
		*/
		NT_UINT32(NT_API *StartRecorder)(NT_HANDLE handle);

		/*
		中止錄像
		*/
		NT_UINT32(NT_API *StopRecorder)(NT_HANDLE handle);

Android平臺:視頻

/**
	 * Create file directory
	 *
	 * @param path,  E.g: /sdcard/daniulive/rec
	 *
	 * <pre> The interface is only used for recording the stream data to local side. </pre>
	 *
	 * @return {0} if successful
	 */
	public native int SmartPlayerCreateFileDirectory(String path);

	/**
	 * Set recorder directory.
	 *
	 * @param path: the directory of recorder file.
	 *
	 * <pre> NOTE: make sure the path should be existed, or else the setting failed. </pre>
	 *
	 * @return {0} if successful
	 */
	public native int SmartPlayerSetRecorderDirectory(long handle, String path);

	/**
	 * Set the size of every recorded file.
	 *
	 * @param size: (MB), (5M~500M), if not in this range, set default size with 200MB.
	 *
	 * @return {0} if successful
	 */
	public native int SmartPlayerSetRecorderFileMaxSize(long handle, int size);

	/**
	 * Start recorder stream
	 *
	 * @param handle: return value from SmartPlayerOpen()
	 *
	 * @return {0} if successful
	 */
	public native int SmartPlayerStartRecorder(long handle);

	/**
	 * Stop recorder stream
	 *
	 * @param handle: return value from SmartPlayerOpen()
	 *
	 * @return {0} if successful
	 */
	public native int SmartPlayerStopRecorder(long handle);

iOS平臺:htm

/**
 * 錄像相關:
 *
 * @param path 錄像文件存放目錄
 *
 * @return {0} if successful
 */
- (NSInteger)SmartPlayerSetRecorderDirectory:(NSString*)path;

/**
 * 錄像相關:
 *
 * @param size 每一個錄像文件的大小 (5~500M), 默認200M
 *
 * @return {0} if successful
 */
- (NSInteger)SmartPlayerSetRecorderFileMaxSize:(NSInteger)size;

/**
 * 錄像相關:
 *
 * Start recorder(開始錄像)
 *
 * @return {0} if successful
 */
- (NSInteger)SmartPlayerStartRecorder;

/**
 * 錄像相關:
 *
 * Stop recorder(中止錄像)
 *
 * @return {0} if successful
 */
- (NSInteger)SmartPlayerStopRecorder;
相關文章
相關標籤/搜索