[TDA2X] Use ffmpeg para convertir el video al formato h264 en ubuntu y genere las etiquetas correspondientes

ffmpeg se puede instalar directamente con sudo apt-get install ffmpeg.

Convertir video a formato h264

Genera la etiqueta correspondiente

#生成h264格式
ffmpeg -i output.avi -y -c:v libx264 -vframes 50 output.h264

#生成相应标签
1. ffprobe -show_packets ./H264_artifacts_motion.h264 >index.idx

2. Extract just "Size" from above generated index file with sed command.

PAT=size
sed -n "/$PAT/p" index.idx | cut -d' ' -f3 >> size_extracted.txt

3. Now generate binary file from size extracted file, with below command. Please note that " size_extracted.txt should not contain any string just numbers i.e size of frame " .

cat size_extracted_jelly.txt | perl -n -e 'printf("%08x\n",$_)' | sed 's/\(..\)\(..\)\(..\)\(..\)/0x\4\n0x\3\n0x\2\n0x\1/' | xxd -r -p > Size_test.bin && du -b Size_test.bin

Finalmente, cambie los nombres de los archivos de video h264 y .bin a inData e inHeader respectivamente.

El comando de ffmpeg para convertir la resolución de video es:

ffmpeg -i 输入文件名 -vf scale=1024:512,setsar=1:1 AerialCity_1920x1080.yuv -hide_banner  

 

Supongo que te gusta

Origin blog.csdn.net/qq_39642978/article/details/107019816
Recomendado
Clasificación