当前位置:网站首页>Record the ideas and precautions for QT to output a small number of pictures to mp4

Record the ideas and precautions for QT to output a small number of pictures to mp4

2022-06-25 23:36:00 The struggle history of polar bear

1. First use the library to save all the pictures as gif chart , Store locally . Preservation of liudianwu great God used in the library gif Gallery . The sample program can be downloaded from the following address . The sample program .

2. Download the latest ffmpeg Run the program , No development library required , Put it in the project directory .ffmpeg website :Download FFmpeg

3. Use QProess start-up ffmpeg.exe process , And attach parameters :-f gif -i Source file .gif -pix_fmt yuv420p The goal is .mp4

Can be gif Turn the picture into mp4.

Be careful : preservation gif In the picture , Need to set up : The width must be 32 Multiple , The height must be 2 Multiple , Otherwise, an error will be reported :width / height not divisible by 2.

Use save as gif, And then to MP4 The reason is that the storage speed is fast , Efficient , No further research is needed ffmpeg The second development method of library .

The disadvantage is that you can't keep a large amount of video , Do not carry accompanying audio .

原网站

版权声明
本文为[The struggle history of polar bear]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206252013018981.html