1.2.3 1.2.3.1 video processing implemented to determine the message format
video processing MQ messages after using json uniform format, the video processing production side sends the following message to the MQ, the video processing consumer receives this message:
{ "mediaId": 1.2} XXX .3.2 process flow
1) receiving a video message processing 2) determines whether the media files to process (present only the video processing program is currently received video processing avi)
current avi file only needs to process other files to update the processing status is "without treatment." 3) the initialization process before the processing status is "untreated"
4) requires a processing failure log database recording processing, and the processing status is "treatment failure" 5) for recording the success of the processing status is "Successful treatment" 1.2.3.3 Data Model
in MediaFile class attribute records ts added mediaFileProcess_m3u8 list of files, as follows:
[AppleScript] plain text view Copy the code
1 2 |
|
[AppleScript] plain text view Copy the code
1 2 3 4 |
|
1.2.3.4 video processing to generate Mp4
1, create Dao video processing results need to be saved to media information database, create dao as follows:
[AppleScript] plain text view Copy the code
1 2 |
|
2, disposed in application.yml ff mpeg root location and the video category of:
[AppleScript] plain text view Copy the code
1 2 3 |
|
3, processing tasks created in the class mq package MediaProcessTask class, which is responsible for monitoring video processing queue, and video processing.
The entire content more video processing, to achieve here in two parts: generation and generation Mp4 m3u8, the following code implements generation mp4.
[AppleScript] plain text view Copy the code
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
说明:
1、原始视频转成mp4如何判断转换成功?
根据视频时长来判断,取原视频和转换成功视频的时长(时分秒),如果相等则相同。