Recherche avancée

Médias (1)

Mot : - Tags -/Christian Nold

Autres articles (77)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

Sur d’autres sites (4699)

  • Change AVI creation date with ffmpeg ?

    1er novembre 2016, par brock

    As far as I can tell the following ffmpeg command should copy all existing metadata in the input file to the output file and modify the specified field in the output file :

    ffmpeg -i VID_20130502_220104.avi -metadata creation_time="2013-05-02 22:01:04" -codec copy VID_20130502_220104-2.avi

    Instead, it seems to strip all metadata from the output file. Here is the output of a few commands. I am going nuts. I think this should work, but why is it not ?

    Command to edit the creation time :

    ffmpeg -i VID_20130502_220104.avi -metadata creation_time="2013-05-02 22:01:04" -codec copy VID_20130502_220104-2.avi

    ffmpeg version 3.1.5 Copyright (c) 2000-2016 the FFmpeg developers
     built with gcc 5.4.0 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
     libavutil      55. 28.100 / 55. 28.100
     libavcodec     57. 48.101 / 57. 48.101
     libavformat    57. 41.100 / 57. 41.100
     libavdevice    57.  0.101 / 57.  0.101
     libavfilter     6. 47.100 /  6. 47.100
     libswscale      4.  1.100 /  4.  1.100
     libswresample   2.  1.100 /  2.  1.100
     libpostproc    54.  0.100 / 54.  0.100
    Guessed Channel Layout for Input Stream #0.1 : mono
    Input #0, avi, from 'VID_20130502_220104.avi':
     Metadata:
       encoder         :
       maker           : NIKON
       model           : COOLPIX S4300
       creation_time   : 2011-01-01 00:00:00
     Duration: 00:01:30.50, start: 0.000000, bitrate: 32135 kb/s
       Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 1280x720, 31782 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
       Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, 1 channels, s16, 352 kb/s
    [avi @ 000000000032ad40] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
       Last message repeated 1 times
    Output #0, avi, to 'VID_20130502_220104-2.avi':
     Metadata:
       creation_time   : 2013-05-02 22:01:04
       maker           : NIKON
       model           : COOLPIX S4300
       ISFT            : Lavf57.41.100
       Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 1280x720, q=2-31, 31782 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
       Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, mono, 352 kb/s
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    frame=  891 fps=0.0 q=-1.0 size=  116171kB time=00:00:29.69 bitrate=32043.1kbits/s speed=59.4x    
    frame= 1739 fps=1739 q=-1.0 size=  227191kB time=00:00:57.96 bitrate=32107.5kbits/s speed=  58x    
    frame= 2609 fps=1739 q=-1.0 size=  340940kB time=00:01:26.96 bitrate=32115.9kbits/s speed=  58x    
    frame= 2715 fps=1734 q=-1.0 Lsize=  355018kB time=00:01:30.49 bitrate=32136.3kbits/s speed=57.8x    
    video:350984kB audio:3897kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.038597%

    Command to inspect the output file metadata with ffmpeg :

    ffmpeg -i VID_20130502_220104-2.avi

    ffmpeg version 3.1.5 Copyright (c) 2000-2016 the FFmpeg developers
     built with gcc 5.4.0 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
     libavutil      55. 28.100 / 55. 28.100
     libavcodec     57. 48.101 / 57. 48.101
     libavformat    57. 41.100 / 57. 41.100
     libavdevice    57.  0.101 / 57.  0.101
     libavfilter     6. 47.100 /  6. 47.100
     libswscale      4.  1.100 /  4.  1.100
     libswresample   2.  1.100 /  2.  1.100
     libpostproc    54.  0.100 / 54.  0.100
    Guessed Channel Layout for Input Stream #0.1 : mono
    Input #0, avi, from 'VID_20130502_220104-2.avi':
     Metadata:
       encoder         : Lavf57.41.100
     Duration: 00:01:30.50, start: 0.000000, bitrate: 32136 kb/s
       Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 1280x720, 31782 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
       Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, 1 channels, s16, 352 kb/s
    At least one output file must be specified

    Command to inspect the input file metadata with exiftool :

    exiftool.exe VID_20130502_220104.avi

    ExifTool Version Number         : 10.30
    File Name                       : VID_20130502_220104.avi
    Directory                       : .
    File Size                       : 347 MB
    File Modification Date/Time     : 2013:05:13 16:33:52-04:00
    File Access Date/Time           : 2015:11:10 23:08:25-05:00
    File Creation Date/Time         : 2015:11:10 23:08:25-05:00
    File Permissions                : rw-rw-rw-
    File Type                       : AVI
    File Type Extension             : avi
    MIME Type                       : video/x-msvideo
    Frame Rate                      : 30
    Max Data Rate                   : 488.3 kB/s
    Frame Count                     : 2715
    Stream Count                    : 2
    Stream Type                     : Video
    Video Codec                     : mjpg
    Video Frame Rate                : 30
    Video Frame Count               : 2715
    Quality                         : 10000
    Sample Size                     : Variable
    Image Width                     : 1280
    Image Height                    : 720
    Planes                          : 1
    Bit Depth                       : 24
    Compression                     : MJPG
    Image Length                    : 2764800
    Pixels Per Meter X              : 0
    Pixels Per Meter Y              : 0
    Num Colors                      : Use BitDepth
    Num Important Colors            : All
    Audio Codec                     :
    Audio Sample Rate               : 22050
    Audio Sample Count              : 1995256
    Encoding                        : Microsoft PCM
    Num Channels                    : 1
    Sample Rate                     : 22050
    Avg Bytes Per Sec               : 44100
    Bits Per Sample                 : 16
    Maker Note Type                 : NIKON
    Maker Note Version              : 0.1.0.0
    Make                            : NIKON
    Model                           : COOLPIX S4300
    Software                        : V1.0
    Equipment                       : NIKON DIGITAL CAMERA
    Orientation                     : Horizontal (normal)
    Exposure Time                   : 1/15
    F Number                        : 3.5
    Exposure Compensation           : 0
    Max Aperture Value              : 3.2
    Metering Mode                   : Multi-segment
    Focal Length                    : 4.6 mm
    X Resolution                    : 72
    Y Resolution                    : 72
    Resolution Unit                 : inches
    Date/Time Original              : 2011:01:01 00:00:00
    Create Date                     : 2011:01:01 00:00:00
    Focus Mode                      : AF-S
    Digital Zoom                    : 1
    Color Mode                      : COLOR
    Sharpness                       : AUTO
    White Balance                   : NORMAL
    Noise Reduction                 : OFF
    Thumbnail Image                 : (Binary data 3082 bytes, use -b option to extract)
    Aperture                        : 3.5
    Duration                        : 0:01:30
    Image Size                      : 1280x720
    Megapixels                      : 0.922
    Shutter Speed                   : 1/15
    Focal Length                    : 4.6 mm

    Command to inspect the output file metadata with exiftool :

    exiftool.exe VID_20130502_220104-2.avi

    ExifTool Version Number         : 10.30
    File Name                       : VID_20130502_220104-2.avi
    Directory                       : .
    File Size                       : 347 MB
    File Modification Date/Time     : 2016:11:01 00:17:38-04:00
    File Access Date/Time           : 2016:11:01 00:17:36-04:00
    File Creation Date/Time         : 2016:11:01 00:15:18-04:00
    File Permissions                : rw-rw-rw-
    File Type                       : AVI
    File Type Extension             : avi
    MIME Type                       : video/x-msvideo
    Frame Rate                      : 30
    Max Data Rate                   : 3923 kB/s
    Frame Count                     : 2715
    Stream Count                    : 2
    Stream Type                     : Video
    Video Codec                     : MJPG
    Video Frame Rate                : 30
    Video Frame Count               : 2715
    Quality                         : Default
    Sample Size                     : Variable
    Image Width                     : 1280
    Image Height                    : 720
    Planes                          : 1
    Bit Depth                       : 24
    Compression                     : MJPG
    Image Length                    : 2764800
    Pixels Per Meter X              : 0
    Pixels Per Meter Y              : 0
    Num Colors                      : Use BitDepth
    Num Important Colors            : All
    Audio Codec                     : .
    Audio Sample Rate               : 22050
    Audio Sample Count              : 1995256
    Encoding                        : Microsoft PCM
    Num Channels                    : 1
    Sample Rate                     : 22050
    Avg Bytes Per Sec               : 44100
    Bits Per Sample                 : 16
    Software                        : Lavf57.41.100
    Duration                        : 0:01:30
    Image Size                      : 1280x720
    Megapixels                      : 0.922
  • Failed to execute : 0x80070057, when decoding video via ffmpeg with dxva2

    25 mars 2019, par CD83

    I have successfully implemented a video player using ffmpeg. I am now trying to use hardware decoding but I’m facing a couple issues.
    I found a post that I followed as a starting point here : https://ffmpeg.org/pipermail/libav-user/2014-August/007323.html

    I have updated the code that setup the necessary stuff for the decoder. The updated code is available here : https://drive.google.com/file/d/0B5ufHdoDzA4ieVk5UVpxcDNzRHc/view?usp=sharing

    And this is how I’m using it to initialize the decoder :

    // Prepare the decoding context
    AVCodec *codec = nullptr;
    _codecContext = _avFormatContext->streams[_streamIndex]->codec;
    if ((codec = avcodec_find_decoder(_codecContext->codec_id)) == 0)
    {
       std::cout << "Unsupported video codec!" << std::endl;
       return false;
    }

    _codecContext->thread_count = 1;  // Multithreading is apparently not compatible with hardware decoding
    InputStream *ist = new InputStream();
    ist->hwaccel_id = HWACCEL_AUTO;
    ist->hwaccel_device = "dxva2";
    ist->dec = codec;
    ist->dec_ctx = _codecContext;
    _codecContext->coded_width = _width;
    _codecContext->coded_height = _height;

    _codecContext->opaque = ist;
    dxva2_init(_codecContext);

    _codecContext->get_buffer2 = ist->hwaccel_get_buffer;
    _codecContext->get_format = GetHwFormat;
    _codecContext->thread_safe_callbacks = 1;

    if (avcodec_open2(_codecContext, codec, nullptr) < 0)
    {
       std::cout << "Video codec open error" << std::endl;
       return false;
    }

    And here is the definition of GetHwFormat referenced above :

    AVPixelFormat GetHwFormat(AVCodecContext *s, const AVPixelFormat *pix_fmts)
    {
       InputStream* ist = (InputStream*)s->opaque;
       ist->active_hwaccel_id = HWACCEL_DXVA2;
       ist->hwaccel_pix_fmt = AV_PIX_FMT_DXVA2_VLD;
       return ist->hwaccel_pix_fmt;
    }

    When I open an mp4 (encoded in h264) video that is HD resolution or less, everything seems to be working fine. However, as soon as I try higher resolution videos like 3840x2160, I get the following errors repeatedly :

    Failed to execute: 0x80070057
    Hardware accelerator failed to decode picture

    I also start getting the following errors after a few seconds :

    co located POCs unavailable

    And the video is not displayed properly : I get a lot of artifacts all over the video and it is lagging. I checked the first error in the ffmpeg source code. It seems that IDirectXVideoDecoder_Execute fails because of an invalid parameter. Since this is happening withing ffmpeg, there must be something that I’m missing but I can’t figure out what. The only relevant post that I found with this error was because of multithreading but I set the thread_count to 1 before opening the codec.

    This issue is happening on my main computer which has the following specs :

    • i7-4790 CPU @ 3.6GHz
    • RAM 16 GB
    • Intel HD Graphics 4600
    • Windows 8.1

    The same issue is not happening on my second computer which has the following specs :

    • i7 4510U @ 2GHz
    • RAM 8 GB
    • NVIDIA GeForce GTX 750Ti
    • Windows 10

    If I use DXVAChecker on my main computer, it says that my graphics card supports DXVA2 for H264_VLD_*, and I can see that the calls to the Microsoft API are being made (DXVA2_DecodeDeviceCreated, DXVA2_DecodeDeviceBeginFrame, DXVA2_DecodeDeviceGetBuffer, DXVA2_DecodeDeviceExecute, DXVA2_DecodeDeviceEndFrame) while my video is playing.

    I also don’t see any increase of GPU usage (on either computer) between the version with hardware decoding and the version without ; however, I do see a decrease in CPU usage (not as much as I was expecting though). This is also very strange.

    Note that I tried both the Windows release available on the FFmpeg website, and a version that I compiled with —enable-dxva2. I have searched a lot already but I was unable to find what I’m doing wrong.

    Hopefully, someone can help me, or maybe point me to a better example ?

  • Failed to execute : 0x80070057, when decoding video via ffmpeg with dxva2

    18 avril 2016, par CD83

    I have successfully implemented a video player using ffmpeg. I am now trying to use hardware decoding but I’m facing a couple issues.
    I found a post that I followed as a starting point here : http://comments.gmane.org/gmane.comp.video.ffmpeg.libav.user/13523

    I have updated the code that setup the necessary stuff for the decoder. The updated code is available here : https://drive.google.com/file/d/0B5ufHdoDzA4ieVk5UVpxcDNzRHc/view?usp=sharing

    And this is how I’m using it to initialize the decoder :

    // Prepare the decoding context
    AVCodec *codec = nullptr;
    _codecContext = _avFormatContext->streams[_streamIndex]->codec;
    if ((codec = avcodec_find_decoder(_codecContext->codec_id)) == 0)
    {
       std::cout << "Unsupported video codec!" << std::endl;
       return false;
    }

    _codecContext->thread_count = 1;  // Multithreading is apparently not compatible with hardware decoding
    InputStream *ist = new InputStream();
    ist->hwaccel_id = HWACCEL_AUTO;
    ist->hwaccel_device = "dxva2";
    ist->dec = codec;
    ist->dec_ctx = _codecContext;
    _codecContext->coded_width = _width;
    _codecContext->coded_height = _height;

    _codecContext->opaque = ist;
    dxva2_init(_codecContext);

    _codecContext->get_buffer2 = ist->hwaccel_get_buffer;
    _codecContext->get_format = GetHwFormat;
    _codecContext->thread_safe_callbacks = 1;

    if (avcodec_open2(_codecContext, codec, nullptr) < 0)
    {
       std::cout << "Video codec open error" << std::endl;
       return false;
    }

    And here is the definition of GetHwFormat referenced above :

    AVPixelFormat GetHwFormat(AVCodecContext *s, const AVPixelFormat *pix_fmts)
    {
       InputStream* ist = (InputStream*)s->opaque;
       ist->active_hwaccel_id = HWACCEL_DXVA2;
       ist->hwaccel_pix_fmt = AV_PIX_FMT_DXVA2_VLD;
       return ist->hwaccel_pix_fmt;
    }

    When I open an mp4 (encoded in h264) video that is HD resolution or less, everything seems to be working fine. However, as soon as I try higher resolution videos like 3840x2160, I get the following errors repeatedly :

    Failed to execute: 0x80070057
    Hardware accelerator failed to decode picture

    I also start getting the following errors after a few seconds :

    co located POCs unavailable

    And the video is not displayed properly : I get a lot of artifacts all over the video and it is lagging. I checked the first error in the ffmpeg source code. It seems that IDirectXVideoDecoder_Execute fails because of an invalid parameter. Since this is happening withing ffmpeg, there must be something that I’m missing but I can’t figure out what. The only relevant post that I found with this error was because of multithreading but I set the thread_count to 1 before opening the codec.

    This issue is happening on my main computer which has the following specs :

    • i7-4790 CPU @ 3.6GHz
    • RAM 16 GB
    • Intel HD Graphics 4600
    • Windows 8.1

    The same issue is not happening on my second computer which has the following specs :

    • i7 4510U @ 2GHz
    • RAM 8 GB
    • NVIDIA GeForce GTX 750Ti
    • Windows 10

    If I use DXVAChecker on my main computer, it says that my graphics card supports DXVA2 for H264_VLD_*, and I can see that the calls to the Microsoft API are being made (DXVA2_DecodeDeviceCreated, DXVA2_DecodeDeviceBeginFrame, DXVA2_DecodeDeviceGetBuffer, DXVA2_DecodeDeviceExecute, DXVA2_DecodeDeviceEndFrame) while my video is playing.

    I also don’t see any increase of GPU usage (on either computer) between the version with hardware decoding and the version without ; however, I do see a decrease in CPU usage (not as much as I was expecting though). This is also very strange.

    Note that I tried both the Windows release available on the FFmpeg website, and a version that I compiled with —enable-dxva2. I have searched a lot already but I was unable to find what I’m doing wrong.

    Hopefully, someone can help me, or maybe point me to a better example ?