Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP

Autres articles (96)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • Gestion de la ferme

    2 mars 2010, par

    La ferme est gérée dans son ensemble par des "super admins".
    Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
    Dans un premier temps il utilise le plugin "Gestion de mutualisation"

Sur d’autres sites (5506)

  • 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;

  • ffmpeg status & quality / cuda (CPU/GPU)

    18 avril 2015, par cocco

    ffmpeg am i doing it right ?

    So much time has passed since i use ffmpeg to convert clips on my home web server, now that mp4 (h264 & aac) is the current overall standard (works on every console, smartphone, smartTV, pc) i decided to convert my old clips from various digital cameras to to this new container/codecs.

    1. less space & the same quality.
    2. compatibility
    3. support for tags (subler for mac)

    after some research i opted for ffmpeg because of various reasons

    1. commandline (i made my simple web interface with default settings wich i execute with php’s exec)
    2. the quality/size amount

    I read that many expensive video conversion softwares are not able to handle low bitrate videos properly. I also tested some of them and personally i could not find the proper export settings or i was not impressed by the results... some had fixed default export setings, most had a lower video quality at the same filesize. ffmpeg allows me to set the -crf (18-24 usually) and -preset (veryslow, fast..) witch allows me to reduce the filesize drastically mantaining the same
    visible quality.

    Said that i’m using the preset at veryslow.(there is also placebo but the final video file is only 1% smaller in size).

    And here is the command i use

    ffmpeg
    -y //overwrite the file if it exists

    -i INPUTFILE // replace with the input file

    -metadata title=THETITLE // set a nice title, visible on modern devices
    -metadata date=THEDATE // set a nice title, visible on modern devices

    -c:v libx264 // use the h264 codec
    -crf 21 // try different numbers between 18-26
    -preset veryslow // placebo,slow,fast,ultrafast==big file
    -tune film // tune it a little
    -pix_fmt yuv420p // preferred on most modern devices
    -profile:v main // preferred on most modern devices
    -level 3.1 // preferred on most modern devices
    -refs 4 // preferred on most modern devices

    -c:a libfdk_aac // use aac
    -metadata:s:a language=eng // set a language, visible on modern devices
    -b:a 128k // audio bitrate 128k is like mp3 192k
    -ar 48000 // 44100 ... whatever
    -ac 2 // audiochannels
    -movflags +faststart //move the metadata in the front of the video so it loads faster

    OUTPUTFILE

    some camcorder clips with m2ts already have the avc/h264 compatible codec so i just copy the stream.
    some have the ac3/dolby sorround audio. I convert the audio but keep the ac3 as second audio track mapping the ffmpeg streams.this allows me to watch the mp4 on browsers and mobile devices but i’m able to keep the surround sound to playback on some tv’s, advanced media players or devices like apple tv.

    not that i’m not happy with the speed (using quad core’s) but i recently read again about cuda opencl and there is also the simple fact that i’m not using other converters than ffmpeg since alot of time.

    Is ffmpeg (with the setting i use) a good converter to keep the same video quality than the source reducing the space occupied by and average of 30-40% ?

    Is GPU conversion really that bad (cuda .. testing a gtx970) ?
    it would be nice to add some more speed to the conversions by using both the gpu and the cpu..but for my understanding they cannot work together ??? and using only gpu is a drastical quality loss...cpu si more precise, gpu is faster in calculation are too imprecise from what i read.. so expensive softwares use cuda only for preview purpose... right ?

    Is ffmpeg or another software compatible with CPU+GPU encoding ?
    i really don’t remember where, but i read that the ffmpeg is not a good videoconverter.

    i’m really happy with the size/quality, i gained an average of 30% in space with no visible quality loss. With some extra parameters i can adjust some really old analog videos that are deinterlaced in a really bad way.

    maybe i could gain more size/quality with another software ???

    note : i like ffmpeg.it’s free and it has commandline so i can create my own interface with php html & js and use it on various machines without the need to install it in every device i use. i uplad the idevice clips directly to the ffmpeg server.

    btw. : explain the downvotes...

    EDIT :

    @talonmies ...cuda tag removed :

    http://www.nvidia.com/object/cuda_home_new.html

    CUDA® is a parallel computing platform and programming model invented
    by NVIDIA. It enables dramatic increases in computing performance by
    harnessing the power of the graphics processing unit (GPU). With
    millions of CUDA-enabled GPUs sold to date, software developers,
    scientists and researchers are finding broad-ranging uses for GPU
    computing with CUDA. Here are a few examples : - See more at :
    http://www.nvidia.com/object/cuda_home_new.html#sthash.dEYaqae7.dpuf

    isn’t cuda the programming model that a theoretical ffmpeg library should support to handle GPU encoding on nvidia cards like the gtx 970 ?? like the badaboom software http://www.geforce.com/games-applications/pc-applications/badaboom-media-converter.

  • Revision 181949948e : Add constrained-copy partition to speed features. Copy up to a certain bsize, o

    5 avril 2014, par Marco Paniconi

    Changed Paths :
     Modify /vp9/encoder/vp9_encodeframe.c


     Modify /vp9/encoder/vp9_speed_features.c


     Modify /vp9/encoder/vp9_speed_features.h



    Add constrained-copy partition to speed features.

    Copy up to a certain bsize, otherwise set to a fixed bsize.
    This helsp to reduce artifact near moving boundary caused by full partition
    copy without checking motion of super-block.
    This artifact can occur at speeds 3,4 in real-time mode.
    Issue : https://code.google.com/p/webm/issues/detail?id=738.

    Change-Id : I05812521fd38816a467f72eb6a951cae4c227931