
Recherche avancée
Autres articles (80)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
D’autres logiciels intéressants
12 avril 2011, parOn ne revendique pas d’être les seuls à faire ce que l’on fait ... et on ne revendique surtout pas d’être les meilleurs non plus ... Ce que l’on fait, on essaie juste de le faire bien, et de mieux en mieux...
La liste suivante correspond à des logiciels qui tendent peu ou prou à faire comme MediaSPIP ou que MediaSPIP tente peu ou prou à faire pareil, peu importe ...
On ne les connais pas, on ne les a pas essayé, mais vous pouvez peut être y jeter un coup d’oeil.
Videopress
Site Internet : (...)
Sur d’autres sites (4338)
-
vima : generate predict_table once, and share it with all decoders
25 avril 2013, par Paul B Mahol -
configure : don’t generate a git version number if .git isn’t present
4 septembre 2013, par Sean McGovern -
FFMPEG, want to encode 720x480 and automatically scale to 640x480 or 854x480 as necessary depending on the ratio
2 décembre 2023, par boxyloganEDIT : See appended notes at the bottom of the post.


Note : all MKVs are sourced from my original Farscape Starburst DVDs, MPEG2.
I've been slowly re-encoding my old TV shows into a crisper format and I have for some shows, mainly extras (but also full episodes) MKVs that are a mix of 4:3 and 16:9. Usually I open the files up in Mediainfo and find out which ones are 4:3, stick them in one folder to encode in 640x480, then the same with 16:9. It's worked fine for the umpteen amount of times I've had to encode my shows.
I would like to try to expedite the process with a single FFMPEG command that can automatically detect if the files are 4:3 or 16:9 and encode them properly to 640x480 or 854x480.


My main FFMPEG commands have been these two, depending on which aspect ratio I'm using :


854x480p


`for i in *.mkv; do ffmpeg -i "$i" -c:v libx264 -profile:v main -level:v 4.0 -crf 20 -c:a copy -map 0 -vf scale=854:480,setdar=16/9 encoded/"${i%.mkv}.mkv"; done



640x480p


`for i in *.mkv; do ffmpeg -i "$i" -c:v libx264 -profile:v main -level:v 4.0 -crf 20 -c:a copy -map 0 -vf scale=640:480,setdar=4/3 encoded/"${i%.mkv}.mkv"; done



These two have worked fine lately since I got away from the extraneous -x264-params nonsense I picked up years ago. Again, I'm trying to streamline. I found this command a day ago and it SEEMED to look PERFECT :


`for i in *.mkv; do ffmpeg -i "$i" -c:v libx264 -profile:v main -level:v 4.0 -crf 20 -c:a copy -map 0 -vf scale=w='if(gt(dar,854/480),min(854,iw*sar),2*trunc(iw*sar*oh/ih/2))':h='if(gt(dar,854/480),2*trunc(ih*ow/iw/sar/2),min(480,ih))' encoded/"${i%.mkv}.mkv"; done



Looks perfect and works great for 640x480. The only problem is that it returns 852x480, every time. I even tried a modification I found where you set the setsar=1 AFTER the scale filter, and it does nothing.


These are the first warnings I get when I try to run the command, with a 16:9 video, but it still completes :


`[Parsed_scale_0 @ 0x56299c22fcc0] Circular references detected for width 'if(gt(dar, 854/480), min(854,iw*sar), 2*trunc(iw*sar*oh/ih/2))' and height 'if(gt(dar, 854/480), 2*trunc(ih*ow/iw/sar/2), min(480,ih))' - possibly invalid.
Stream mapping:
 Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264))
 Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[Parsed_scale_0 @ 0x56299c20e5c0] Circular references detected for width 'if(gt(dar, 854/480), min(854,iw*sar), 2*trunc(iw*sar*oh/ih/2))' and height 'if(gt(dar, 854/480), 2*trunc(ih*ow/iw/sar/2), min(480,ih))' - possibly invalid.



It encodes and I can see the resolution it outputs to :


`Stream #0:0(eng): Video: h264 (H264 / 0x34363248), yuv420p(tv, top coded first (swapped)), 852x480 [SAR 1:1 DAR 71:40], q=2-31, 29.97 fps, 1k tbn



The next video is a 4:3 video and gives these warnings, however the video still completes, this time the video encodes properly to 640x480 :
your text


`[Parsed_scale_0 @ 0x5623084d4140] Circular references detected for width 'if(gt(dar, 854/480), min(854,iw*sar), 2*trunc(iw*sar*oh/ih/2))' and height 'if(gt(dar, 854/480), 2*trunc(ih*ow/iw/sar/2), min(480,ih))' - possibly invalid.
Stream mapping:
 Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264))
 Stream #0:1 -> #0:1 (copy)`your text`
Press [q] to stop, [?] for help
[Parsed_scale_0 @ 0x5623084d7080] Circular references detected for width 'if(gt(dar, 854/480), min(854,iw*sar), 2*trunc(iw*sar*oh/ih/2))' and height 'if(gt(dar, 854/480), 2*trunc(ih*ow/iw/sar/2), min(480,ih))' - possibly invalid.



The output details :


`Stream #0:0(eng): Video: h264 (H264 / 0x34363248), yuv420p(tv, top coded first (swapped)), 640x48 [SAR 1:1 `your text`DAR 4:3], q=2-31, 29.97 fps, 1k tbn



TL ;DR


EDIT : The actual problem is that the command is encoding the 16:9 aspect ratio files to 852x480 instead of 854x480. 854x480 is actually what I would like. 640x480 for the 4:3 is fine. Apologies, for the lack of clarification.


Videos encode (from original Farscape Starburst DVDs MPEG2) properly to libx264 640x480 for 4:3 but not to 854x480 for 16:9. 16:9 instead encodes to 852x480, despite what command is telling it to do.


Advice ? Thanks in advance ! Anything to make my re-encoding a little bit less tedious. I've been googling for hours and searching, but nothing seems to make it click. Thank you again !