Recherche avancée

Médias (1)

Mot : - Tags -/bug

Autres articles (29)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une 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 (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • MediaSPIP Player : problèmes potentiels

    22 février 2011, par

    Le lecteur ne fonctionne pas sur Internet Explorer
    Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
    Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)

Sur d’autres sites (4219)

  • Prevent ffmpeg from changing the intensity of colors while downscaling the resolution of the video

    29 août 2022, par dravit

    I have a use case where I need to downscale a 716x1280 mp4 video to 358x640 (half of the original). Command that I used is

    


    ffmpeg -i ./input.mp4 -vf "scale=640:640:force_original_aspect_ratio=decrease,pad=ceil(iw/2)*2:ceil(ih/2)*2" ./output.mp4


    


    Out of 10 sample videos, 2 of the them suffered impact on colors. Below I have attached a comparison from the one which was impacted the most.

    


    Comparison of frames from the most impacted video

    


    NOTE : The one on the right is a frame from the original video and the frame on the left is the one from the processed (down scaled) video. Notice the colors red and green in the image (even the skin color and hair color were changed).

    


    What I am looking for is

    


      

    • Is there any way I can prevent changes like these happening ? Probably some flag on saturation, brightness, contrast or any other parameter.
    • 


    • I am assuming that ffmpeg uses some default settings while downscaling a video. What made ffmpeg change colors only for these two videos ? If it made similar changes for the rest of the videos as well, how to predict this behaviour before hand ?
    • 


    


    EDIT :

    


    What I already have Tried ?

    


      

    • -crf with values 0 and 18.
    • 


    • -preset veryslow as mentioned here
    • 


    


    None helped

    


    Mediainfo input V/S output

    


    





    


    


    


    


    


    



    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    param input output
    color range Limited NA (attribute not in description)
    color primaries BT.2020 NA (attribute not in description)
    transfer characteristics HLG NA (attribute not in description)
    matrix coefficients BT.2020 non-constant NA (attribute not in description)
    bit deapth 8 8

    


    


    Logs of the ffmpeg command

    


    ffmpeg -i ./input.mp4 -vf "scale=640:640:force_original_aspect_ratio=decrease,pad=ceil(iw/2)*2:ceil(ih/2)*2" -movflags +faststart ./output.mp4
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with Apple clang version 12.0.0 (clang-1200.0.32.28)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_9 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './input.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.45.100
  Duration: 00:00:30.05, start: 0.000000, bitrate: 10366 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt2020nc/bt2020/arib-std-b67), 716x1280, 10116 kb/s, 30 fps, 30 tbr, 19200 tbn, 38400 tbc (default)
    Metadata:
      handler_name    : Core Media Video
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 245 kb/s (default)
    Metadata:
      handler_name    : Core Media Audio
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 @ 0x7faab4808800] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7faab4808800] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 0x7faab4808800] 264 - core 161 r3027 4121277 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.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=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=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=25 scenecut=40 intra_refresh=0 rc_lookahead=40 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 './output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.45.100
    Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 358x640, q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
    Metadata:
      handler_name    : Core Media Video
      encoder         : Lavc58.91.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : Core Media Audio
      encoder         : Lavc58.91.100 aac
