The new Java project studies online notes -day14 (a)

Online studies - Day 14 - Lecture - Media Asset Management 1 1.1 video processing needs analysis 
of the original video encoding process usually takes to generate m3u8 and ts files before HLS protocol-based video player. Usually the user to upload the original video, the system automatically processed to video auto-coding standard format, the system user to upload, conversion ultimately produce m3u8 files and ts files, the processing flow is as follows:
1, users upload a video success 2, the system successfully uploaded videos automatically starts coding
3, users see the video processing result, no processing is successful video user can trigger again in the management interface processing 
4, the video processing is complete to save the video address and deal with the results to the database  
video process is as follows:
 
the task of video processing process is receive a video message processing video processing, traffic flow is as follows:
1, the MQ monitor, video processing received messages. 2, video processing.
3, the video processing result is written to the database.

Video processing process is part of the media asset management system, consider raising the scalability of the system, the video will be dealt with separately defined video processing project.
  1.2 Video Processing Development 
1.2.1 video processing engineering to create 
1, into the "profile" of video processing works under: XC-Service-the Manage-Media-Processor

 
RabbitMQ configuration is as follows:
 

[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

@Configuration public class RabbitMQConfig {

    public static final String EX_MEDIA_PROCESSTASK = "ex_media_processor";   

   //视频处理队列

    @Value("${xc‐service‐manage‐media.mq.queue‐media‐video‐processor}")

    public  String queue_media_video_processtask;   

   //视频处理路由   

 @Value("${xc‐service‐manage‐media.mq.routingkey‐media‐video}") 

   public  String routingkey_media_video;    

    /**    

 * 交换机配置  

   * @return the exchange  

   */    

@Bean(EX_MEDIA_PROCESSTASK)  

  public Exchange EX_MEDIA_VIDEOTASK() {  

      return ExchangeBuilder.directExchange(EX_MEDIA_PROCESSTASK).durable(true).build();

    }   

 //声明队列 

   @Bean("queue_media_video_processtask") 

   public Queue QUEUE_PROCESSTASK() {  

      Queue queue = new Queue(queue_media_video_processtask,true,false,true);    

    return queue;

    } 

   /**  

   * 绑定队列到交换机 .  

   * @param queue   

the queue 

    * @param exchange the exchange 

    * @return the binding   

  */    

@Bean

    public Binding binding_queue_media_processtask(@Qualifier("queue_media_video_processtask")  Queue queue,

 @Qualifier(EX_MEDIA_PROCESSTASK) Exchange exchange) {     

   return BindingBuilder.bind(queue).to(exchange).with(routingkey_media_video).noargs();  

  }   }


Configuring queue name and routingkey in the application.yml

[AppleScript]  plain text view  Copy the code

?

1

2

3

4

xc‐service‐manage‐media:

  mq: 

   queue‐media‐video‐processor: queue_media_video_processor

    routingkey‐media‐video: routingkey_media_video

Guess you like

Origin blog.csdn.net/czbkzmj/article/details/91795099