Recherche avancée

Médias (21)

Mot : - Tags -/Nine Inch Nails

Autres articles (64)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

Sur d’autres sites (7887)

  • Paperclip with heroku and paperclip, migration fails

    2 décembre 2013, par jdartland

    I 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>&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:718:in `load_migration&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:714:in `migration&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:708:in `disable_ddl_transaction&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:1012:in `use_transaction?&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:922:in `rescue in block in migrate&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:919:in `block in migrate&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:916:in `each&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:916:in `migrate&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:764:in `up&#39;
    /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:742:in `migrate&#39;
    /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>&#39;
    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"
     end

    Would gladly need some help ! :)

  • nodejs aws lambda ffmpeg command failure

    14 juin 2022, par mozenge

    Im running an ffmpeg command to generate a thumbnail from a video that exists on aws s3 bucket but accessed from cloud front. So i try to stream the video in the command. This is implemented in nodejs and the ffmpeg dependency is a lambda layer. The code looks like so

    &#xA;

    const gifName = `${baseFilename}.gif`;&#xA;await execPromise(`ffmpeg -t 10 -ss 00:00:01 -i "${_url}" ${&#x27;/tmp/&#x27; &#x2B; gifName}`);&#xA;

    &#xA;

    _url is a clound front url. This works when i test locally even via aws SAM cli.&#xA;But this fails when testing the deployed fuction. The error output I get is as follows

    &#xA;

    2022-06-13T14:07:41.079Z    35af32d2-c63f-4942-abce-3ae7dad2a6c3    INFO    stderr:  ffmpeg version 5.0.1-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2022 the FFmpeg developers&#xA;  built with gcc 8 (Debian 8.3.0-6)&#xA;  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg&#xA;  libavutil      57. 17.100 / 57. 17.100&#xA;  libavcodec     59. 18.100 / 59. 18.100&#xA;  libavformat    59. 16.100 / 59. 16.100&#xA;  libavdevice    59.  4.100 / 59.  4.100&#xA;  libavfilter     8. 24.100 /  8. 24.100&#xA;  libswscale      6.  4.100 /  6.  4.100&#xA;  libswresample   4.  3.100 /  4.  3.100&#xA;  libpostproc    56.  3.100 / 56.  3.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;https://d17yrtgi5800rj.cloudfront.net/staging/videos/a66a92eb-bc31-4440-958c-07ee23e55bcb&#x27;:&#xA;  Metadata:&#xA;    major_brand     : qt  &#xA;    minor_version   : 0&#xA;    compatible_brands: qt  &#xA;    creation_time   : 2022-05-03T19:50:01.000000Z&#xA;    com.apple.quicktime.location.accuracy.horizontal: 4.732124&#xA;    com.apple.quicktime.location.ISO6709: &#x2B;52.3832&#x2B;004.9205&#x2B;018.038/&#xA;    com.apple.quicktime.make: Apple&#xA;    com.apple.quicktime.model: iPhone 13 Pro Max&#xA;    com.apple.quicktime.software: 15.4.1&#xA;    com.apple.quicktime.creationdate: 2022-05-03T21:50:01&#x2B;0200&#xA;  Duration: 00:00:42.67, start: 0.000000, bitrate: 8434 kb/s&#xA;  Stream #0:0[0x1](und): Video: hevc (Main 10) (hvc1 / 0x31637668), yuv420p10le(tv, bt2020nc/bt2020/arib-std-b67), 1920x1080, 8214 kb/s, 30 fps, 30 tbr, 600 tbn (default)&#xA;    Metadata:&#xA;      creation_time   : 2022-05-03T19:50:01.000000Z&#xA;      handler_name    : Core Media Video&#xA;      vendor_id       : [0][0][0][0]&#xA;      encoder         : HEVC&#xA;    Side data:&#xA;      DOVI configuration record: version: 1.0, profile: 8, level: 4, rpu flag: 1, el flag: 0, bl flag: 1, compatibility id: 4&#xA;      displaymatrix: rotation of -90.00 degrees&#xA;  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 162 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2022-05-03T19:50:01.000000Z&#xA;      handler_name    : Core Media Audio&#xA;      vendor_id       : [0][0][0][0]&#xA;  Stream #0:2[0x3](und): Data: none (mebx / 0x7862656D), 0 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2022-05-03T19:50:01.000000Z&#xA;      handler_name    : Core Media Metadata&#xA;  Stream #0:3[0x4](und): Data: none (mebx / 0x7862656D), 5 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2022-05-03T19:50:01.000000Z&#xA;      handler_name    : Core Media Metadata&#xA;  Stream #0:4[0x5](und): Data: none (mebx / 0x7862656D), 36 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2022-05-03T19:50:01.000000Z&#xA;      handler_name    : Core Media Metadata&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (hevc (native) -> gif (native))&#xA;Press [q] to stop, [?] for help&#xA;[hevc @ 0x63641c0] Multiple Dolby Vision RPUs found in one AU. Skipping previous.&#xA;[hevc @ 0x6375900] Multiple Dolby Vision RPUs found in one AU. Skipping previous.&#xA;[hevc @ 0x6333600] Multiple Dolby Vision RPUs found in one AU. Skipping previous.&#xA;Output #0, gif, to &#x27;/tmp/a66a92eb-bc31-4440-958c-07ee23e55bcb.gif&#x27;:&#xA;  Metadata:&#xA;    major_brand     : qt  &#xA;    minor_version   : 0&#xA;    compatible_brands: qt  &#xA;    com.apple.quicktime.creationdate: 2022-05-03T21:50:01&#x2B;0200&#xA;    com.apple.quicktime.location.accuracy.horizontal: 4.732124&#xA;    com.apple.quicktime.location.ISO6709: &#x2B;52.3832&#x2B;004.9205&#x2B;018.038/&#xA;    com.apple.quicktime.make: Apple&#xA;    com.apple.quicktime.model: iPhone 13 Pro Max&#xA;    com.apple.quicktime.software: 15.4.1&#xA;    encoder         : Lavf59.16.100&#xA;  Stream #0:0(und): Video: gif, bgr8(pc, gbr/bt2020/arib-std-b67, progressive), 1080x1920, q=2-31, 200 kb/s, 30 fps, 100 tbn (default)&#xA;    Metadata:&#xA;      creation_time   : 2022-05-03T19:50:01.000000Z&#xA;      handler_name    : Core Media Video&#xA;      vendor_id       : [0][0][0][0]&#xA;      encoder         : Lavc59.18.100 gif&#xA;    Side data:&#xA;      DOVI configuration record: version: 1.0, profile: 8, level: 4, rpu flag: 1, el flag: 0, bl flag: 1, compatibility id: 4&#xA;      displaymatrix: rotation of -0.00 degrees&#xA;frame=    1 fps=0.0 q=-0.0 size=       0kB time=00:00:00.08 bitrate=   0.0kbits/s speed=0.325x    &#xA;frame=    4 fps=0.0 q=-0.0 size=     768kB time=00:00:00.18 bitrate=34952.5kbits/s speed=0.239x    &#xA;frame=    9 fps=6.6 q=-0.0 size=    2304kB time=00:00:00.34 bitrate=55512.8kbits/s speed=0.248x    &#xA;frame=   14 fps=7.0 q=-0.0 size=    3584kB time=00:00:00.51 bitrate=57568.9kbits/s speed=0.255x    &#xA;frame=   19 fps=7.2 q=-0.0 size=    5120kB time=00:00:00.68 bitrate=61680.9kbits/s speed=0.259x    &#xA;frame=   24 fps=7.4 q=-0.0 size=    6656kB time=00:00:00.84 bitrate=64911.8kbits/s speed=0.258x    &#xA;frame=   29 fps=7.5 q=-0.0 size=    7936kB time=00:00:01.01 bitrate=64368.0kbits/s speed=0.26x    &#xA;frame=   33 fps=7.5 q=-0.0 size=    9472kB time=00:00:01.14 bitrate=68065.5kbits/s speed=0.259x    &#xA;frame=   37 fps=7.5 q=-0.0 size=   10752kB time=00:00:01.28 bitrate=68812.8kbits/s speed=0.261x    &#xA;frame=   42 fps=7.6 q=-0.0 size=   12032kB time=00:00:01.44 bitrate=68448.7kbits/s speed=0.26x    &#xA;frame=   46 fps=7.6 q=-0.0 size=   13312kB time=00:00:01.58 bitrate=69020.2kbits/s speed=0.261x    &#xA;frame=   50 fps=7.6 q=-0.0 size=   14336kB time=00:00:01.71 bitrate=68678.7kbits/s speed=0.261x    &#xA;frame=   54 fps=7.6 q=-0.0 size=   15360kB time=00:00:01.84 bitrate=68385.4kbits/s speed=0.259x    &#xA;frame=   58 fps=7.6 q=-0.0 size=   16640kB time=00:00:01.98 bitrate=68845.9kbits/s speed=0.26x    &#xA;frame=   62 fps=7.6 q=-0.0 size=   17664kB time=00:00:02.11 bitrate=68579.9kbits/s speed=0.26x    &#xA;frame=   66 fps=7.6 q=-0.0 size=   18944kB time=00:00:02.24 bitrate=69280.9kbits/s speed=0.259x    &#xA;frame=   70 fps=7.6 q=-0.0 size=   20224kB time=00:00:02.38 bitrate=69611.3kbits/s speed=0.26x    &#xA;frame=   74 fps=7.7 q=-0.0 size=   21504kB time=00:00:02.51 bitrate=70183.6kbits/s speed=0.26x    &#xA;frame=   78 fps=7.7 q=-0.0 size=   22784kB time=00:00:02.64 bitrate=70699.4kbits/s speed=0.259x    &#xA;frame=   82 fps=7.7 q=-0.0 size=   24064kB time=00:00:02.78 bitrate=70910.9kbits/s speed=0.26x    &#xA;frame=   86 fps=7.7 q=-0.0 size=   25600kB time=00:00:02.91 bitrate=72067.1kbits/s speed=0.259x    &#xA;frame=   91 fps=7.7 q=-0.0 size=   27136kB time=00:00:03.08 bitrate=72174.7kbits/s speed=0.26x    &#xA;frame=   95 fps=7.7 q=-0.0 size=   28416kB time=00:00:03.21 bitrate=72518.3kbits/s speed=0.26x    &#xA;frame=   99 fps=7.7 q=-0.0 size=   29696kB time=00:00:03.34 bitrate=72835.2kbits/s speed=0.26x    &#xA;frame=  103 fps=7.7 q=-0.0 size=   30976kB time=00:00:03.48 bitrate=72918.2kbits/s speed=0.26x    &#xA;frame=  108 fps=7.7 q=-0.0 size=   32768kB time=00:00:03.64 bitrate=73746.0kbits/s speed=0.26x    &#xA;frame=  112 fps=7.7 q=-0.0 size=   34048kB time=00:00:03.78 bitrate=73788.7kbits/s speed=0.26x    &#xA;frame=  116 fps=7.7 q=-0.0 size=   35072kB time=00:00:03.91 bitrate=73480.8kbits/s speed=0.26x    &#xA;frame=  120 fps=7.7 q=-0.0 size=   36352kB time=00:00:04.04 bitrate=73711.8kbits/s speed=0.26x    &#xA;frame=  124 fps=7.7 q=-0.0 size=   37376kB time=00:00:04.18 bitrate=73249.8kbits/s speed=0.26x    &#xA;frame=  128 fps=7.7 q=-0.0 size=   38656kB time=00:00:04.31 bitrate=73473.3kbits/s speed=0.26x    &#xA;frame=  132 fps=7.7 q=-0.0 size=   39936kB time=00:00:04.44 bitrate=73683.7kbits/s speed=0.26x    &#xA;frame=  136 fps=7.7 q=-0.0 size=   41216kB time=00:00:04.58 bitrate=73720.8kbits/s speed=0.26x    &#xA;frame=  141 fps=7.7 q=-0.0 size=   42496kB time=00:00:04.74 bitrate=73444.6kbits/s speed=0.26x    &#xA;frame=  145 fps=7.8 q=-0.0 size=   43776kB time=00:00:04.88 bitrate=73486.3kbits/s speed=0.261x    &#xA;frame=  150 fps=7.8 q=-0.0 size=   45312kB time=00:00:05.04 bitrate=73650.0kbits/s speed=0.261x    &#xA;frame=  154 fps=7.8 q=-0.0 size=   46336kB time=00:00:05.18 bitrate=73278.9kbits/s speed=0.261x    &#xA;frame=  159 fps=7.8 q=-0.0 size=   47616kB time=00:00:05.34 bitrate=73046.9kbits/s speed=0.261x    &#xA;frame=  164 fps=7.8 q=-0.0 size=   49152kB time=00:00:05.51 bitrate=73076.8kbits/s speed=0.262x    &#xA;frame=  168 fps=7.8 q=-0.0 size=   50176kB time=00:00:05.64 bitrate=72879.8kbits/s speed=0.262x    &#xA;frame=  173 fps=7.8 q=-0.0 size=   51456kB time=00:00:05.81 bitrate=72552.1kbits/s speed=0.262x    &#xA;frame=  178 fps=7.8 q=-0.0 size=   52736kB time=00:00:05.98 bitrate=72243.0kbits/s speed=0.262x    &#xA;frame=  183 fps=7.8 q=-0.0 size=   54272kB time=00:00:06.14 bitrate=72409.8kbits/s speed=0.262x    &#xA;frame=  187 fps=7.8 q=-0.0 size=   55552kB time=00:00:06.28 bitrate=72465.3kbits/s speed=0.263x    &#xA;frame=  191 fps=7.8 q=-0.0 size=   56832kB time=00:00:06.41 bitrate=72631.5kbits/s speed=0.262x    &#xA;frame=  196 fps=7.8 q=-0.0 size=   58368kB time=00:00:06.58 bitrate=72667.3kbits/s speed=0.263x    &#xA;frame=  200 fps=7.8 q=-0.0 size=   59648kB time=00:00:06.71 bitrate=72822.1kbits/s speed=0.262x    &#xA;frame=  204 fps=7.8 q=-0.0 size=   60928kB time=00:00:06.84 bitrate=72971.1kbits/s speed=0.262x    &#xA;frame=  208 fps=7.8 q=-0.0 size=   62208kB time=00:00:06.98 bitrate=73009.7kbits/s speed=0.262x    &#xA;frame=  212 fps=7.8 q=-0.0 size=   63488kB time=00:00:07.11 bitrate=73149.6kbits/s speed=0.262x    &#xA;frame=  216 fps=7.8 q=-0.0 size=   64768kB time=00:00:07.24 bitrate=73284.5kbits/s speed=0.262x    &#xA;frame=  220 fps=7.8 q=-0.0 size=   66048kB time=00:00:07.38 bitrate=73315.1kbits/s speed=0.262x    &#xA;frame=  224 fps=7.8 q=-0.0 size=   67072kB time=00:00:07.51 bitrate=73163.0kbits/s speed=0.262x    &#xA;frame=  228 fps=7.8 q=-0.0 size=   68352kB time=00:00:07.64 bitrate=73290.5kbits/s speed=0.262x    &#xA;frame=  232 fps=7.8 q=-0.0 size=   69632kB time=00:00:07.78 bitrate=73319.5kbits/s speed=0.262x    &#xA;frame=  236 fps=7.8 q=-0.0 size=   70912kB time=00:00:07.91 bitrate=73440.1kbits/s speed=0.262x    &#xA;frame=  240 fps=7.8 q=-0.0 size=   72192kB time=00:00:08.04 bitrate=73556.8kbits/s speed=0.262x    &#xA;frame=  245 fps=7.8 q=-0.0 size=   73728kB time=00:00:08.21 bitrate=73566.4kbits/s speed=0.262x    &#xA;frame=  249 fps=7.8 q=-0.0 size=   75008kB time=00:00:08.34 bitrate=73676.9kbits/s speed=0.262x    &#xA;frame=  253 fps=7.8 q=-0.0 size=   76288kB time=00:00:08.48 bitrate=73697.1kbits/s speed=0.262x    &#xA;frame=  257 fps=7.8 q=-0.0 size=   77568kB time=00:00:08.61 bitrate=73802.2kbits/s speed=0.262x    &#xA;frame=  261 fps=7.8 q=-0.0 size=   78848kB time=00:00:08.74 bitrate=73904.2kbits/s speed=0.262x    &#xA;frame=  265 fps=7.8 q=-0.0 size=   80128kB time=00:00:08.88 bitrate=73919.9kbits/s speed=0.262x    &#xA;frame=  269 fps=7.8 q=-0.0 size=   81152kB time=00:00:09.01 bitrate=73784.4kbits/s speed=0.262x    &#xA;frame=  273 fps=7.8 q=-0.0 size=   82432kB time=00:00:09.14 bitrate=73882.2kbits/s speed=0.262x    &#xA;frame=  278 fps=7.8 q=-0.0 size=   83712kB time=00:00:09.31 bitrate=73659.4kbits/s speed=0.262x    &#xA;frame=  282 fps=7.8 q=-0.0 size=   84992kB time=00:00:09.44 bitrate=73755.8kbits/s speed=0.262x    &#xA;frame=  287 fps=7.8 q=-0.0 size=   86784kB time=00:00:09.61 bitrate=73978.6kbits/s speed=0.262x    &#xA;frame=  291 fps=7.8 q=-0.0 size=   88064kB time=00:00:09.74 bitrate=74067.8kbits/s speed=0.262x    &#xA;frame=  295 fps=7.8 q=-0.0 size=   89344kB time=00:00:09.88 bitrate=74079.6kbits/s speed=0.262x    &#xA;frame=  299 fps=7.8 q=-0.0 size=   90624kB time=00:00:10.01 bitrate=74165.0kbits/s speed=0.262x    &#xA;frame=  300 fps=7.8 q=-0.0 Lsize=   91358kB time=00:00:10.04 bitrate=74542.5kbits/s speed=0.261x    &#xA;video:91358kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000021%&#xA;

    &#xA;

    Any ideas what might be wrong ?

    &#xA;

  • DNN OpenCV Python using RSTP always crash after few minutes

    1er juillet 2022, par renaldyks

    Description :

    &#xA;

    I want to create a people counter using DNN. The model I'm using is MobileNetSSD. The camera I use is IPCam from Hikvision. Python communicates with IPCam using the RSTP protocol.

    &#xA;

    The program that I made is good and there are no bugs, when running the sample video the program does its job well. But when I replaced it with IPcam there was an unknown error.

    &#xA;

    Error :

    &#xA;

    Sometimes the error is :

    &#xA;

    [h264 @ 000001949f7adfc0] error while decoding MB 13 4, bytestream -6&#xA;[h264 @ 000001949f825ac0] left block unavailable for requested intra4x4 mode -1&#xA;[h264 @ 000001949f825ac0] error while decoding MB 0 17, bytestream 762&#xA;

    &#xA;

    Sometimes the error does not appear and the program is killed.

    &#xA;


    &#xA;

    Update Error

    &#xA;

    After revising the code, I caught the error. The error found is

    &#xA;

    [h264 @ 0000019289b3fa80] error while decoding MB 4 5, bytestream -25&#xA;

    &#xA;

    Now I don't know what to do, because the error is not in Google.

    &#xA;

    Source Code :

    &#xA;

    Old Code

    &#xA;

    This is my very earliest code before getting suggestions from the comments field.

    &#xA;

    import time&#xA;import cv2&#xA;import numpy as np&#xA;import math&#xA;import threading&#xA;&#xA;print("Load MobileNeteSSD model")&#xA;&#xA;prototxt = "MobileNetSSD_deploy.prototxt"&#xA;model = "MobileNetSSD_deploy.caffemodel"&#xA;&#xA;CLASSES = ["background", "aeroplane", "bicycle", "bird", "boat",&#xA;           "bottle", "bus", "car", "cat", "chair", "cow", "diningtable",&#xA;           "dog", "horse", "motorbike", "person", "pottedplant", "sheep",&#xA;           "sofa", "train", "tvmonitor"]&#xA;&#xA;net = cv2.dnn.readNetFromCaffe(prototxt, model)&#xA;&#xA;pos_line = 0&#xA;offset = 50&#xA;car = 0&#xA;detected = False&#xA;check = 0&#xA;prev_frame_time = 0&#xA;&#xA;&#xA;def detect():&#xA;    global check, car, detected&#xA;    check = 0&#xA;    if(detected == False):&#xA;        car &#x2B;= 1&#xA;        detected = True&#xA;&#xA;&#xA;def center_object(x, y, w, h):&#xA;    cx = x &#x2B; int(w / 2)&#xA;    cy = y &#x2B; int(h / 2)&#xA;    return cx, cy&#xA;&#xA;&#xA;def process_frame_MobileNetSSD(next_frame):&#xA;    global car, check, detected&#xA;&#xA;    rgb = cv2.cvtColor(next_frame, cv2.COLOR_BGR2RGB)&#xA;    (H, W) = next_frame.shape[:2]&#xA;&#xA;    blob = cv2.dnn.blobFromImage(next_frame, size=(300, 300), ddepth=cv2.CV_8U)&#xA;    net.setInput(blob, scalefactor=1.0/127.5, mean=[127.5, 127.5, 127.5])&#xA;    detections = net.forward()&#xA;&#xA;    for i in np.arange(0, detections.shape[2]):&#xA;        confidence = detections[0, 0, i, 2]&#xA;&#xA;        if confidence > 0.5:&#xA;&#xA;            idx = int(detections[0, 0, i, 1])&#xA;            if CLASSES[idx] != "person":&#xA;                continue&#xA;&#xA;            label = CLASSES[idx]&#xA;&#xA;            box = detections[0, 0, i, 3:7] * np.array([W, H, W, H])&#xA;            (startX, startY, endX, endY) = box.astype("int")&#xA;&#xA;            center_ob = center_object(startX, startY, endX-startX, endY-startY)&#xA;            cv2.circle(next_frame, center_ob, 4, (0, 0, 255), -1)&#xA;&#xA;            if center_ob[0] &lt; (pos_line&#x2B;offset) and center_ob[0] > (pos_line-offset):&#xA;                # car&#x2B;=1&#xA;                detect()&#xA;&#xA;            else:&#xA;                check &#x2B;= 1&#xA;                if(check >= 5):&#xA;                    detected = False&#xA;&#xA;            cv2.putText(next_frame, label&#x2B;&#x27; &#x27;&#x2B;str(round(confidence, 2)),&#xA;                        (startX, startY-10), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 2)&#xA;            cv2.rectangle(next_frame, (startX, startY),&#xA;                          (endX, endY), (0, 255, 0), 3)&#xA;&#xA;    return next_frame&#xA;&#xA;&#xA;def PersonDetection_UsingMobileNetSSD():&#xA;    cap = cv2.VideoCapture()&#xA;    cap.open("rtsp://admin:Admin12345@192.168.100.20:554/Streaming/channels/2/")&#xA;&#xA;    global car,pos_line,prev_frame_time&#xA;&#xA;    frame_count = 0&#xA;&#xA;    while True:&#xA;        try:&#xA;            time.sleep(0.1)&#xA;            new_frame_time = time.time()&#xA;            fps = int(1/(new_frame_time-prev_frame_time))&#xA;            prev_frame_time = new_frame_time&#xA;&#xA;            ret, next_frame = cap.read()&#xA;            w_video = cap.get(cv2.CAP_PROP_FRAME_WIDTH)&#xA;            h_video = cap.get(cv2.CAP_PROP_FRAME_HEIGHT)&#xA;            pos_line = int(h_video/2)-50&#xA;&#xA;            if ret == False: break&#xA;&#xA;            frame_count &#x2B;= 1&#xA;            cv2.line(next_frame, (int(h_video/2), 0),&#xA;                     (int(h_video/2), int(h_video)), (255, 127, 0), 3)&#xA;            next_frame = process_frame_MobileNetSSD(next_frame)&#xA;&#xA;            cv2.rectangle(next_frame, (248,22), (342,8), (0,0,0), -1)&#xA;            cv2.putText(next_frame, "Counter : "&#x2B;str(car), (250, 20),&#xA;                        cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 1)&#xA;            cv2.putText(next_frame, "FPS : "&#x2B;str(fps), (0, int(h_video)-10),&#xA;                        cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 1)&#xA;            cv2.imshow("Video Original", next_frame)&#xA;            # print(car)&#xA;&#xA;        except Exception as e:&#xA;            print(str(e))&#xA;&#xA;        if cv2.waitKey(1) &amp; 0xFF == ord(&#x27;q&#x27;): &#xA;            break&#xA;&#xA;&#xA;    print("/MobileNetSSD Person Detector")&#xA;&#xA;&#xA;    cap.release()&#xA;    cv2.destroyAllWindows()&#xA;&#xA;if __name__ == "__main__":&#xA;    t1 = threading.Thread(PersonDetection_UsingMobileNetSSD())&#xA;    t1.start()&#xA;

    &#xA;

    New Code

    &#xA;

    I have revised my code and the program still stops taking frames. I just revised the PersonDetection_UsingMobileNetSSD() function. I've also removed the multithreading I was using. The code has been running for about 30 minutes but after a broken frame, the code will never re-execute the program block if ret == True.

    &#xA;

    def PersonDetection_UsingMobileNetSSD():&#xA;    cap = cv2.VideoCapture()&#xA;    cap.open("rtsp://admin:Admin12345@192.168.100.20:554/Streaming/channels/2/")&#xA;&#xA;    global car,pos_line,prev_frame_time&#xA;&#xA;    frame_count = 0&#xA;&#xA;    while True:&#xA;        try:&#xA;            if cap.isOpened():&#xA;                ret, next_frame = cap.read()&#xA;                if ret:&#xA;                    new_frame_time = time.time()&#xA;                    fps = int(1/(new_frame_time-prev_frame_time))&#xA;                    prev_frame_time = new_frame_time&#xA;                    w_video = cap.get(cv2.CAP_PROP_FRAME_WIDTH)&#xA;                    h_video = cap.get(cv2.CAP_PROP_FRAME_HEIGHT)&#xA;                    pos_line = int(h_video/2)-50&#xA;&#xA;                    # next_frame = cv2.resize(next_frame,(720,480),fx=0,fy=0, interpolation = cv2.INTER_CUBIC)&#xA;&#xA;                    if ret == False: break&#xA;&#xA;                    frame_count &#x2B;= 1&#xA;                    cv2.line(next_frame, (int(h_video/2), 0),&#xA;                            (int(h_video/2), int(h_video)), (255, 127, 0), 3)&#xA;                    next_frame = process_frame_MobileNetSSD(next_frame)&#xA;&#xA;                    cv2.rectangle(next_frame, (248,22), (342,8), (0,0,0), -1)&#xA;                    cv2.putText(next_frame, "Counter : "&#x2B;str(car), (250, 20),&#xA;                                cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 1)&#xA;                    cv2.putText(next_frame, "FPS : "&#x2B;str(fps), (0, int(h_video)-10),&#xA;                                cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 1)&#xA;                    cv2.imshow("Video Original", next_frame)&#xA;                    # print(car)&#xA;                else:&#xA;                    print("Crashed Frame")&#xA;            else:&#xA;                print("Cap is not open")&#xA;&#xA;        except Exception as e:&#xA;            print(str(e))&#xA;&#xA;        if cv2.waitKey(1) &amp; 0xFF == ord(&#x27;q&#x27;): &#xA;            break&#xA;&#xA;&#xA;    print("/MobileNetSSD Person Detector")&#xA;&#xA;&#xA;    cap.release()&#xA;    cv2.destroyAllWindows()&#xA;

    &#xA;

    Requirement :

    &#xA;

    Hardware : Intel i5-1035G1, RAM 8 GB, NVIDIA GeForce MX330

    &#xA;

    Software : Python 3.6.2 , OpenCV 4.5.1, Numpy 1.16.0

    &#xA;

    Question :

    &#xA;

      &#xA;
    1. What should i do for fixing this error ?
    2. &#xA;

    3. What causes this to happen ?
    4. &#xA;

    &#xA;

    Best Regards,

    &#xA;


    &#xA;

    Thanks

    &#xA;