Mit entsprechender Nvida GPU ist Hardware beschleunigtes encodieren von Videos mit nvenc möglich. Auf meiner Maschine macht das einen gewaltigen Unterschied, so braucht ein ca. 3 Minuten Video ohne nvenc ca. eine Dreiviertelstunde Encodiervorgang. Mit nvenc hingegen geht das in unter einer Minute. Von der Qualtiät her wirkt dabei das mit nvenc encodierte fast besser, zumindest ist es deutlich weniger Nerven raubend, wenn encodieren schnell geht, zumal das Ergebnis wirklich gut aussieht.
Voraussetzung für nvenc ist die passende Nvidia Grafik-Hardware und die passende Software. Dafür ist unter Kubuntu Linux der proprietäre nvidia-driver notwendig.
Nutzbar ist nvenc ab GK110 (Kepler), das wäre zum Beispiel eine NVIDIA GeForce GTX 780.
Damit das "video_convert_h264_nvenc" KDE Servicemenu funktioniert, ist für das smtube Icon das Paket smtube zuständig (es wird nur das Icon benutzt, kann man im Bedarfsfall selbst ändern):
sudo apt-get install smtube
Zum austüfteln der Bitrate Einstellung ist zudem das Paket mediainfo notwendig, ffprobe aus dem ffmpeg Paket reichte leider nicht aus wegen der Problemvideos:
https://packages.ubuntu.com/search?keywords=mediainfo&searchon=names&exact=1&suite=all§ion=all
sudo apt-get install mediainfo
FFmpeg muss installiert sein. Ab Focal Fossa werden die aktuellen FFmpeg Pakete mit external nv-codec-headers für NVENC Nvidia-GPU-Hardware beschleunigtes Video gebaut
https://packages.ubuntu.com/search?keywords=ffmpeg&searchon=names&exact=1&suite=all§ion=all
sudo apt-get install ffmpeg
So sieht das KDE Servicemenü dann aus:
video_convert_h264_nvenc.desktop
[Desktop Entry] Type=Service ServiceTypes=KonqPopupMenu/Plugin MimeType=video/3gpp;video/3gpp2;video/mp4;video/mpeg;video/ogg;video/x-matroska;video/x-mjpeg;video/wmp;video/wmv;video/x-msvideo;video/x-flic;video/x-flv;video/x-sgi-movie;video/quicktime Actions=video_to_webm;video_alternative_bitrate_to_webm;video_to_mp4;video_alternative_bitrate_to_mp4;video_to_mkv;video_alternative_bitrate_to_mkv;video_to_avi;video_alternative_birate_to_avi;video_rotate_90_degrees_clockwise_mp4;video_rotate_90_degrees_clockwise_alternative_bitrate_mp4;video_rotate_90_degrees_counter_clockwise_mp4;video_rotate_90_degrees_counter_clockwise_alternative_bitrate_mp4;video_rotate_upside_down_mp4;video_rotate_upside_down_alternative_bitrate_mp4;video_mirror_vertically_mp4;video_mirror_vertically_alternative_bitrate_mp4;video_mirror_horizontally_mp4;video_mirror_horizontally_alternative_bitrate_mp4; X-KDE-Submenu= Video convert ==> X-KDE-Submenu[de]=Video umwandeln ==> Icon=smtube [Desktop Action video_to_webm] Icon=smtube Name=Video convert to webm Name[de]=Video umwandeln zu webm Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/webm/I`" ] && notify-send -i window-close.png "STOP! File exists! `echo "%f" | sed -e s/[^.]*$/webm/I | xargs basename`" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/webm/I`" ] && notify-send -i media-playback-start.png "video to webm! :-)" "`echo "%f" | xargs basename` video to webm Running..." && yes | ffmpeg -hwaccel cuda -i "%f" -b:v "`mediainfo --Inform="Video;%%BitRate%%" "%f" | sed -e 's/\\(.*\\)...$/\\1/' -e 's/^\\(.*\\)/\\1K/'`" -pass 1 -an -f webm /dev/null && ffmpeg -hwaccel cuda -i "%f" -b:v "`mediainfo --Inform="Video;%%BitRate%%" "%f" | sed -e 's/\\(.*\\)...$/\\1/' -e 's/^\\(.*\\)/\\1K/'`" -pass 2 "`echo "%f" | sed -e s/[^.]*$/webm/I`"&& rm ffmpeg2pass-0.log && notify-send -i dialog-ok-apply.png "Ready! :-)" "video to webm: `echo "%f" | sed -e s/[^.]*$/webm/I | xargs basename` Ready!" [Desktop Action video_alternative_bitrate_to_webm] Icon=smtube Name=Video convert with alternative bitrate to webm Name[de]=Video konvertien mit alternative Bitrate zu webm Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/webm/I`" ] && notify-send -i window-close.png "STOP! File exists! `echo "%f" | sed -e s/[^.]*$/webm/I | xargs basename`" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/webm/I`" ] && notify-send -i media-playback-start.png "video to webm! :-)" "`echo "%f" | xargs basename` video to webm Running..." && yes | ffmpeg -hwaccel cuda -i "%f" -b:v "`mediainfo -vv "%f" | awk '/Overall bit rate/ {print $5$6}' | sed -e 's/kb\\/s//' -e 's/^\\(.*\\)/\\1K/'`" -pass 1 -an -f webm /dev/null && ffmpeg -hwaccel cuda -i "%f" -b:v "`mediainfo -vv "%f" | awk '/Overall bit rate/ {print $5$6}' | sed -e 's/kb\\/s//' -e 's/^\\(.*\\)/\\1K/'`" -pass 2 "`echo "%f" | sed -e s/[^.]*$/webm/I`"&& rm ffmpeg2pass-0.log && notify-send -i dialog-ok-apply.png "Ready! :-)" "video to webm: `echo "%f" | sed -e s/[^.]*$/webm/I | xargs basename` Ready!" [Desktop Action video_to_mp4] Icon=smtube Name=Video convert to mp4 Name[de]=Video umwandeln zu mp4 Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/mp4/I`" ] && notify-send -i window-close.png "STOP! File exists! `echo "%f" | sed -e s/[^.]*$/mp4/I | xargs basename`" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/mp4/I`" ] && notify-send -i media-playback-start.png "video to mp4! :-)" "`echo "%f" | xargs basename` video to mp4 Running..." && yes | ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i "%f" -c:v h264_nvenc -profile high -preset slow -b:v "`mediainfo --Inform="Video;%%BitRate%%" "%f" | sed -e 's/\\(.*\\)...$/\\1/' -e 's/^\\(.*\\)/\\1K/'`" -c:a aac -b:a "`mediainfo --Inform="Audio;%%BitRate%%" "%f" | sed -e 's/\\(.*\\)...$/\\1/' -e 's/^\\(.*\\)/\\1K/'`" "`echo "%f" | sed -e s/[^.]*$/mp4/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "video to mp4: `echo "%f" | sed -e s/[^.]*$/mp4/I | xargs basename` Ready!" [Desktop Action video_alternative_bitrate_to_mp4] Icon=smtube Name=Video convert with alternative bitrate to mp4 Name[de]=Video konvertien mit alternative Bitrate zu mp4 Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/mp4/I`" ] && notify-send -i window-close.png "STOP! File exists! `echo "%f" | sed -e s/[^.]*$/mp4/I | xargs basename`" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/mp4/I`" ] && notify-send -i media-playback-start.png "video to mp4! :-)" "`echo "%f" | xargs basename` video to mp4 Running..." && yes | ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i "%f" -c:v h264_nvenc -profile high -preset slow -b:v "`mediainfo -vv "%f" | awk '/Overall bit rate/ {print $5$6}' | sed -e 's/kb\\/s//' -e 's/^\\(.*\\)/\\1K/'`" -c:a aac "`echo "%f" | sed -e s/[^.]*$/mp4/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "video to mp4: `echo "%f" | sed -e s/[^.]*$/mp4/I | xargs basename` Ready!" [Desktop Action video_to_mkv] Icon=smtube Name=Video convert to mkv Name[de]=Video umwandeln zu mkv Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/mkv/I`" ] && notify-send -i window-close.png "STOP! File exists! `echo "%f" | sed -e s/[^.]*$/mkv/I | xargs basename`" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/mkv/I`" ] && notify-send -i media-playback-start.png "video to mkv! :-)" "`echo "%f" | xargs basename` video to mkv Running..." && yes | ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i "%f" -c:v h264_nvenc -profile high -preset slow -b:v "`mediainfo --Inform="Video;%%BitRate%%" "%f" | sed -e 's/\\(.*\\)...$/\\1/' -e 's/^\\(.*\\)/\\1K/'`" -c:a aac -b:a "`mediainfo --Inform="Audio;%%BitRate%%" "%f" | sed -e 's/\\(.*\\)...$/\\1/' -e 's/^\\(.*\\)/\\1K/'`" "`echo "%f" | sed -e s/[^.]*$/mkv/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "video to mkv: `echo "%f" | sed -e s/[^.]*$/mkv/I | xargs basename` Ready!" [Desktop Action video_alternative_bitrate_to_mkv] Icon=smtube Name=Video convert with alternative bitrate to mkv Name[de]=Video konvertien mit alternative Bitrate zu mkv Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/mkv/I`" ] && notify-send -i window-close.png "STOP! File exists! `echo "%f" | sed -e s/[^.]*$/mkv/I | xargs basename`" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/mkv/I`" ] && notify-send -i media-playback-start.png "video to mkv! :-)" "`echo "%f" | xargs basename` video to mkv Running..." && yes | ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i "%f" -c:v h264_nvenc -profile high -preset slow -b:v "`mediainfo -vv "%f" | awk '/Overall bit rate/ {print $5$6}' | sed -e 's/kb\\/s//' -e 's/^\\(.*\\)/\\1K/'`" -c:a aac "`echo "%f" | sed -e s/[^.]*$/mkv/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "video to mkv: `echo "%f" | sed -e s/[^.]*$/mkv/I | xargs basename` Ready!" [Desktop Action video_to_avi] Icon=smtube Name=Video convert to avi Name[de]=Video umwandeln zu avi Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/avi/I`" ] && notify-send -i window-close.png "STOP! File exists! `echo "%f" | sed -e s/[^.]*$/avi/I | xargs basename`" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/avi/I`" ] && notify-send -i media-playback-start.png "video to avi! :-)" "`echo "%f" | xargs basename` video to avi Running..." && yes | ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i "%f" -c:v h264_nvenc -profile high -preset slow -b:v "`mediainfo --Inform="Video;%%BitRate%%" "%f" | sed -e 's/\\(.*\\)...$/\\1/' -e 's/^\\(.*\\)/\\1K/'`" -b:a "`mediainfo --Inform="Audio;%%BitRate%%" "%f" | sed -e 's/\\(.*\\)...$/\\1/' -e 's/^\\(.*\\)/\\1K/'`" "`echo "%f" | sed -e s/[^.]*$/avi/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "video to avi: `echo "%f" | sed -e s/[^.]*$/avi/I | xargs basename` Ready!" [Desktop Action video_alternative_birate_to_avi] Icon=smtube Name=Video convert with alternative bitrate to avi Name[de]=Video konvertien mit alternative Bitrate zu avi Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/avi/I`" ] && notify-send -i window-close.png "STOP! File exists! `echo "%f" | sed -e s/[^.]*$/avi/I | xargs basename`" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/avi/I`" ] && notify-send -i media-playback-start.png "video to avi! :-)" "`echo "%f" | xargs basename` video to avi Running..." && yes | ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i "%f" -c:v h264_nvenc -profile high -preset slow -b:v "`mediainfo -vv "%f" | awk '/Overall bit rate/ {print $5$6}' | sed -e 's/kb\\/s//' -e 's/^\\(.*\\)/\\1K/'`" "`echo "%f" | sed -e s/[^.]*$/avi/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "video to avi: `echo "%f" | sed -e s/[^.]*$/avi/I | xargs basename` Ready!" [Desktop Action video_rotate_90_degrees_clockwise_mp4] Icon=smtube Name=Video Rotation 90_degrees clockwise mp4 Name[de]=Video Drehung 90 Grad im Uhrzeigersinn mp4 Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I`" ] && notify-send -i window-close.png "STOP! File exists! `echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename`" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename`" ] && notify-send -i media-playback-start.png "Rotates the Video orientation :-)" "`echo "%f" | xargs basename` mp4 turn Running..." && ffmpeg -hwaccel cuda -i "%f" -vf "transpose=1" -strict experimental -vcodec nvenc -preset slow -b:v "`mediainfo --Inform="Video;%%BitRate%%" "%f" | sed -e 's/\\(.*\\)...$/\\1/' -e 's/^\\(.*\\)/\\1K/'`" -c:a aac -b:a "`mediainfo --Inform="Audio;%%BitRate%%" "%f" | sed -e 's/\\(.*\\)...$/\\1/' -e 's/^\\(.*\\)/\\1K/'`" "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "Rotated `echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename` Ready!" [Desktop Action video_rotate_90_degrees_clockwise_alternative_bitrate_mp4] Icon=smtube Name=Video Rotation 90_degrees clockwise with alternative bitrate mp4 Name[de]=Video Drehung 90 Grad im Uhrzeigersinn mit alternative Bitrate mp4 Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I`" ] && notify-send -i window-close.png "STOP! File exists! `echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename`" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename`" ] && notify-send -i media-playback-start.png "Rotates the Video orientation :-)" "`echo "%f" | xargs basename` mp4 turn Running..." && ffmpeg -hwaccel cuda -i "%f" -vf "transpose=1" -strict experimental -vcodec nvenc -preset slow -b:v "`mediainfo -vv "%f" | awk '/Overall bit rate/ {print $5$6}' | sed -e 's/kb\\/s//' -e 's/^\\(.*\\)/\\1K/'`" -c:a aac "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "Rotated `echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename` Ready!" [Desktop Action video_rotate_90_degrees_counter_clockwise_mp4] Icon=smtube Name=Video Rotation 90_degrees counter clockwise mp4 Name[de]=Video Drehung 90 Grad gegen Uhrzeigersinn mp4 Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I`" ] && notify-send -i window-close.png "STOP! File exists! `echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename`" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename`" ] && notify-send -i media-playback-start.png "Rotates the Video orientation :-)" "`echo "%f" | xargs basename` mp4 turn Running..." && ffmpeg -hwaccel cuda -i "%f" -vf "transpose=2" -strict experimental -vcodec nvenc -preset slow -b:v "`mediainfo --Inform="Video;%%BitRate%%" "%f" | sed -e 's/\\(.*\\)...$/\\1/' -e 's/^\\(.*\\)/\\1K/'`" -c:a aac -b:a "`mediainfo --Inform="Audio;%%BitRate%%" "%f" | sed -e 's/\\(.*\\)...$/\\1/' -e 's/^\\(.*\\)/\\1K/'`" "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "Rotated `echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename` Ready!" [Desktop Action video_rotate_90_degrees_counter_clockwise_alternative_bitrate_mp4] Icon=smtube Name=Video Rotation 90_degrees counter clockwise with alternative bitrate mp4 Name[de]=Video Drehung 90 Grad gegen Uhrzeigersinn mit alternative Bitrate mp4 Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I`" ] && notify-send -i window-close.png "STOP! File exists! `echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename`" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename`" ] && notify-send -i media-playback-start.png "Rotates the Video orientation :-)" "`echo "%f" | xargs basename` mp4 turn Running..." && ffmpeg -hwaccel cuda -i "%f" -vf "transpose=2" -strict experimental -vcodec nvenc -preset slow -b:v "`mediainfo -vv "%f" | awk '/Overall bit rate/ {print $5$6}' | sed -e 's/kb\\/s//' -e 's/^\\(.*\\)/\\1K/'`" -c:a aac "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "Rotated `echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename` Ready!" [Desktop Action video_rotate_upside_down_mp4] Icon=smtube Name=Video Rotation rotation upside down mp4 Name[de]=Video Drehung kopfüber mp4 Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I`" ] && notify-send -i window-close.png "STOP! File exists! `echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename`" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename`" ] && notify-send -i media-playback-start.png "Rotates the Video orientation :-)" "`echo "%f" | xargs basename` mp4 turn Running..." && ffmpeg -hwaccel cuda -i "%f" -vf "transpose=2,transpose=2" -strict experimental -vcodec nvenc -preset slow -b:v "`mediainfo --Inform="Video;%%BitRate%%" "%f" | sed -e 's/\\(.*\\)...$/\\1/' -e 's/^\\(.*\\)/\\1K/'`" -c:a aac -b:a "`mediainfo --Inform="Audio;%%BitRate%%" "%f" | sed -e 's/\\(.*\\)...$/\\1/' -e 's/^\\(.*\\)/\\1K/'`" "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "Rotated `echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename` Ready!" [Desktop Action video_rotate_upside_down_alternative_bitrate_mp4] Icon=smtube Name=Video Rotation rotation upside down with alternative bitrate mp4 Name[de]=Video Drehung kopfüber mit alternative Bitrate mp4 Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I`" ] && notify-send -i window-close.png "STOP! File exists! `echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename`" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename`" ] && notify-send -i media-playback-start.png "Rotates the Video orientation :-)" "`echo "%f" | xargs basename` mp4 turn Running..." && ffmpeg -hwaccel cuda -i "%f" -vf "transpose=2,transpose=2" -strict experimental -vcodec nvenc -preset slow -b:v "`mediainfo -vv "%f" | awk '/Overall bit rate/ {print $5$6}' | sed -e 's/kb\\/s//' -e 's/^\\(.*\\)/\\1K/'`" -c:a aac "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "Rotated `echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename` Ready!" [Desktop Action video_mirror_vertically_mp4] Icon=smtube Name=Video mirror_vertically mp4 Name[de]=Video spiegeln vertikal mp4 Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I`" ] && notify-send -i window-close.png "STOP! File exists! `echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename`" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename`" ] && notify-send -i media-playback-start.png "Rotates the Video orientation :-)" "`echo "%f" | xargs basename` mp4 turn Running..." && ffmpeg -hwaccel cuda -i "%f" -vf "vflip" -strict experimental -vcodec nvenc -preset slow -b:v "`mediainfo --Inform="Video;%%BitRate%%" "%f" | sed -e 's/\\(.*\\)...$/\\1/' -e 's/^\\(.*\\)/\\1K/'`" -c:a aac -b:a "`mediainfo --Inform="Audio;%%BitRate%%" "%f" | sed -e 's/\\(.*\\)...$/\\1/' -e 's/^\\(.*\\)/\\1K/'`" "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "Rotated `echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename` Ready!" [Desktop Action video_mirror_vertically_alternative_bitrate_mp4] Icon=smtube Name=Video mirror_vertically with alternative bitrate mp4 Name[de]=Video spiegeln vertikal mit alternative Bitrate mp4 Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I`" ] && notify-send -i window-close.png "STOP! File exists! `echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename`" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename`" ] && notify-send -i media-playback-start.png "Rotates the Video orientation :-)" "`echo "%f" | xargs basename` mp4 turn Running..." && ffmpeg -hwaccel cuda -i "%f" -vf "vflip" -strict experimental -vcodec nvenc -preset slow -b:v "`mediainfo -vv "%f" | awk '/Overall bit rate/ {print $5$6}' | sed -e 's/kb\\/s//' -e 's/^\\(.*\\)/\\1K/'`" -c:a aac "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "Rotated `echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename` Ready!" [Desktop Action video_mirror_horizontally_mp4] Icon=smtube Name=Video mirror horizontally mp4 Name[de]=Video spiegeln horizontal mp4 Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I`" ] && notify-send -i window-close.png "STOP! File exists! `echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename`" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename`" ] && notify-send -i media-playback-start.png "Rotates the Video orientation :-)" "`echo "%f" | xargs basename` mp4 turn Running..." && ffmpeg -hwaccel cuda -i "%f" -vf "hflip" -strict experimental -vcodec nvenc -preset slow -b:v "`mediainfo --Inform="Video;%%BitRate%%" "%f" | sed -e 's/\\(.*\\)...$/\\1/' -e 's/^\\(.*\\)/\\1K/'`" -c:a aac -b:a "`mediainfo --Inform="Audio;%%BitRate%%" "%f" | sed -e 's/\\(.*\\)...$/\\1/' -e 's/^\\(.*\\)/\\1K/'`" "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "Rotated `echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename` Ready!" [Desktop Action video_mirror_horizontally_alternative_bitrate_mp4] Icon=smtube Name=Video mirror horizontally with alternative bitrate mp4 Name[de]=Video spiegeln horizontal mit alternative Bitrate mp4 Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I`" ] && notify-send -i window-close.png "STOP! File exists! `echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename`" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename`" ] && notify-send -i media-playback-start.png "Rotates the Video orientation :-)" "`echo "%f" | xargs basename` mp4 turn Running..." && ffmpeg -hwaccel cuda -i "%f" -vf "hflip" -strict experimental -vcodec nvenc -preset slow -b:v "`mediainfo -vv "%f" | awk '/Overall bit rate/ {print $5$6}' | sed -e 's/kb\\/s//' -e 's/^\\(.*\\)/\\1K/'`" -c:a aac "`echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "Rotated `echo "%f" | sed -e s/[^.]*$/_rotated.mp4/I | xargs basename` Ready!"
Dieser Inhalt kommt dann in eine Datei
/home/USERNAME/.local/share/kservices5/ServiceMenus/video_convert_h264_nvenc.desktop
Wobei USERNAME der eigene jeweilige Username sein muss. Anschließend noch im Terminal (KDE Konsole) laufen lassen:
kbuildsycoca5 --noincremental
Das liest nicht nur die *.desktop Dateien neu ein, es überprüft auch auf grobe Syntax Fehler.
Als Testvideos habe ich verwendet:
Von dieser Webseite:
Und von Youtube dieses:
youtube-dl macht es möglich:
youtube-dl iSW-hDVY24c
Im Servicemenu sind alternative Bitrate Möglichhkeiten vorhanden. Das hat sich ergeben, weil sich die Bitrate nicht unbedingt so auslesen lässt wie es am einfachsten wäre. Würde man stumpf wie etwa in diesem KDE Servicemenü umwandeln:
Damit würde das umwandeln nicht nur lange dauern, sondern es gibt auch kein gutes Video, es sieht dann eher nach unschönem Klötzenballet aus, anstatt nach Wellen und Wasser wie im sample_1280x720_surfing_with_audio.3gp gezeigt. Die einfache Befehlzeile macht nur:
ffmpeg -i Ausgangsvideo -y Ergebnisvideo.avi
Was dann leider zu einem sehr hässlichem Klötzenballet führt. Wäre ja schön, wenn es so einfach gewesen wäre, aber ist es leider nicht. Zumindest dann nicht, wenn man gute Qualtiät und gute Geschwindigkeit beim umwandeln oder rotieren haben will. webm kann übrigens meine alte Hardware nur bedingt beschleunigen. Da dauert dann umwandeln vom ca. 3 Minuten Testvideo rund eine Dreiviertelstunde. nvenc schafft das in unter einer Minute in guter Qualtität, bei unterstüzten Formaten und Hardware.
Nachtrag: für die Benachrichtigungen braucht es auch noch das Paket libnotify-bin, hoffe, dass es per default bei Kubuntu dabei ist, falls nicht:
sudo apt-get install libnotify-bin