
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (59)
-
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
Demande de création d’un canal
12 mars 2010, parEn fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...) -
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)
Sur d’autres sites (6549)
-
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



-
ffmpeg : Encoding a single live video stream into different resolutions and keeping them in sync
15 mai 2020, par AlmusI'm using NGINX as a simple HLS live video server. Sending an rtmp stream into the server, transcoding it into three different resolutions for delivery using HLS to users with different bandwidth limits.



The problem I'm having is that when I take the 1080p 30fps input transcode it down to 480p and 720p then split it into chunks with HLS the segments from the two transcoded outputs are not in sync with the copied full resolution stream.



here is what I am doing now :
exec FFmpeg on the source rtmp stream :



exec ffmpeg -i rtmp://127.0.0.1:1935/live/$name
 -c:v libx264 -c:a aac -b:a 128k -vf "scale=-2:720" -vsync 1 -copyts -start_at_zero -sws_flags lanczos -r 30 -g 30 -keyint_min 30 -force_key_frames "expr:gte(t,n_forced*1)" -tune zerolatency -preset ultrafast -crf 28 -maxrate 2096k -bufsize 4192k -threads 16 -f flv rtmp://localhost:1935/show/$name_720
 -c:v libx264 -c:a aac -b:a 96k -vf "scale=-2:480" -vsync 1 -copyts -start_at_zero -sws_flags lanczos -r 30 -g 30 -keyint_min 30 -force_key_frames "expr:gte(t,n_forced*1)" -tune zerolatency -preset ultrafast -crf 28 -maxrate 1200k -bufsize 2400k -threads 16 -f flv rtmp://localhost:1935/show/$name_480
 -c copy -vsync 1 -f flv rtmp://localhost:1935/show/$name_src;




Then take the results and segment them for HLS



hls on;
hls_path /var/www/live-adapt;
hls_nested on;
hls_fragment 1;
hls_playlist_length 30;

hls_fragment_naming system;

hls_variant _480 BANDWIDTH=1200000; # Medium bitrate, SD resolution
hls_variant _720 BANDWIDTH=2048000; # High bitrate, HD 720p resolution
hls_variant _src BANDWIDTH=4096000; # Source bitrate, source resolution




This is working except the streams are not in sync which causes issues if the end-users need to (or choose to) switch between streams.
Example :



Sequence number 510 was not everywhere in sync:
PTS 510.7 for https://fqdn/live-adapt/c5d7ddb2-5562-4bd3-9e06-df9fa6e8ff06_480/1589521352937.ts
PTS 510.7 for https://fqdn/live-adapt/c5d7ddb2-5562-4bd3-9e06-df9fa6e8ff06_720/1589521352933.ts
PTS 511.699 for https://fqdn/live-adapt/c5d7ddb2-5562-4bd3-9e06-df9fa6e8ff06_src/1589521353752.ts




I would love any advice or suggestions.


-
What are good settings for transcoding videos uploaded to my app ?
14 mai 2020, par Dmitry MinkovskyI am working on an app that allows users to share videos. The problem is that many videos are very high bitrate. For example, A 4-minute H264 video from an old iPhone is encoded at 1080p and runs 17,000 kb/s ( 500 megabytes). Accepting and distributing such videos at this bitrate/resolution is not practical for a social application.



I have been playing with ffmpeg to transcode videos to smaller sizes and higher compression, but have not achieved acceptable results. For example :



ffmpeg \
 -i in.mov \
 -vf scale=w='if(gt(iw\,ih)\,780\,-2)':h='if(gt(iw\,ih)\,-2\,780)' \ 
 -c:v libx264 \
 -crf 28 \
 -preset medium \
 -pix_fmt yuv420p \
 -movflags +faststart \
 out.mp4




This command transcodes the above-mentioned 500MB file down to 70MB. It scales the larger dimension of the video to 780 pixels and compresses the video quite a bit. The results are okay, but the file is still large.



Taking the longer dimension down to 480 pixels, the file is reduced to 40MB. Still quite large, and now significantly degraded. Also, the transcoding still takes quite a long time : about 1-1.5x on my 4 year old i7 Macbook Pro with 16GB RAM.



I'm not sure how to improve on this. H265 is not supported in browsers. I am wondering :



- 

- How can I reduce size further ?
- How can I transcode faster than 1x without significantly reducing quality ? Even 2-3x doesn't seem great ?







Is this as good as it gets ?