Ticket #8663: ffmpeg_bug.sh

File ffmpeg_bug.sh, 1.2 KB (added by Antoni Villalonga, 6 years ago)

Reproduce buggy situation

Line 
1#!/bin/bash
2
3set -e
4
5#Clean
6rm -rfv /tmp/testsrc.mp4 /tmp/encoding.testsrc-OK.mp4 /tmp/encoding.testsrc-KO.mp4
7rm -rfv /tmp/encoding.testsrc-OK.mp4.png /tmp/encoding.testsrc-KO.mp4.png
8
9#Create samples
10ffmpeg -loglevel error -f lavfi -i testsrc -vf "scale=1920:1080" -aspect 1920:1080 -t 10 -pix_fmt yuv420p /tmp/testsrc.mp4 -y
11
12#Run ffmpeg 1
13ffmpeg -i "/tmp/testsrc.mp4" -filter_complex '[0:v]copy[vr0]' -map '[vr0]' -vcodec libx264 -b:v:0 800K -profile:v baseline -pix_fmt yuv420p -preset "veryfast" -f mp4 "/tmp/encoding.testsrc-OK.mp4" -loglevel error -y
14
15#Run ffmpeg 2
16ffmpeg -i "/tmp/testsrc.mp4" -filter_complex '[0:v]copy[vr0]' -map '[vr0]' -vcodec libx264 -b:v:0 800K -profile:v baseline -pix_fmt yuv420p -preset "veryfast" -f tee "[select=\'v:0\':f=mp4]/tmp/encoding.testsrc-KO.mp4" -loglevel error -y
17
18#Compare results
19ffmpeg -loglevel error -ss 00:00:05 -i /tmp/encoding.testsrc-OK.mp4 -vframes 1 -q:v 0 /tmp/encoding.testsrc-OK.mp4.png -y
20ffmpeg -loglevel error -ss 00:00:05 -i /tmp/encoding.testsrc-KO.mp4 -vframes 1 -q:v 0 /tmp/encoding.testsrc-KO.mp4.png -y
21compare /tmp/encoding.testsrc-OK.mp4.png /tmp/encoding.testsrc-KO.mp4.png -compose src /tmp/diff.png || echo Files differ