支那
download:FFmpeg audio and video core technology elaboration and actual combat
支那
支那
This course will combine theory and practice, explain FFmpeg core technology from simple to deep, remove layers of mystery veil of audio and video processing, let you master FFmpeg audio and video coding and decoding, audio and video rendering, player development without relying on third-party SDK and other core technologies, help you become an efficient and well-paid audio and video engineer
支那
支那
Suits the crowd
Want to do audio and video engineers/want to systematically learn FFmpeg audio and video processing engineers Android development engineers
Technical reserve requirements
Have some self-study ability/have a language foundation (such as C language)/have Linux foundation (common commands)/Android foundation is better
支那
import org.apache.rocketmq.client.producer.DefaultMQProducer; import org.apache.rocketmq.client.producer.SendResult; import org.apache.rocketmq.common.message.Message; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; /** * @program: rocketmq-demo * @description: * @author: syske * @create: 2021-03-09 20:35 */ public class Producer { public static void main(String[] args) throws Exception { DefaultMQProducer producer = new DefaultMQProducer("order_group_1"); Producer. SetNamesrvAddr (127.0.0.1: "9876"); producer.start(); String[] tags = new String[]{"TagA", "TagC", "TagD"}; // List orderList = new Producer().buildOrders(); Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String dateStr = sdf.format(date); for (int i = 0; i < 10; I ++) {// Add a time prefix String body = dateStr + "Hello RocketMQ" + orderList.get(I); Message msg = new Message("TopicTest", tags[i % tags.length], "KEY" + i, body.getBytes()); SendResult sendResult = producer.send(msg, (mqs, msg1, arg) -> { Long id = (Long) arg; Queue long index = id % mqs.size(); return mqs.get((int) index); }, orderList.get(i).getOrderId()); Println (string. format("SendResult status:%s, queueId:%d, body:%s", sendresult.getsendStatus (), sendResult.getMessageQueue().getQueueId(), body)); } producer.shutdown(); } private static class OrderStep {private long orderId; private String desc; public long getOrderId() { return orderId; } public void setOrderId(long orderId) { this.orderId = orderId; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } @Override public String toString() { return "OrderStep{" + "orderId=" + orderId + ", desc='" + desc + '\'' + '}'; Private List buildOrders() {List orderList = new ArrayList(); OrderStep orderDemo = new OrderStep(); orderDemo.setOrderId(15103111039L); Founded orderDemo. SetDesc (" 1 "); orderList.add(orderDemo); orderDemo = new OrderStep(); orderDemo.setOrderId(15103111065L); OrderDemo. SetDesc (" create 2 "); orderList.add(orderDemo); orderDemo = new OrderStep(); orderDemo.setOrderId(15103111039L); Payment orderDemo. SetDesc (" 1 "); orderList.add(orderDemo); orderDemo = new OrderStep(); orderDemo.setOrderId(15103117235L); OrderDemo. SetDesc (" founded 3 "); orderList.add(orderDemo); orderDemo = new OrderStep(); orderDemo.setOrderId(15103111065L); Payment orderDemo. SetDesc (" 2 "); orderList.add(orderDemo); orderDemo = new OrderStep(); orderDemo.setOrderId(15103117235L); Payment orderDemo. SetDesc (" 3 "); orderList.add(orderDemo); orderDemo = new OrderStep(); orderDemo.setOrderId(15103111065L); OrderDemo. SetDesc (" complete 1 "); orderList.add(orderDemo); orderDemo = new OrderStep(); orderDemo.setOrderId(15103111039L); OrderDemo. SetDesc (" push 1 "); orderList.add(orderDemo); orderDemo = new OrderStep(); orderDemo.setOrderId(15103117235L); OrderDemo. SetDesc (" complete 2 "); orderList.add(orderDemo); orderDemo = new OrderStep(); orderDemo.setOrderId(15103111039L); OrderDemo. SetDesc (" complete 3 "); orderList.add(orderDemo); return orderList; }}Copy the code
Second time consumers
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; import org.apache.rocketmq.client.consumer.listener.ConsumeOrderlyContext; import org.apache.rocketmq.client.consumer.listener.ConsumeOrderlyStatus; import org.apache.rocketmq.client.consumer.listener.MessageListenerOrderly; import org.apache.rocketmq.common.consumer.ConsumeFromWhere; import org.apache.rocketmq.common.message.MessageExt; import java.util.List; import java.util.Random; import java.util.concurrent.TimeUnit; /** * @program: rocketmq-demo * @description: @author: syske * @create: 2021-03-09 20:37 */ public class ConsumerInOrder { public static void main(String[] args) throws Exception { DefaultMQPushConsumer consumer = new DefaultMQPushConsumer("order_group_3"); Consumer. SetNamesrvAddr (127.0.0.1: "9876"); /** * set Consumer to start at the head of the queue or start at the tail of the queue Then according to the last position to continue consumption * / consumer setConsumeFromWhere (ConsumeFromWhere. CONSUME_FROM_FIRST_OFFSET); consumer.subscribe("TopicTest", "TagA || TagC || TagD"); consumer.registerMessageListener(new MessageListenerOrderly() { Random random = new Random(); @Override public ConsumeOrderlyStatus consumeMessage(List msgs, ConsumeOrderlyContext context) { context.setAutoCommit(true); for (MessageExt msg : MSGS) {// See that each queue has a single consume thread, Println ("consumeThread=" + thread.currentThread ().getName() + "queueId=" + msg.getqueueid ()) + ", content:" + new String(msg.getBody())); } try {// imitate business logic disposal... TimeUnit.SECONDS.sleep(random.nextInt(10)); } catch (Exception e) { e.printStackTrace(); } return ConsumeOrderlyStatus.SUCCESS; }}); consumer.start(); System.out.println("Consumer Started."); }}Copy the code