
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (60)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...) -
Selection of projects using MediaSPIP
2 mai 2011, parThe examples below are representative elements of MediaSPIP specific uses for specific projects.
MediaSPIP farm @ Infini
The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)
Sur d’autres sites (5512)
-
FFMPEG HLS multiple Tracks not in sync
2 juin 2020, par LordFenixNCThis script works but the video doesnt sync with the sub or audio tracks. Could someone help fix this or Help me with a NEW script. I have been trying to figure this out with 0 luck and have had friends look at it. I even went to FFMPEG discord and FB asking for help from others who have posted scripts in the past. Seems no one has a interest in this. Please will someone help me.



All I am trying to do is BULK encode MKVs to HLS with multiple resoutions in 10 sec segments and include all the Audio and SUb tracks that were originally in the MKV



$files = Get-ChildItem ${Get-Location}
$loco = Get-Location
$p1 = Join-Path -Path $loco -ChildPath "/out"
New-Item -ItemType Directory -Force -Path $p1



function lnCodeTransform {
 param( $String )
 echo $String
 switch ($String)
 {
 "jpn" {"jp"}
 "eng" {"en"}
 "esp" {"es"}
 "fra" {"fr"}
 "deu" {"de"}
 default {$String}
 }
}


function lnNameTransform {
 param( $String )
 switch ($String)
 {
 "jpn" {"Japanese"}
 "eng" {"English"}
 "esp" {"Spanish"}
 "fra" {"French"}
 "deu" {"German"}
 default {$String}
 }
}


