
Recherche avancée
Médias (2)
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (44)
-
Soumettre améliorations et plugins supplémentaires
10 avril 2011Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...) -
Menus personnalisés
14 novembre 2010, parMediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
Menus créés à l’initialisation du site
Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...) -
Possibilité de déploiement en ferme
12 avril 2011, parMediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)
Sur d’autres sites (9684)
-
FFMPEG - Width/ Height Not Divisible by 2 (Scaling to Generate MBR Output)
15 avril 2020, par Sanjeev PandeyI am trying to generate multilple variants of videos in my library (Mp4 formats) and have renditions planned ranging from 1080p to 240p and popular sizes in between. For that I am taking a video with a AxB resolution and then running through a code (on bash) which scales them to desired following sizes - 
426x240
640x360
842x480
1280x720
1920x1080, with different bitrates of course, and then saves as Mp4 again.



Now, this works just fine if source video has height and width divisible by 2, but code breaks on the following line for the videos with odd width and height :

-vf scale=w=${width}:h=${height}:force_original_aspect_ratio=decrease"



Where 'width' and 'height' are the desired (and hardcoded) for every iteration : E.g. "426x240", and "640x360"



The Error :

[libx264 @ 00000187da2a1580] width not divisible by 2 (639x360)

Error initializing output stream 1:0 -- Error while opening encoder for output stream #1:0 - maybe incorrect parameters such as bit_rate, rate, width or height



Now approaches those are explained in this one doesn't work for me since I am scaling - FFMPEG (libx264) "height not divisible by 2"



And, I tried this one too but it seems all qualities are getting the same size -ffmpeg : width not divisible by 2 (when keep proportions)





- 

- This is how I tried to use this one :
scale='bitand(oh*dar,65534)':'min(${height},ih)'







Kindly suggest how to solve this, keeping in view that :
1. I have a very large library and I can't do manual change for every video
2. I need to scale the video and keep the aspect ratio



Thanks !



PS : [Edit] One way that I can see is padding all of the odd height/ weight videos using a second script in advance. This however doubles my work time and load. I would prefer to keep it in single script. This is the script I see that I can use for padding :
```ffmpeg -r 24 -i -vcodec libx264 -y -an -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2"`` (from : FFMPEG (libx264) "height not divisible by 2")


- This is how I tried to use this one :
-
FFMPEG - Width/ Height Not Divisible by 2 (Scaling to Generate MBR Output)
15 avril 2020, par Sanjeev PandeyI am trying to generate multilple variants of videos in my library (Mp4 formats) and have renditions planned ranging from 1080p to 240p and popular sizes in between. For that I am taking a video with a AxB resolution and then running through a code (on bash) which scales them to desired following sizes - 
426x240
640x360
842x480
1280x720
1920x1080, with different bitrates of course, and then saves as Mp4 again.



Now, this works just fine if source video has height and width divisible by 2, but code breaks on the following line for the videos with odd width and height :

-vf scale=w=${width}:h=${height}:force_original_aspect_ratio=decrease"



Where 'width' and 'height' are the desired (and hardcoded) for every iteration : E.g. "426x240", and "640x360"



The Error :

[libx264 @ 00000187da2a1580] width not divisible by 2 (639x360)

Error initializing output stream 1:0 -- Error while opening encoder for output stream #1:0 - maybe incorrect parameters such as bit_rate, rate, width or height



Now approaches those are explained in this one doesn't work for me since I am scaling - FFMPEG (libx264) "height not divisible by 2"



And, I tried this one too but it seems all qualities are getting the same size -ffmpeg : width not divisible by 2 (when keep proportions)





- 

- This is how I tried to use this one :
scale='bitand(oh*dar,65534)':'min(${height},ih)'







Kindly suggest how to solve this, keeping in view that :
1. I have a very large library and I can't do manual change for every video
2. I need to scale the video and keep the aspect ratio



Thanks !



PS : [Edit] One way that I can see is padding all of the odd height/ weight videos using a second script in advance. This however doubles my work time and load. I would prefer to keep it in single script. This is the script I see that I can use for padding :
```ffmpeg -r 24 -i -vcodec libx264 -y -an -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2"`` (from : FFMPEG (libx264) "height not divisible by 2")


- This is how I tried to use this one :
-
PowerShell script FFMPEG HLS with Multiple Audio and Sub Tracks
5 mai 2020, par LordFenixNCI am Currently using a custom script to convert video files to multi resolution HLS. I have just switched to a Newer web player that will allow me to support Subtitle Tracks and Audio tracks selections. I am having a hard time figuring out how to edit my script to take a MKV and strip all the audio sources and subtitle sources and adding it to the INDEX.M3U8



My Current Script



