Recherche avancée

Médias (1)

Mot : - Tags -/publishing

Autres articles (107)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (12142)

  • Connection randomly closes wihtout data while running a FFMPEG PHP script

    23 octobre 2022, par Victor Marinov

    I'm building a simple back-end solution for a client that allows them to upload any video in mo4 or mov format of up to about 500MB in size to a PHP back-end, which then takes the material, downsizes and compresses the it using the PHP library FFMPEG available here https://github.com/PHP-FFMpeg/PHP-FFMpeg.

    


    While the video is being processed the connection to the front-end stays open, awaiting the compression result.

    


    This may normally take up to 3-5 minutes depending on the size and duration of the video.

    


    Overall it functions as intended, but with some videos I get random resets of the connection while the video is being processed.

    


    I've added numerous error_log() lines in my script which show that the script continues running even after the connection is reset and the actual processing and compression of the video completes correctly and the file is saved in the DB and in storage.

    


    Below is a small excerpt from the code in question :

    


                            //THEN COMPRESS VIDEO THUMBNAIL
                        $format = new FFMpeg\Format\Video\X264();
                        $format->setKiloBitrate(3200);
                        error_log("BEFORE COMPRESS! ", 0);

                        //PREVENT ANY ECHO's
                        ob_start();
                        error_log("DURING COMPRESS... ", 0);
                        $video->save($format, $export_path);
                        error_log("JUST AFTER... ", 0);
                        $compress_output = ob_get_clean();

                        $resp['video_compression_result'] = 'success';
                        error_log("COMPRESS SUCCESS! ", 0);


    


    I would just like to know if any of you would have an idea why the connection might be reset on some files and not on others ? I've even tried wrapping the the $video->save() function in an output buffer to prevent any possible output which might trigger an premature output.

    


    I have increased the PHP settings for max_memory to 2G and upload_max_filze and post_max size to 500M.

    


    max_execution_time and max_input_time are both set to 1200 sec. The random reset usually comes at 1.7 or 5.4 minutes into the request and seem to depend on the file selected.

    


    I've successfully processed smaller files from the same source without issues. The only variable here appears to be the duration and size of the video. What is most puzzling to me is that the remaining code continues to run fine even after the connection is reset.

    


    If you have any clues, please let me know as this is driving me crazy for a second day in a row now and spoiling an otherwise perfectly functional solution for the client !

    


  • Camera app fails on android ffmpeg application

    22 mars 2021, par connor449

    I am trying to run a simple video recorder app on android. The code is below :

    


    package com.example.camera&#xA;&#xA;//import android.R&#xA;import android.content.DialogInterface&#xA;import android.content.pm.PackageManager&#xA;import android.os.Build&#xA;import android.os.Bundle&#xA;import android.widget.Toast&#xA;import androidx.appcompat.app.AlertDialog&#xA;import androidx.appcompat.app.AppCompatActivity&#xA;import androidx.core.app.ActivityCompat&#xA;import androidx.core.content.ContextCompat&#xA;import com.arthenica.mobileffmpeg.FFmpeg&#xA;&#xA;&#xA;const val EXTRA_MESSAGE = "com.example.myfirstapp.MESSAGE"&#xA;&#xA;class MainActivity : AppCompatActivity() {&#xA;    override fun onCreate(savedInstanceState: Bundle?) {&#xA;        super.onCreate(savedInstanceState)&#xA;        setContentView(R.layout.activity_main)&#xA;        if (checkPermission()) {&#xA;            //main logic or main code&#xA;           FFmpeg.execute("-f android_camera -i 0:0 -r 30 -pixel_format bgr0 -t 00:00:05 /sdcard/test.mp4")&#xA;&#xA;            // . write your main code to execute, It will execute if the permission is already given.&#xA;        } else {&#xA;            requestPermission()&#xA;        }&#xA;    }&#xA;&#xA;    private fun checkPermission(): Boolean {&#xA;        return if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.CAMERA)&#xA;            != PackageManager.PERMISSION_GRANTED&#xA;        ) {&#xA;            // Permission is not granted&#xA;            false&#xA;        } else true&#xA;    }&#xA;&#xA;    private fun requestPermission() {&#xA;        ActivityCompat.requestPermissions(&#xA;            this, arrayOf(android.Manifest.permission.CAMERA),&#xA;            PERMISSION_REQUEST_CODE&#xA;        )&#xA;    }&#xA;&#xA;    override fun onRequestPermissionsResult(&#xA;        requestCode: Int,&#xA;        permissions: Array<string>,&#xA;        grantResults: IntArray&#xA;    ) {&#xA;        when (requestCode) {&#xA;            PERMISSION_REQUEST_CODE -> if (grantResults.size > 0 &amp;&amp; grantResults[0] == PackageManager.PERMISSION_GRANTED&#xA;            ) {&#xA;                Toast.makeText(applicationContext, "Permission Granted", Toast.LENGTH_SHORT)&#xA;                    .show()&#xA;&#xA;                // main logic&#xA;            } else {&#xA;                Toast.makeText(applicationContext, "Permission Denied", Toast.LENGTH_SHORT)&#xA;                    .show()&#xA;                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {&#xA;                    if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.CAMERA)&#xA;                        != PackageManager.PERMISSION_GRANTED&#xA;                    ) {&#xA;                        showMessageOKCancel("You need to allow access permissions",&#xA;                            DialogInterface.OnClickListener { dialog, which ->&#xA;                                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {&#xA;                                    requestPermission()&#xA;                                }&#xA;                            })&#xA;                    }&#xA;                }&#xA;            }&#xA;        }&#xA;    }&#xA;&#xA;    private fun showMessageOKCancel(&#xA;        message: String,&#xA;        okListener: DialogInterface.OnClickListener&#xA;    ) {&#xA;        AlertDialog.Builder(this@MainActivity)&#xA;            .setMessage(message)&#xA;            .setPositiveButton("OK", okListener)&#xA;            .setNegativeButton("Cancel", null)&#xA;            .create()&#xA;            .show()&#xA;    }&#xA;&#xA;    companion object {&#xA;        private const val PERMISSION_REQUEST_CODE = 200&#xA;    }&#xA;}&#xA;&#xA;&#xA;</string>

    &#xA;

    The main command to call the video recorder is here :

    &#xA;

               FFmpeg.execute("-f android_camera -i 0:0 -r 30 -pixel_format bgr0 -t 00:00:05 /sdcard/test.mp4")&#xA;

    &#xA;

    The app opens on my android 10 Motorola G Power. I tap 'allow' for allowing permissions. Then the app crashes and I keep getting this error :

    &#xA;

    2021-03-22 13:42:51.534 31138-31138/com.example.camera E/AndroidRuntime: FATAL EXCEPTION: main&#xA;    Process: com.example.camera, PID: 31138&#xA;    java.lang.IllegalStateException: Could not find method sendMessage(View) in a parent or ancestor Context for android:onClick attribute defined on view class com.google.android.material.button.MaterialButton with id &#x27;button2&#x27;&#xA;        at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.resolveMethod(AppCompatViewInflater.java:436)&#xA;        at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:393)&#xA;        at android.view.View.performClick(View.java:7161)&#xA;        at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:967)&#xA;        at android.view.View.performClickInternal(View.java:7133)&#xA;        at android.view.View.access$3500(View.java:804)&#xA;        at android.view.View$PerformClick.run(View.java:27416)&#xA;        at android.os.Handler.handleCallback(Handler.java:883)&#xA;        at android.os.Handler.dispatchMessage(Handler.java:100)&#xA;        at android.os.Looper.loop(Looper.java:241)&#xA;        at android.app.ActivityThread.main(ActivityThread.java:7617)&#xA;        at java.lang.reflect.Method.invoke(Native Method)&#xA;        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)&#xA;        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)&#xA;2021-03-22 13:42:51.546 31138-31138/com.example.camera I/Process: Sending signal. PID: 31138 SIG: 9&#xA;

    &#xA;

    What am I doing wrong ? Please advise.

    &#xA;

    edit

    &#xA;

    layout xml

    &#xA;

    &lt;?xml version="1.0" encoding="utf-8"?>&#xA;&#xA;&#xA;    &#xA;&#xA;    &#xA;&#xA;

    &#xA;

  • opencv ffmpeg vaapi 1080p resolution not working

    18 avril 2023, par yeo

    I want to use hardware acceleration with opencv manual build.&#xA;My gpu uses an i965 intel cpu built-in graphics card, and it is a debain11 environment.

    &#xA;

    [OPENCV:FFMPEG:40] Reinit context to 1920x1088, pix_fmt: vaapi_vld&#xA;

    &#xA;

    If you look at some of the error messages below, it seems that the original file is 1920x1080 because it is converted to 1088 while reinit.&#xA;I've read that vaapi_vld reads 16 bits at a time.&#xA;In fact, it seems to work when the original file is changed to 1920x1072.&#xA;Is there a way to fix it without changing the original file resolution ?&#xA;Please advise seniors.&#xA;Sorry for my poor English skills&#xA;Thank you

    &#xA;

    manual build CMAKE option

    &#xA;

    "-DCMAKE_VERBOSE_MAKEFILE=ON -DWITH_VA_INTEL=ON -DWITH_VA=ON -DOPENCV_FFMPEG_ENABLE_LIBAVDEVICE=ON -DOPENCV_ENABLE_GLX=ON -DOPENCV_FFMPEG_SKIP_BUILD_CHECK=ON -DWITH_OPENVINO=ON -DWITH_INF_ENGINE=ON"&#xA;&#xA;

    &#xA;

    build infomation

    &#xA;

      OpenCV modules:&#xA;    To be built:                 calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo python3 stitching video videoio&#xA;    Disabled:                    world&#xA;    Disabled by dependency:      -&#xA;    Unavailable:                 java python2 ts&#xA;    Applications:                -&#xA;    Documentation:               NO&#xA;    Non-free algorithms:         NO&#xA;&#xA;  GUI:                           GTK3&#xA;    GTK&#x2B;:                        YES (ver 3.24.24)&#xA;      GThread :                  YES (ver 2.66.8)&#xA;      GtkGlExt:                  NO&#xA;    VTK support:                 NO&#xA;  Media I/O: &#xA;    ZLib:                        /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.11)&#xA;    JPEG:                        /usr/lib/x86_64-linux-gnu/libjpeg.so (ver 62)&#xA;    WEBP:                        /usr/lib/x86_64-linux-gnu/libwebp.so (ver encoder: 0x020e)&#xA;    PNG:                         /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.6.37)&#xA;    TIFF:                        /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 / 4.2.0)&#xA;    JPEG 2000:                   build (ver 2.4.0)&#xA;    OpenEXR:                     build (ver 2.3.0)&#xA;    HDR:                         YES&#xA;    SUNRASTER:                   YES&#xA;    PXM:                         YES&#xA;    PFM:                         YES&#xA;  Video I/O:&#xA;    DC1394:                      YES (2.2.6)&#xA;    FFMPEG:                      YES&#xA;      avcodec:                   YES (58.91.100)&#xA;      avformat:                  YES (58.45.100)&#xA;      avutil:                    YES (56.51.100)&#xA;      swscale:                   YES (5.7.100)&#xA;      avresample:                YES (4.0.0)&#xA;    GStreamer:                   YES (1.18.4)&#xA;    v4l/v4l2:                    YES (linux/videodev2.h)&#xA;&#xA;  Parallel framework:            pthreads&#xA;&#xA;  Trace:                         YES (with Intel ITT)&#xA;&#xA;  Other third-party libraries:&#xA;    Intel IPP:                   2020.0.0 Gold [2020.0.0]&#xA;    VA:                          YES&#xA;    Lapack:                      NO&#xA;    Eigen:                       NO&#xA;    Custom HAL:                  NO&#xA;    Protobuf:                    build (3.19.1)&#xA;&#xA;  OpenCL:                        YES (INTELVA)&#xA;    Include path:                /home/xxx&#xA;    Link libraries:              Dynamic load&#xA;&#xA;  Python 3:&#xA;    Interpreter:                 /usr/bin/python3 (ver 3.9.2)&#xA;    Libraries:                   /usr/lib/x86_64-linux-gnu/libpython3.9.so (ver 3.9.2)&#xA;    numpy:                       /home/../include (ver 1.19.3)&#xA;    install path:                python/cv2/python-3&#xA;

    &#xA;

    vainfo

    &#xA;

    libva info: VA-API version 1.10.0&#xA;libva info: User environment variable requested driver &#x27;i965&#x27;&#xA;libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so&#xA;libva info: Found init function __vaDriverInit_1_8&#xA;libva info: va_openDriver() returns 0&#xA;vainfo: VA-API version: 1.10 (libva 2.10.0)&#xA;vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 2.4.1&#xA;vainfo: Supported profile and entrypoints&#xA;      VAProfileMPEG2Simple            : VAEntrypointVLD&#xA;      VAProfileMPEG2Simple            : VAEntrypointEncSlice&#xA;      VAProfileMPEG2Main              : VAEntrypointVLD&#xA;      VAProfileMPEG2Main              : VAEntrypointEncSlice&#xA;      VAProfileH264ConstrainedBaseline: VAEntrypointVLD&#xA;      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice&#xA;      VAProfileH264Main               : VAEntrypointVLD&#xA;      VAProfileH264Main               : VAEntrypointEncSlice&#xA;      VAProfileH264High               : VAEntrypointVLD&#xA;      VAProfileH264High               : VAEntrypointEncSlice&#xA;      VAProfileH264MultiviewHigh      : VAEntrypointVLD&#xA;      VAProfileH264MultiviewHigh      : VAEntrypointEncSlice&#xA;      VAProfileH264StereoHigh         : VAEntrypointVLD&#xA;      VAProfileH264StereoHigh         : VAEntrypointEncSlice&#xA;      VAProfileVC1Simple              : VAEntrypointVLD&#xA;      VAProfileVC1Main                : VAEntrypointVLD&#xA;      VAProfileVC1Advanced            : VAEntrypointVLD&#xA;      VAProfileNone                   : VAEntrypointVideoProc&#xA;      VAProfileJPEGBaseline           : VAEntrypointVLD&#xA;

    &#xA;

    import os&#xA;import cv2&#xA;&#xA;os.environ["OPENCV_FFMPEG_CAPTURE_OPTIONS"] = "hw_decoders_any;vaapi,vdpau" &#x2B;&#xA;&#xA;cap = cv2.VideoCapture(file_name,cv2.CAP_FFMPEG(cv2.CAP_PROP_HW_ACCELERATION,cv2.VIDEO_ACCELERATION_ANY))  &#xA;&#xA;

    &#xA;

    error code

    &#xA;

    [ INFO:0@0.187] global /home/u/opencv-python/opencv/modules/videoio/src/videoio_registry.cpp (223) VideoBackendRegistry VIDEOIO: Enabled backends(8, sorted by priority): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); FIREWIRE(940); UEYE(930)&#xA;[OPENCV:FFMPEG:40] Reinit context to 1920x1088, pix_fmt: yuv420p&#xA;[OPENCV:FFMPEG:40] Trying to use DRM render node for device 0.&#xA;[OPENCV:FFMPEG:40] libva: VA-API version 1.10.0&#xA;libva: User environment variable requested driver &#x27;i965&#x27;&#xA;libva: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so&#xA;libva: Found init function __vaDriverInit_1_8&#xA;libva: va_openDriver() returns 0&#xA;Initialised VAAPI connection: version 1.10&#xA;[OPENCV:FFMPEG:40] VAAPI driver: Intel i965 driver for Intel(R) Haswell Mobile - 2.4.1.&#xA;[OPENCV:FFMPEG:40] Driver not found in known nonstandard list, using standard behaviour.&#xA;[ INFO:0@0.228] global /home/u/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_hw.hpp (276) hw_check_device FFMPEG: Using vaapi video acceleration on device: Intel i965 driver for Intel(R) Haswell Mobile - 2.4.1&#xA;[ INFO:0@0.228] global /home/u/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_hw.hpp (566) hw_create_device FFMPEG: Created video acceleration context (av_hwdevice_ctx_create) for vaapi on device &#x27;default&#x27;&#xA;[ INFO:0@0.228] global /home/u/opencv-python/opencv/modules/core/src/ocl.cpp (1186) haveOpenCL Initialize OpenCL runtime...&#xA;[ INFO:0@0.228] global /home/u/opencv-python/opencv/modules/core/src/ocl.cpp (1192) haveOpenCL OpenCL: found 0 platforms&#xA;File open : ./videoplayback1.mp4&#xA;[OPENCV:FFMPEG:40] Reinit context to 1920x1088, pix_fmt: vaapi_vld&#xA;[OPENCV:FFMPEG:16] Failed to read image from surface 0x4000014: 18 (invalid parameter).&#xA;[ERROR:0@0.245] global /home/u/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp (1575) retrieveFrame Error copying data from GPU to CPU (av_hwframe_transfer_data)&#xA;Play video ... size=1920x1080, file=./videoplayback1.mp4&#xA;[OPENCV:FFMPEG:16] Failed to read image from surface 0x4000012: 18 (invalid parameter).&#xA;[ERROR:0@0.277] global /home/u/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp (1575) retrieveFrame Error copying data from GPU to CPU (av_hwframe_transfer_data)&#xA;OpenCV(4.6.0) Error: Assertion failed (!image.empty()) in imencode, file /home/u/opencv-python/opencv/modules/imgcodecs/src/loadsave.cpp, line 976&#xA;err =  OpenCV(4.6.0) /home/u/opencv-python/opencv/modules/imgcodecs/src/loadsave.cpp:976: error: (-215:Assertion failed) !image.empty() in function &#x27;imencode&#x27;&#xA;&#xA;

    &#xA;

    I tried to do video capture by ffmpeg hwacceleration with opencv, but an error message occurred

    &#xA;