foreach ($f in $files){ 
 if ($f.Name -eq "out"){
 continue;
 }
 $p2 = Join-Path -Path $loco -ChildPath "/out/" | Join-Path -ChildPath $f
 New-Item -ItemType Directory -Force -Path $p2/audio
 New-Item -ItemType Directory -Force -Path $p2/video
 New-Item -ItemType Directory -Force -Path $p2/subtitle
 $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' )


 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)
 $audioTracks = ffprobe $f.FullName -show_entries stream=index:stream_tags=language -select_streams a -of compact=p=0:nk=1 
 $audioTracks = $audioTracks.split("\n")
 foreach($audio in $audioTracks) {
 $ID = $audio.split("|")[0];
 $audioName = $audio.split("|")[1];
 ffmpeg -i $f.FullName -threads 0 -muxdelay 0 -y -map 0:$ID -async 1 -codec aac -f segment -segment_time 10 -segment_list_size 0 -segment_list out/$f/audio/audio_"$ID.m3u8" -segment_format mpegts out/$f/audio/"audio_$ID""_%d.ts"
 $name = lnNameTransform($audioName)
 $code = lnCodeTransform($audioName)
 [void]$sb.AppendLine( "#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID=`"aac`",LANGUAGE=`"$code`",NAME=`"$name`",DEFAULT=NO,AUTOSELECT=NO,URI=`"audio/audio_$ID.m3u8`"" )
 }
 $subTracks = ffprobe $f.FullName -show_entries stream=index:stream_tags=language -select_streams s -of compact=p=0:nk=1 
 $subTracks = $subTracks.split("")
 foreach($subtitle in $subTracks) {
 $ID = $subtitle.split("|")[0];
 $subName = $subtitle.split("|")[1];
 ffmpeg -i $f.FullName -map 0:$ID -f segment -segment_time 10 -segment_list_size 0 -segment_list out/$f/subtitle/sub_"$subName.m3u8" -segment_format webvtt -scodec webvtt out/$f/subtitle/"sub_$subName%d.vtt"
 $name = lnNameTransform($subName)
 $code = lnCodeTransform($subName)
 [void]$sb.AppendLine( "#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID=`"subs`",LANGUAGE=`"$code`",NAME=`"$name`",FORCED=NO,AUTOSELECT=NO,URI=`"subtitle/sub_$subName.m3u8`"" )
 }

 [void]$sb.AppendLine( '#EXT-X-STREAM-INF:BANDWIDTH=1400000,CODECS="avc1.4d4015,mp4a.40.2",RESOLUTION=842x480,AUDIO="aac",SUBTITLES="subs"' )
 [void]$sb.AppendLine( 'video/480p.m3u8' )
 #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 -profile:v main -c:a aac -filter:v scale=360:640 -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 -i $f.FullName -c:v h264 -async 1 -profile:v main -y -filter:v scale="trunc(oh*a/2)*2:480" -map 0:v -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename out/$f/video/480p_%03d.ts out/$f/video/480p.m3u8
 If($res -ge 720) {
 ffmpeg -i $f.FullName -c:v h264 -profile:v main -filter:v scale="trunc(oh*a/2)*2:720" -map 0:v -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename out/$f/video/720p_%03d.ts out/$f/video/720p.m3u8
 [void]$sb.AppendLine( '#EXT-X-STREAM-INF:BANDWIDTH=2800000,CODECS="avc1.4d4015,mp4a.40.2",RESOLUTION=1280x720,AUDIO="aac",SUBTITLES="subs"' )
 [void]$sb.AppendLine( 'video/720p.m3u8' )
 } 
 If($res -ge 1080) {
 ffmpeg -i $f.FullName -c:v h264 -profile:v main -filter:v scale="trunc(oh*a/2)*2:1080" -map 0:v -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename out/$f/video/1080p_%03d.ts out/$f/video/1080p.m3u8
 [void]$sb.AppendLine( '#EXT-X-STREAM-INF:BANDWIDTH=5000000,CODECS="avc1.4d4015,mp4a.40.2",RESOLUTION=1920x1080,AUDIO="aac",SUBTITLES="subs"' )
 [void]$sb.AppendLine( 'video/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 ``` 



-
Paperclip with heroku and paperclip, migration fails
2 décembre 2013, par jdartlandI have a created ruby on rails application and I'm using paperclip to handle my file uploads.
Paperclip works just fine on my local machine. But my video upload stops working when I deploy to Heroku. Does anyone know whats going wrong. I also get an error when I try to upload a video which says that the video filename does not exist. The photo upload works but not the Video, I'm using paperclip iwth nested attributes and ffmpeg.Upload Error log :
Paperclip::Error (Asset model missing required attr_accessor for 'video_file_name')
2013-12-02T14:38:16.867747+00:00 app[web.1]: Paperclip::Error (Asset model missing required attr_accessor for 'video_file_name'):
2013-12-02T14:38:16.867747+00:00 app[web.1]: app/controllers/projects_controller.rb:60:in `block in update'
2013-12-02T14:38:16.867747+00:00 app[web.1]: app/controllers/projects_controller.rb:59:in `update'Here is my migration error :
Migrating to AddAttachmentPhotoToAssets (20131021134721)
== AddAttachmentPhotoToAssets: migrating =====================================
-- change_table(:assets)
-> 0.0273s
== AddAttachmentPhotoToAssets: migrated (0.0276s) ============================
Migrating to AddProjectIdToAssets (20131022082744)
-- add_column(:assets, :project_id, :integer)
PG::DuplicateColumn: ERROR: column "project_id" of relation "assets" already exists
: ALTER TABLE "assets" ADD COLUMN "project_id" integer
-- add_column(:assets, :project_id, :integer)
PG::DuplicateColumn: ERROR: column "project_id" of relation "assets" already exists
: ALTER TABLE "assets" ADD COLUMN "project_id" integer
rake aborted!
PG::DuplicateColumn: ERROR: column "project_id" of relation "assets" already exists
: ALTER TABLE "assets" ADD COLUMN "project_id" integer
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `exec'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `block in execute'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:425:in `block in log'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:420:in `log'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:127:in `execute'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:360:in `add_column'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql/schema_statements.rb:379:in `add_column'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:625:in `block in method_missing'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:597:in `block in say_with_time'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:597:in `say_with_time'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:617:in `method_missing'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:383:in `method_missing'
/app/db/migrate/20131022082744_add_project_id_to_assets.rb:2:in `'
/app/db/migrate/20131022082744_add_project_id_to_assets.rb:1:in `<top>'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:718:in `load_migration'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:714:in `migration'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:708:in `disable_ddl_transaction'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:1012:in `use_transaction?'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:922:in `rescue in block in migrate'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:919:in `block in migrate'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:916:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:916:in `migrate'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:764:in `up'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:742:in `migrate'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/railties/databases.rake:42:in `block (2 levels) in <top>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
</top></top>Here is my table :
create_table "assets", force: true do |t|
t.datetime "created_at"
t.datetime "updated_at"
t.string "photo_file_name"
t.string "photo_content_type"
t.integer "photo_file_size"
t.datetime "photo_updated_at"
t.integer "project_id"
t.string "video_file_name"
t.string "video_content_type"
t.integer "video_file_size"
t.datetime "video_updated_at"
end
add_index "projects", ["permalink"], name: "index_projects_on_permalink", using: :btree
create_table "settings", force: true do |t|
t.string "title"
t.text "description"
t.text "paragraph"
t.datetime "created_at"
t.datetime "updated_at"
t.string "photo_file_name"
t.string "photo_content_type"
t.integer "photo_file_size"
t.datetime "photo_updated_at"
t.string "video_file_name"
t.string "video_content_type"
t.integer "video_file_size"
t.datetime "video_updated_at"
endWould gladly need some help ! :)
-
Upper limit on FFMPEG/libx264 frame sizes ?
22 mars 2014, par ChaoticI'm trying to use FFMPEG to transcode a video with very large frames (4096 x 4096). It's a short video - just under two minutes, but the source video file is 15.8GB. (The video is an animation designed to be projected onto planetarium domes.)
The source file is a Quicktime MOV containing uncompressed Photo-JPEG images (with audio, too). When I tell FFMPEG to transcode my MOV file into an MP4 file, it simply says :
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Not very helpful, but yes, I've verified that all of the parameters are correct and/or defaults. In fact, if I change the requested output size to 2048x2048, then everything works just fine. That's why I suspect that there's an upper bound in the encoder.
I am kerflummoxed. Any suggestions that result in a successful transcode will be greatly appreciated. (At this point I am also willing to consider alternatives to FFMPEG.)
The Facts
I run FFMPEG from a script :
set srcFile=%1
set dstFile=%srcFile:.mov=.mp4%
ffmpeg -i %srcFile% -movflags faststart -q:a 0 -q:v 0 -pix_fmt yuv420p -sws_flags gauss -s 4096x4096 %dstFile%The Output
ffmpeg version N-50911-g9efcfbe Copyright (c) 2000-2013 the FFmpeg developers
built on Mar 13 2013 21:26:48 with gcc 4.7.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --ena
ble-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 19.100 / 52. 19.100
libavcodec 55. 0.100 / 55. 0.100
libavformat 55. 0.100 / 55. 0.100
libavdevice 54. 4.100 / 54. 4.100
libavfilter 3. 45.103 / 3. 45.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'also-sprach-zarathustra-4k.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2013-01-11 23:41:30
Duration: 00:01:40.57, start: 0.000000, bitrate: 1357694 kb/s
Stream #0:0(eng): Audio: pcm_s16be (twos / 0x736F7774), 44100 Hz, stereo, s16, 1411 kb/s
Metadata:
creation_time : 2013-01-11 23:41:30
handler_name : Apple Alias Data Handler
Stream #0:1(eng): Video: mjpeg (jpeg / 0x6765706A), yuvj420p, 4096x4096 [SAR 1:1 DAR 1:1], 1356281 kb/s, 30 fps, 30
tbr, 3k tbn, 3k tbc
Metadata:
creation_time : 2013-01-11 23:41:30
handler_name : Apple Alias Data Handler
File 'also-sprach-zarathustra-4k.mp4' already exists. Overwrite ? [y/N] y
using SAR=1/1
[libx264 @ 003b9c80] frame MB size (256x256) > level limit (36864)
[libx264 @ 003b9c80] DPB size (4 frames, 262144 mbs) > level limit (2 frames, 184320 mbs)
[libx264 @ 003b9c80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI1 BMI2
x264 [error]: malloc of size 17305600 failed
Output #0, mp4, to 'also-sprach-zarathustra-4k.mp4':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
Stream #0:0(eng): Video: h264, yuv420p, 4096x4096 [SAR 1:1 DAR 1:1], q=-1--1, 90k tbn, 30 tbc
Metadata:
creation_time : 2013-01-11 23:41:30
handler_name : Apple Alias Data Handler
Stream #0:1(eng): Audio: none, 44100 Hz, stereo, s16, 128 kb/s
Metadata:
creation_time : 2013-01-11 23:41:30
handler_name : Apple Alias Data Handler
Stream mapping:
Stream #0:1 -> #0:0 (mjpeg -> libx264)
Stream #0:0 -> #0:1 (pcm_s16be -> libvo_aacenc)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or heightPS : Yes, for those playing at home, it is the theme to 2001 - A Space Odyssey. You can see a 1K YouTube version here : 2001 - A Fulldome Space Odyssey And yes, in a planetarium with a good sound system, it is absolutely EPIC.