# Ver ffmpeg -formats
VIDS := $(wildcard *.yuv) ############## # Originales # ############## AVIS = $(VIDS:%.yuv=%.avi) %.avi: %.yuv ffmpeg -vcodec copy -r 30 -s 352x288 -i $*.yuv $*.avi ######### # MJPEG # ######### # 3631831 es el número de bytes generado en el experimento # "jpeg/compresión de akiyo". # 3631831/10.0*8 = 2905464 AVIS += $(VIDS:%.yuv=%_MJPEG_2905kbps.avi) %_MJPEG_2905kbps.avi: %.yuv ffmpeg -pass 1 -vcodec mjpeg -r 30 -s 352x288 -b 2905464 \ -i $*.yuv $*_MJPEG_2905kbps.avi ffmpeg -y -pass 2 -vcodec mjpeg -r 30 -s 352x288 -b 2905464 \ -i $*.yuv $*_MJPEG_2905kbps.avi ############## # M-JPEG2000 # ############## AVIS += $(VIDS:%.yuv=%_MJPEG2000_2905kbps.avi) %_MJPEG2000_2905kbps.avi: %.yuv echo -n "" > $*.vix # Borramos el fichero. echo "vix" >> $*.vix # Magic numbers. echo ">VIDEO<" >> $*.vix # Se trata de un vídeo: echo "30.0 0" >> $*.vix # Frame-rate y número de imágenes. echo ">COLOUR<" >> $*.vix # El espacio de color es: echo "YCbCr" >> $*.vix # YCbCr. echo ">IMAGE<" >> $*.vix # Las imágenes son: echo "unsigned char 8 little-endian" >> $*.vix # Precisión y endian echo "352 288 3" >> $*.vix # x_size y_size components echo "1 1" >> $*.vix # Y sub-sampling echo "2 2" >> $*.vix # Cb sub-sampling echo "2 2" >> $*.vix # Cr sub-sampling cat $*.yuv >> $*.vix # Pegamos el fichero .YUV al fichero .VIX kdu_v_compress -i $*.vix -o $*.mj2 -rate 0.96 # Comprimimos kdu_v_expand -i $*.mj2 -o $*.vix # Descomprimimos rm -f $*.mj2 # Borramos el fichero .mj2 dd if=$*.vix bs=101 skip=1 of=tmp.yuv count=3000000 # Eliminamos la cabecera .VIX ffmpeg -vcodec copy -r 30 -s 352x288 \ -i tmp.yuv $*_MJPEG2000_2905kbps.avi # YUV -> AVI rm -f tmp.yuv # Borramos el fichero temporal ########## # MPEG-1 # ########## # 1200kbps #AVIS = $(VIDS:/home/data/videos/%.yuv=%_MPEG-1_1200kbps.avi) AVIS += $(VIDS:%.yuv=%_MPEG-1_1200kbps.avi) %_MPEG-1_1200kbps.avi: %.yuv ffmpeg -pass 1 -vcodec mpeg1video -r 30 -s 352x288 -b 1200000 \ -i $*.yuv $*_MPEG-1_1200kbps.avi ffmpeg -y -pass 2 -vcodec mpeg1video -r 30 -s 352x288 -b 1200000 \ -i $*.yuv $*_MPEG-1_1200kbps.avi # 600kbps AVIS += $(VIDS:%.yuv=%_MPEG-1_600kbps.avi) %_MPEG-1_600kbps.avi: %.yuv ffmpeg -pass 1 -vcodec mpeg1video -r 30 -s 352x288 -b 600000 \ -i $*.yuv $*_MPEG-1_600kbps.avi ffmpeg -y -pass 2 -vcodec mpeg1video -r 30 -s 352x288 -b 600000 \ -i $*.yuv $*_MPEG-1_600kbps.avi # 300kbps AVIS += $(VIDS:%.yuv=%_MPEG-1_300kbps.avi) %_MPEG-1_300kbps.avi: %.yuv ffmpeg -pass 1 -vcodec mpeg1video -r 30 -s 352x288 -b 300000 \ -i $*.yuv $*_MPEG-1_300kbps.avi ffmpeg -y -pass 2 -vcodec mpeg1video -r 30 -s 352x288 -b 300000 \ -i $*.yuv $*_MPEG-1_300kbps.avi # 100kbps AVIS += $(VIDS:%.yuv=%_MPEG-1_100kbps.avi) %_MPEG-1_100kbps.avi: %.yuv ffmpeg -pass 1 -vcodec mpeg1video -r 30 -s 352x288 -b 100000 \ -i $*.yuv $*_MPEG-1_100kbps.avi ffmpeg -y -pass 2 -vcodec mpeg1video -r 30 -s 352x288 -b 100000 \ -i $*.yuv $*_MPEG-1_100kbps.avi ########## # MPEG-2 # ########## # 1200kbps #AVIS = $(VIDS:/home/data/videos/%.yuv=%_MPEG-2_1200kbps.avi) AVIS += $(VIDS:%.yuv=%_MPEG-2_1200kbps.avi) %_MPEG-2_1200kbps.avi: %.yuv ffmpeg -pass 1 -vcodec mpeg2video -r 30 -s 352x288 -b 1200000 \ -i $*.yuv $*_MPEG-2_1200kbps.avi ffmpeg -y -pass 2 -vcodec mpeg2video -r 30 -s 352x288 -b 1200000 \ -i $*.yuv $*_MPEG-2_1200kbps.avi # 600kbps AVIS += $(VIDS:%.yuv=%_MPEG-2_600kbps.avi) %_MPEG-2_600kbps.avi: %.yuv ffmpeg -pass 1 -vcodec mpeg2video -r 30 -s 352x288 -b 600000 \ -i $*.yuv $*_MPEG-2_600kbps.avi ffmpeg -y -pass 2 -vcodec mpeg2video -r 30 -s 352x288 -b 600000 \ -i $*.yuv $*_MPEG-2_600kbps.avi # 300kbps AVIS += $(VIDS:%.yuv=%_MPEG-2_300kbps.avi) %_MPEG-2_300kbps.avi: %.yuv ffmpeg -pass 1 -vcodec mpeg2video -r 30 -s 352x288 -b 300000 \ -i $*.yuv $*_MPEG-2_300kbps.avi ffmpeg -y -pass 2 -vcodec mpeg2video -r 30 -s 352x288 -b 300000 \ -i $*.yuv $*_MPEG-2_300kbps.avi # 100kbps AVIS += $(VIDS:%.yuv=%_MPEG-2_100kbps.avi) %_MPEG-2_100kbps.avi: %.yuv ffmpeg -pass 1 -vcodec mpeg2video -r 30 -s 352x288 -b 100000 \ -i $*.yuv $*_MPEG-2_100kbps.avi ffmpeg -y -pass 2 -vcodec mpeg2video -r 30 -s 352x288 -b 100000 \ -i $*.yuv $*_MPEG-2_100kbps.avi ########## # MPEG-4 # ########## # 1200kbps #AVIS = $(VIDS:/home/data/videos/%.yuv=%_MPEG-4_1200kbps.avi) AVIS += $(VIDS:%.yuv=%_MPEG-4_1200kbps.avi) %_MPEG-4_1200kbps.avi: %.yuv ffmpeg -pass 1 -vcodec mpeg4 -r 30 -s 352x288 -b 1200000 \ -i $*.yuv $*_MPEG-4_1200kbps.avi ffmpeg -y -pass 2 -vcodec mpeg4 -r 30 -s 352x288 -b 1200000 \ -i $*.yuv $*_MPEG-4_1200kbps.avi # 600kbps AVIS += $(VIDS:%.yuv=%_MPEG-4_600kbps.avi) %_MPEG-4_600kbps.avi: %.yuv ffmpeg -pass 1 -vcodec mpeg4 -r 30 -s 352x288 -b 600000 \ -i $*.yuv $*_MPEG-4_600kbps.avi ffmpeg -y -pass 2 -vcodec mpeg4 -r 30 -s 352x288 -b 600000 \ -i $*.yuv $*_MPEG-4_600kbps.avi # 300kbps AVIS += $(VIDS:%.yuv=%_MPEG-4_300kbps.avi) %_MPEG-4_300kbps.avi: %.yuv ffmpeg -pass 1 -vcodec mpeg4 -r 30 -s 352x288 -b 300000 \ -i $*.yuv $*_MPEG-4_300kbps.avi ffmpeg -y -pass 2 -vcodec mpeg4 -r 30 -s 352x288 -b 300000 \ -i $*.yuv $*_MPEG-4_300kbps.avi # 100kbps AVIS += $(VIDS:%.yuv=%_MPEG-4_100kbps.avi) %_MPEG-4_100kbps.avi: %.yuv ffmpeg -pass 1 -vcodec mpeg4 -r 30 -s 352x288 -b 100000 \ -i $*.yuv $*_MPEG-4_100kbps.avi ffmpeg -y -pass 2 -vcodec mpeg4 -r 30 -s 352x288 -b 100000 \ -i $*.yuv $*_MPEG-4_100kbps.avi ####### # FLV # ####### # 1200kbps AVIS += $(VIDS:%.yuv=%_FLV_1200kbps.avi) %_FLV_1200kbps.avi: %.yuv ffmpeg -pass 1 -vcodec flv -r 30 -s 352x288 -b 1200000 \ -i $*.yuv $*_FLV_1200kbps.avi ffmpeg -y -pass 2 -vcodec flv -r 30 -s 352x288 -b 1200000 \ -i $*.yuv $*_FLV_1200kbps.avi # 600kbps AVIS += $(VIDS:%.yuv=%_FLV_600kbps.avi) %_FLV_600kbps.avi: %.yuv ffmpeg -pass 1 -vcodec flv -r 30 -s 352x288 -b 600000 \ -i $*.yuv $*_FLV_600kbps.avi ffmpeg -y -pass 2 -vcodec flv -r 30 -s 352x288 -b 600000 \ -i $*.yuv $*_FLV_600kbps.avi # 300kbps AVIS += $(VIDS:%.yuv=%_FLV_300kbps.avi) %_FLV_300kbps.avi: %.yuv ffmpeg -pass 1 -vcodec flv -r 30 -s 352x288 -b 300000 \ -i $*.yuv $*_FLV_300kbps.avi ffmpeg -y -pass 2 -vcodec flv -r 30 -s 352x288 -b 300000 \ -i $*.yuv $*_FLV_300kbps.avi # 100kbps AVIS += $(VIDS:%.yuv=%_FLV_100kbps.avi) %_FLV_100kbps.avi: %.yuv ffmpeg -pass 1 -vcodec flv -r 30 -s 352x288 -b 100000 \ -i $*.yuv $*_FLV_100kbps.avi ffmpeg -y -pass 2 -vcodec flv -r 30 -s 352x288 -b 100000 \ -i $*.yuv $*_FLV_100kbps.avi ######## # H263 # ######## # 1200kbps AVIS += $(VIDS:%.yuv=%_H263_1200kbps.avi) %_H263_1200kbps.avi: %.yuv ffmpeg -pass 1 -vcodec h263 -r 30 -s 352x288 -b 1200000 \ -i $*.yuv $*_H263_1200kbps.avi ffmpeg -y -pass 2 -vcodec h263 -r 30 -s 352x288 -b 1200000 \ -i $*.yuv $*_H263_1200kbps.avi # 100kbps AVIS += $(VIDS:%.yuv=%_H263_100kbps.avi) %_H263_100kbps.avi: %.yuv ffmpeg -pass 1 -vcodec h263 -r 30 -s 352x288 -b 100000 \ -i $*.yuv $*_H263_100kbps.avi ffmpeg -y -pass 2 -vcodec h263 -r 30 -s 352x288 -b 100000 \ -i $*.yuv $*_H263_100kbps.avi ######## # FSVC # ######## # 1200Kbps AVIS += $(VIDS:%.yuv=%_FSVC_1200kbps.avi) %_FSVC_1200kbps.avi: %.yuv ./run_fsvc $* 1200 5 ffmpeg -vcodec copy -r 30 -s 352x288 \ -i tmp.yuv $*_FSVC_1200kbps.avi # YUV -> AVI rm -f tmp.yuv # 600Kbps AVIS += $(VIDS:%.yuv=%_FSVC_600kbps.avi) %_FSVC_600kbps.avi: %.yuv ./run_fsvc $* 600 5 ffmpeg -vcodec copy -r 30 -s 352x288 \ -i tmp.yuv $*_FSVC_600kbps.avi # YUV -> AVI rm -f tmp.yuv # 300Kbps AVIS += $(VIDS:%.yuv=%_FSVC_300kbps.avi) %_FSVC_300kbps.avi: %.yuv ./run_fsvc $* 300 5 ffmpeg -vcodec copy -r 30 -s 352x288 \ -i tmp.yuv $*_FSVC_300kbps.avi # YUV -> AVI rm -f tmp.yuv # 100Kbps AVIS += $(VIDS:%.yuv=%_FSVC_100kbps.avi) %_FSVC_100kbps.avi: %.yuv ./run_fsvc $* 100 6 ffmpeg -vcodec copy -r 30 -s 352x288 \ -i tmp.yuv $*_FSVC_100kbps.avi # YUV -> AVI rm -f tmp.yuv # 50Kbps AVIS += $(VIDS:%.yuv=%_FSVC_50kbps.avi) %_FSVC_50kbps.avi: %.yuv ./run_fsvc $* 50 7 ffmpeg -vcodec copy -r 30 -s 352x288 \ -i tmp.yuv $*_FSVC_50kbps.avi # YUV -> AVI rm -f tmp.yuv # Transmisión AVIS += $(VIDS:%.yuv=%_FSVC_1200kbps_trans.avi) %_FSVC_1200kbps_trans.avi: %.yuv ./run_fsvc_trans $* 1200 5 ffmpeg -vcodec copy -r 30 -s 352x288 \ -i tmp.yuv $*_FSVC_1200kbps_trans.avi # YUV -> AVI rm -f tmp.yuv ################ # Makefile.tex # ################ Makefile.tex: Makefile echo "\footnotesize" > Makefile.tex echo -n "\begin" >> Makefile.tex echo "{verbatim}" >> Makefile.tex awk ’{gsub(/\t/," ");print}’ < Makefile >> Makefile.tex echo -n "\end" >> Makefile.tex echo "{verbatim}" >> Makefile.tex echo "\normalsize" >> Makefile.tex all: $(AVIS) Makefile.tex objetives: @echo $(AVIS) Makefile.tex clean: rm -f *.avi *.log *.tex *.vix |