Ich habe gerade zugriff auf einen Server mit einer Quadro K2200
Ich habe damit mal ein paar Videos nach h264 konvertiert.
Einmal mit CPU und einmal mit GPU
Ich muss dazu sagen das es ein Server ist der auch etwas Power hat. Daher ist das transcoding mit der CPU auch nicht sooo schlecht,
Ich habe erst mal ein Video genommen und mit darauf folgende Videos erzeugt.
Diese dienen als Input für meinen Test.
hd1080_25_fps.ts 1920x1080
hd1080_50_fps.ts
hd480_25_fps.ts 852x480
hd480_50_fps.ts
hd720_25_fps.ts 1280x720
hd720_50_fps.ts
spal_25_fps.ts 768x576
spal_50_fps.ts
Hier nun mein Testscript
for i in hd1080 hd720 hd480 spal
do
for a in 25 50
do
for c in libx264 nvenc
do
echo "use $c"
ffmpeg -y -i ${i}_${a}_fps.ts -acodec copy -vcodec $c -b:v 5M test.mp4 2>&1 | egrep "Video:|frame=|Input|Output"
echo "===================================================================================================================="
done
echo ""
echo ""
done
done
Display More
Die Ausgaben sehen dann etwa so aus: (gekürzt)
use libx264
Input #0, mpegts, from 'hd1080_25_fps.ts':
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Output #0, mp4, to 'test.mp4':
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 5000 kb/s, 25 fps, 12800 tbn, 25 tbc
frame= 3333 fps= 48 q=-1.0 Lsize= 83235kB time=00:02:13.24 bitrate=5117.5kbits/s dup=21 drop=0
====================================================================================================================
use nvenc
Input #0, mpegts, from 'hd1080_25_fps.ts':
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Output #0, mp4, to 'test.mp4':
Stream #0:0: Video: h264 (nvenc) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 5000 kb/s, 25 fps, 12800 tbn, 25 tbc
frame= 3333 fps=250 q=-0.0 Lsize= 84042kB time=00:02:13.32 bitrate=5164.1kbits/s dup=21 drop=0
====================================================================================================================
use libx264
Input #0, mpegts, from 'spal_50_fps.ts':
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv), 768x576 [SAR 4:3 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc
Output #0, mp4, to 'test.mp4':
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 768x576 [SAR 4:3 DAR 16:9], q=-1--1, 5000 kb/s, 50 fps, 12800 tbn, 50 tbc
frame= 6664 fps=127 q=-1.0 Lsize= 83622kB time=00:02:13.24 bitrate=5141.3kbits/s dup=42 drop=0
====================================================================================================================
use nvenc
Input #0, mpegts, from 'spal_50_fps.ts':
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv), 768x576 [SAR 4:3 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc
Output #0, mp4, to 'test.mp4':
Stream #0:0: Video: h264 (nvenc) ([33][0][0][0] / 0x0021), yuv420p, 768x576 [SAR 4:3 DAR 16:9], q=-1--1, 5000 kb/s, 50 fps, 12800 tbn, 50 tbc
frame= 6664 fps=1101 q=-0.0 Lsize= 83695kB time=00:02:13.28 bitrate=5144.3kbits/s dup=42 drop=0
====================================================================================================================
Display More
Hier nun die Ergebnisse.
Die GPU Werte sind schon beeindruckend.
hd1080_25_fps.ts CPU=48fps GPU=250fps => faktor 5,2
hd1080_50_fps.ts CPU=61fps GPU=268fps => faktor 4,4
hd720_25_fps.ts CPU=70fps GPU=541fps => faktor 7,7
hd720_50_fps.ts CPU=83fps GPU=579fps => faktor 6,9
hd480_25_fps.ts CPU=99fps GPU=998fps => faktor 10
hd480_50_fps.ts CPU=118fps GPU=1156fps => faktor 9,8
spal_25_fps.ts CPU=108fps GPU=982fps => faktor 9,1
spal_50_fps.ts CPU=127fps GPU=1101fps => faktor 8,6
Wo ich jedoch gerade etwas enttäuscht bin ist scaling. Wenn ich das Output Video in z.B. 640x480 haben will, dann ist die GPU fast so schlecht wie die CPU. Ich vermute das ich noch einen Fehler habe. Anscheinend wird das image zum scalen von der GPU in die CPU kopiert und zurück. Obwohl nvresize aktiv ist. Damit werde ich mich vielleicht nächste Woche mal befassen.