Gracias por la respuesta Karl.
He creado un fichero MP4.sh con este contenido:
#!/bin/bash
echo "Conversor de archivos de vídeo a MP4"
sleep 1
ffmpeg -i $1 -b:a 128k -c:a aac -c:v libx264 -framerate 29 -threads 2 $2
Lo he hecho ejecutable para ahorrarme el sh delante. Funciona:
**~**/**Descargas**/home/krovikan/bin/mp4.sh KK.mp4 LL.mp4
Conversor de archivos de vídeo a MP4
ffmpeg version 3.4.9 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 7 (SUSE Linux)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include/ffm
peg --extra-cflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack
-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g' --optf
lags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-str
ong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g' --disable-htmlpages
--enable-pic --disable-stripping --enable-shared --disable-static --enable-gpl --disable-openssl -
-enable-avresample --enable-libcdio --enable-gnutls --enable-ladspa --enable-libass --enable-libbl
uray --enable-libcelt --enable-libcdio --enable-libdc1394 --enable-libfreetype --enable-libgsm --e
nable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libspeex --enabl
e-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-li
bwebp --enable-libzimg --enable-libzvbi --enable-vaapi --enable-vdpau --enable-libopencore-amrnb -
-enable-libopencore-amrwb --enable-version3 --enable-libx264 --enable-libx265 --enable-libxvid
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'KK.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : So I Tried Elden Ring
artist : CarbotAnimations
date : 2022
encoder : Lavf58.76.100
comment : https://www.youtube.com/watch?v=LSyRf8rAjTs
Duration: 00:01:27.77, start: 0.000000, bitrate: 873 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1
:1 DAR 16:9], 740 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
Metadata:
handler_name : ISO Media file produced by Google Inc.
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (defau
lt)
Metadata:
handler_name : ISO Media file produced by Google Inc.
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, ?] for help
[libx264 @ 0x5617ac1b27a0] using SAR=1/1
[libx264 @ 0x5617ac1b27a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x5617ac1b27a0] profile High, level 4.0, 4:2:0, 8-bit
[libx264 @ 0x5617ac1b27a0] 264 - core 161 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://w
ww.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7
psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11
fast_pskip=1 chroma_qp_offset=-2 threads=2 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 i
nterlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1
weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=24 scenecut=40 intra_refresh=0 rc_lookahead=4
0 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'LL.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : So I Tried Elden Ring
artist : CarbotAnimations
date : 2022
comment : https://www.youtube.com/watch?v=LSyRf8rAjTs
encoder : Lavf57.83.100
Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 1
6:9], q=-1--1, 24 fps, 12288 tbn, 24 tbc (default)
Metadata:
handler_name : ISO Media file produced by Google Inc.
encoder : Lavc57.107.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (defau
lt)
Metadata:
handler_name : ISO Media file produced by Google Inc.
encoder : Lavc57.107.100 aac
frame= 2105 fps= 67 q=-1.0 Lsize= 10918kB time=00:01:27.77 bitrate=1019.1kbits/s speed= 2.8x
video:9477kB audio:1376kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.601
306%
[libx264 @ 0x5617ac1b27a0] frame I:45 Avg QP:14.32 size: 39456
[libx264 @ 0x5617ac1b27a0] frame P:883 Avg QP:21.42 size: 6710
[libx264 @ 0x5617ac1b27a0] frame B:1177 Avg QP:20.00 size: 1702
[libx264 @ 0x5617ac1b27a0] consecutive B-frames: 18.2% 18.1% 10.8% 52.8%
[libx264 @ 0x5617ac1b27a0] mb I I16..4: 26.9% 58.4% 14.8%
[libx264 @ 0x5617ac1b27a0] mb P I16..4: 1.3% 4.8% 1.4% P16..4: 6.8% 1.5% 0.7% 0.0% 0.0%
skip:83.6%
[libx264 @ 0x5617ac1b27a0] mb B I16..4: 0.1% 0.2% 0.1% B16..8: 6.5% 0.7% 0.1% direct: 0.3
% skip:91.9% L0:48.4% L1:50.2% BI: 1.4%
[libx264 @ 0x5617ac1b27a0] 8x8 transform intra:60.7% inter:48.2%
[libx264 @ 0x5617ac1b27a0] coded y,uvDC,uvAC intra: 14.4% 22.9% 13.9% inter: 0.8% 1.5% 0.3%
[libx264 @ 0x5617ac1b27a0] i16 v,h,dc,p: 51% 34% 6% 10%
[libx264 @ 0x5617ac1b27a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 42% 17% 35% 1% 1% 1% 1% 1% 1%
[libx264 @ 0x5617ac1b27a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 30% 27% 19% 5% 3% 3% 4% 3% 5%
[libx264 @ 0x5617ac1b27a0] i8c dc,h,v,p: 71% 16% 10% 4%
[libx264 @ 0x5617ac1b27a0] Weighted P-Frames: Y:1.1% UV:1.1%
[libx264 @ 0x5617ac1b27a0] ref P L0: 63.3% 5.9% 19.7% 11.0% 0.0%
[libx264 @ 0x5617ac1b27a0] ref B L0: 79.1% 17.8% 3.0%
[libx264 @ 0x5617ac1b27a0] ref B L1: 96.6% 3.4%
[libx264 @ 0x5617ac1b27a0] kb/s:885.11
[aac @ 0x5617ac1f3400] Qavg: 2280.786
**~**/**Descargas** ✔ 32s 14:12:24
Ahora me falta añadir /home/krovikan/bin al PATH para no tener que teclear la ruta entera. He probado esto pero parece que lo añade y no lo encuentra (he tenido que pasar a bash un momento porque en fish no funciona ese comando):
**~**/**Descargas**bash ✔ 14:26:31
krovikan@Linux:~/Descargas> echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin
krovikan@Linux:~/Descargas> export PATH=$PATH:/home/krovikan/bin
krovikan@Linux:~/Descargas> echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/krovikan/bin
krovikan@Linux:~/Descargas> mp4 KK.mp4 LL.mp4
Si 'mp4' no es un error tipográfico, puede usar la búsqueda de orden no encontrada, para saber a q
ué paquete pertenece, así:
cnf mp4
He añadido al final del .profile el export pero aún no he reiniciado la sesión para probarlo (aunque no tengo ningua esperanza).
Probé también en copiar el script a /usr/local/bin (que sale en el path) pero además de obligarme a usar sudo tampoco va.
Saludos