[mp4 @ 0x7faab5808800] Starting second pass: moving the moov atom to the beginning of the file
frame=  901 fps=210 q=-1.0 Lsize=    3438kB time=00:00:30.02 bitrate= 938.0kbits/s speed=7.01x
video:2933kB audio:472kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.974633%
[libx264 @ 0x7faab4808800] frame I:6     Avg QP:22.60  size: 20769
[libx264 @ 0x7faab4808800] frame P:228   Avg QP:24.84  size:  7657
[libx264 @ 0x7faab4808800] frame B:667   Avg QP:27.59  size:  1697
[libx264 @ 0x7faab4808800] consecutive B-frames:  0.9%  0.9%  1.0% 97.2%
[libx264 @ 0x7faab4808800] mb I  I16..4:  9.5% 64.6% 26.0%
[libx264 @ 0x7faab4808800] mb P  I16..4:  2.5% 12.2%  2.5%  P16..4: 37.2% 20.6% 11.2%  0.0%  0.0%    skip:13.7%
[libx264 @ 0x7faab4808800] mb B  I16..4:  0.4%  2.1%  0.2%  B16..8: 42.2%  7.1%  1.2%  direct: 1.8%  skip:44.9%  L0:39.4% L1:52.8% BI: 7.8%
[libx264 @ 0x7faab4808800] 8x8 transform intra:72.2% inter:74.2%
[libx264 @ 0x7faab4808800] coded y,uvDC,uvAC intra: 61.8% 67.2% 20.2% inter: 16.7% 13.9% 1.3%
[libx264 @ 0x7faab4808800] i16 v,h,dc,p: 24% 19%  7% 50%
[libx264 @ 0x7faab4808800] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 16% 15%  6%  9% 11%  7% 10%  6%
[libx264 @ 0x7faab4808800] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 16% 13%  7%  9% 10%  7%  9%  4%
[libx264 @ 0x7faab4808800] i8c dc,h,v,p: 53% 16% 26%  5%
[libx264 @ 0x7faab4808800] Weighted P-Frames: Y:3.9% UV:1.8%
[libx264 @ 0x7faab4808800] ref P L0: 57.8% 19.5% 14.8%  7.8%  0.1%
[libx264 @ 0x7faab4808800] ref B L0: 90.7%  7.2%  2.1%
[libx264 @ 0x7faab4808800] ref B L1: 95.3%  4.7%
[libx264 @ 0x7faab4808800] kb/s:799.80
[aac @ 0x7faab2036a00] Qavg: 189.523


    


  • arm : vp9itxfm : Do a simpler half/quarter idct16/idct32 when possible

    22 novembre 2016, par Martin Storsjö
    arm : vp9itxfm : Do a simpler half/quarter idct16/idct32 when possible
    

    This work is sponsored by, and copyright, Google.

    This avoids loading and calculating coefficients that we know will
    be zero, and avoids filling the temp buffer with zeros in places
    where we know the second pass won’t read.

    This gives a pretty substantial speedup for the smaller subpartitions.

    The code size increases from 12388 bytes to 19784 bytes.

    The idct16/32_end macros are moved above the individual functions ; the
    instructions themselves are unchanged, but since new functions are added
    at the same place where the code is moved from, the diff looks rather
    messy.

    Before : Cortex A7 A8 A9 A53
    vp9_inv_dct_dct_16x16_sub1_add_neon : 273.0 189.5 212.0 235.8
    vp9_inv_dct_dct_16x16_sub2_add_neon : 2102.1 1521.7 1736.2 1265.8
    vp9_inv_dct_dct_16x16_sub4_add_neon : 2104.5 1533.0 1736.6 1265.5
    vp9_inv_dct_dct_16x16_sub8_add_neon : 2484.8 1828.7 2014.4 1506.5
    vp9_inv_dct_dct_16x16_sub12_add_neon : 2851.2 2117.8 2294.8 1753.2
    vp9_inv_dct_dct_16x16_sub16_add_neon : 3239.4 2408.3 2543.5 1994.9
    vp9_inv_dct_dct_32x32_sub1_add_neon : 758.3 456.7 864.5 553.9
    vp9_inv_dct_dct_32x32_sub2_add_neon : 10776.7 7949.8 8567.7 6819.7
    vp9_inv_dct_dct_32x32_sub4_add_neon : 10865.6 8131.5 8589.6 6816.3
    vp9_inv_dct_dct_32x32_sub8_add_neon : 12053.9 9271.3 9387.7 7564.0
    vp9_inv_dct_dct_32x32_sub12_add_neon : 13328.3 10463.2 10217.0 8321.3
    vp9_inv_dct_dct_32x32_sub16_add_neon : 14176.4 11509.5 11018.7 9062.3
    vp9_inv_dct_dct_32x32_sub20_add_neon : 15301.5 12999.9 11855.1 9828.2
    vp9_inv_dct_dct_32x32_sub24_add_neon : 16482.7 14931.5 12650.1 10575.0
    vp9_inv_dct_dct_32x32_sub28_add_neon : 17589.5 15811.9 13482.8 11333.4
    vp9_inv_dct_dct_32x32_sub32_add_neon : 18696.2 17049.2 14355.6 12089.7

    After :
    vp9_inv_dct_dct_16x16_sub1_add_neon : 273.0 189.5 211.7 235.8
    vp9_inv_dct_dct_16x16_sub2_add_neon : 1203.5 998.2 1035.3 763.0
    vp9_inv_dct_dct_16x16_sub4_add_neon : 1203.5 998.1 1035.5 760.8
    vp9_inv_dct_dct_16x16_sub8_add_neon : 1926.1 1610.6 1722.1 1271.7
    vp9_inv_dct_dct_16x16_sub12_add_neon : 2873.2 2129.7 2285.1 1757.3
    vp9_inv_dct_dct_16x16_sub16_add_neon : 3221.4 2520.3 2557.6 2002.1
    vp9_inv_dct_dct_32x32_sub1_add_neon : 753.0 457.5 866.6 554.6
    vp9_inv_dct_dct_32x32_sub2_add_neon : 7554.6 5652.4 6048.4 4920.2
    vp9_inv_dct_dct_32x32_sub4_add_neon : 7549.9 5685.0 6046.9 4925.7
    vp9_inv_dct_dct_32x32_sub8_add_neon : 8336.9 6704.5 6604.0 5478.0
    vp9_inv_dct_dct_32x32_sub12_add_neon : 10914.0 9777.2 9240.4 7416.9
    vp9_inv_dct_dct_32x32_sub16_add_neon : 11859.2 11223.3 9966.3 8095.1
    vp9_inv_dct_dct_32x32_sub20_add_neon : 15237.1 13029.4 11838.3 9829.4
    vp9_inv_dct_dct_32x32_sub24_add_neon : 16293.2 14379.8 12644.9 10572.0
    vp9_inv_dct_dct_32x32_sub28_add_neon : 17424.3 15734.7 13473.0 11326.9
    vp9_inv_dct_dct_32x32_sub32_add_neon : 18531.3 17457.0 14298.6 12080.0

    Signed-off-by : Martin Storsjö <martin@martin.st>

    • [DBH] libavcodec/arm/vp9itxfm_neon.S
  • 400 Bad Request Error uploading paperclip videos

    5 mars 2017, par jalen201

    Im trying to upload videos with paperclip. When i hit the submit button i receive.

    RSolr::Error::Http - 400 Bad Request Error:

    this is the migration

    class AddAttachmentVideoToPins &lt; ActiveRecord::Migration
     def self.up
       change_table :pins do |t|
         t.attachment :video
       end
     end

     def self.down
       remove_attachment :pins, :video
     end
    end

    Heres the model

    class Pin &lt; ApplicationRecord
     acts_as_votable
     belongs_to :user
     has_many :comments

     searchable do
       text :title, :boost => 5
       text :description
     end

     has_attached_file :image, styles: {medium: "300x300>" }
     validates_attachment_content_type :image, content_type: /\Aimage\/.*\z/

     has_attached_file :video, styles: {
       :medium => {
         :geometry => "640x480",
         :format => 'mp4'
       },
       :thumb => {
         :geometry => "160x120", :format => 'jpeg', :time => 10
       }
     },
     :processors => [:transcoder]

     validates_attachment_content_type :video, content_type:  /\Avideo\/.*\Z/

    also i added these 4 gems, and installed ffmpeg with homebrew

       gem 'paperclip', '~> 5.1'

       gem 'aws-sdk', '~> 2.8'

       gem 'paperclip-av-transcoder', '~> 0.6.4'

       gem 'paperclip-ffmpeg', '~> 1.2'

    lastly this is my controller, i added :video as a strong parameter.

    class PinsController &lt; ApplicationController

     before_action :find_pin, only: [:show,:edit,:update,:destroy, :upvote]
     before_action :authenticate_user!, except: [:index,:show]

     def index
       @search = Pin.search do
         fulltext params[:search]
       end
       @pins = @search.results
     end

     def new
       @pin = current_user.pins.build
     end

     def show
       @comments = Comment.where(pin_id: @pin).order('created_at DESC')
     end

     def edit
       @lookup = User.all
     end

     def profile
       @users = User.all
       if User.find_by_username(params[:id])
         @username = params[:id]
         @user = User.find_by_username(params[:id])
       else
         redirect_to root_path
       end
       @user_pin = Pin.all.where('user_id = ?',       User.find_by_username(params[:id]).id)
     end

     def update
       if @pin.update(pin_params)
         redirect_to @pin, notice: "Pin was succesfully updated"
       else
         render 'edit'
       end
     end

     def destroy
       @pin.destroy
       redirect_to root_path      
     end

     def upvote
       @pin.upvote_by current_user
       redirect_to :back
     end

     def create
       @pin = current_user.pins.build (pin_params)

       if @pin.save
         redirect_to @pin , notice: "Succesfully created new pin"
       else
         render 'new'
       end
     end

     private

     def pin_params
       params.require(:pin).permit(:title, :description, :image, :video)
     end

     def find_pin
       @pin = Pin.find(params[:id])
     end
    end

    i added this in the view

    &lt;%= video_tag @pin.video.url(:medium), controls: true, style: "max-width: 100%;" %>

    If anyone could help that would be greatly appreciated