$sw = [Diagnostics.Stopwatch]::StartNew()
$files = Get-ChildItem ${Get-Location}
$loco = Get-Location
$p1 = Join-Path -Path $loco -ChildPath "/out"
echo $p1
New-Item -ItemType Directory -Force -Path $p1
foreach ($f in $files){ 
$p2 = Join-Path -Path $loco -ChildPath "/out/" | Join-Path -ChildPath $f
$sb = [System.Text.StringBuilder]::new();
[void]$sb.AppendLine( '#EXTM3U' )
[void]$sb.AppendLine( '#EXT-X-VERSION:3' )
[void]$sb.AppendLine( '#EXT-X-STREAM-INF:BANDWIDTH=800000,RESOLUTION=640x360' )
[void]$sb.AppendLine( '360p.m3u8' )
[void]$sb.AppendLine( '#EXT-X-STREAM-INF:BANDWIDTH=1400000,RESOLUTION=842x480' )
[void]$sb.AppendLine( '480.m3u8' )

New-Item -ItemType Directory -Force -Path $p2
$resStr = ffprobe -v error -select_streams v:0 -show_entries stream=height -of csv=s=x:p=0 $f.FullName;
$res = [convert]::ToInt32($resStr)
#ffmpeg -i $f.FullName -c:a copy -vf scale=w=640:h=360:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -rc cqp -qp_p 0 -qp_i 1 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 800k -maxrate 856k -bufsize 1200k -b:a 96k -hls_segment_filename out/$f/360p_%03d.ts out/$f/360p.m3u8 -vf scale=w=842:h=480:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -gpu 1 -c:v h264_amf -rc cqp -qp_p 0 -qp_i 1 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 1400k -maxrate 1498k -bufsize 2100k -b:a 128k -hls_segment_filename out/$f/480p_%03d.ts out/$f/480p.m3u8 -vf scale=w=1280:h=720:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -gpu 1 -c:v h264_amf -rc cqp -qp_p 0 -qp_i 1 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 2800k -maxrate 2996k -bufsize 4200k -b:a 128k -hls_segment_filename out/$f/720p_%03d.ts out/$f/720p.m3u8 -vf scale=w=1920:h=1080:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -gpu 1 -c:v h264_amf -rc cqp -qp_p 0 -qp_i 1 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 5000k -maxrate 5350k -bufsize 7500k -b:a 192k -hls_segment_filename out/$f/1080p_%03d.ts out/$f/1080p.m3u8
#ffmpeg -hwaccel auto -hwaccel_device 0 -i $f.FullName -c:v h264 -profile:v main -c:a aac -filter:v scale=360:640 -ar 48000 -rc cqp -qp_p 0 -qp_i 1 -profile:v main -crf 23 -sc_threshold 0 -g 48 -b:v 800k -maxrate 856k -bufsize 1200k -b:a 96k -keyint_min 4 -start_number 0 -hls_time 10 -hls_playlist_type vod -hls_list_size 0 -f hls -hls_segment_filename out/$f/360p_%03d.ts out/$f/360p.m3u8 
ffmpeg -hwaccel auto -hwaccel_device 0 -i $f.FullName -c:v h264_nvenc -b:v 200k -minrate 100k -maxrate 896k -profile:v main -c:a aac -filter:v scale=-1:360 -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename out/$f/360p_%03d.ts out/$f/360p.m3u8 
ffmpeg -hwaccel auto -hwaccel_device 0 -i $f.FullName -c:v h264_nvenc -b:v 1000k -minrate 896k -maxrate 1536k -profile:v main -c:a aac -filter:v scale=-1:480 -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename out/$f/480p_%03d.ts out/$f/480p.m3u8
If($res -ge 720) {
 ffmpeg -hwaccel auto -hwaccel_device 0 -i $f.FullName -c:v h264_nvenc -b:v 2232k -minrate 1856k -maxrate 2872k -profile:v main -c:a aac -filter:v scale=-1:720 -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename out/$f/720p_%03d.ts out/$f/720p.m3u8
 [void]$sb.AppendLine( '#EXT-X-STREAM-INF:BANDWIDTH=2800000,RESOLUTION=1280x720' )
 [void]$sb.AppendLine( '720p.m3u8' )
} 
If($res -ge 1080) {
 ffmpeg -hwaccel auto -hwaccel_device 0 -i $f.FullName -c:v h264_nvenc -b:v 4632k -minrate 3712k -maxrate 5552k -profile:v main -c:a aac -filter:v scale=-1:1080 -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename out/$f/1080p_%03d.ts out/$f/1080p.m3u8
 [void]$sb.AppendLine( '#EXT-X-STREAM-INF:BANDWIDTH=5000000,RESOLUTION=1920x1080' )
 [void]$sb.AppendLine( '1080p.m3u8' )
}

$p3 = Join-Path -Path $p2 -ChildPath "/index.m3u8"
#echo $index | Out-File -Encoding UTF8 -LiteralPath $p3
echo $sb.ToString()
[System.IO.File]::WriteAllLines($p3, $sb.ToString().Trim().replace("`r`n", "`n"))
 }
 $sw.Stop()
 echo $sw.Elapsed