
Recherche avancée
Médias (91)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
-
Les Miserables
4 juin 2012, par
Mis à jour : Février 2013
Langue : English
Type : Texte
-
Ne pas afficher certaines informations : page d’accueil
23 novembre 2011, par
Mis à jour : Novembre 2011
Langue : français
Type : Image
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Richard Stallman et la révolution du logiciel libre - Une biographie autorisée (version epub)
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (23)
-
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs
12 avril 2011, parLa manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras. -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)
Sur d’autres sites (4161)
-
Camera app fails on android ffmpeg application
22 mars 2021, par connor449I am trying to run a simple video recorder app on android. The code is below :


package com.example.camera

//import android.R
import android.content.DialogInterface
import android.content.pm.PackageManager
import android.os.Build
import android.os.Bundle
import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import com.arthenica.mobileffmpeg.FFmpeg


const val EXTRA_MESSAGE = "com.example.myfirstapp.MESSAGE"

class MainActivity : AppCompatActivity() {
 override fun onCreate(savedInstanceState: Bundle?) {
 super.onCreate(savedInstanceState)
 setContentView(R.layout.activity_main)
 if (checkPermission()) {
 //main logic or main code
 FFmpeg.execute("-f android_camera -i 0:0 -r 30 -pixel_format bgr0 -t 00:00:05 /sdcard/test.mp4")

 // . write your main code to execute, It will execute if the permission is already given.
 } else {
 requestPermission()
 }
 }

 private fun checkPermission(): Boolean {
 return if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.CAMERA)
 != PackageManager.PERMISSION_GRANTED
 ) {
 // Permission is not granted
 false
 } else true
 }

 private fun requestPermission() {
 ActivityCompat.requestPermissions(
 this, arrayOf(android.Manifest.permission.CAMERA),
 PERMISSION_REQUEST_CODE
 )
 }

 override fun onRequestPermissionsResult(
 requestCode: Int,
 permissions: Array<string>,
 grantResults: IntArray
 ) {
 when (requestCode) {
 PERMISSION_REQUEST_CODE -> if (grantResults.size > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED
 ) {
 Toast.makeText(applicationContext, "Permission Granted", Toast.LENGTH_SHORT)
 .show()

 // main logic
 } else {
 Toast.makeText(applicationContext, "Permission Denied", Toast.LENGTH_SHORT)
 .show()
 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
 if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.CAMERA)
 != PackageManager.PERMISSION_GRANTED
 ) {
 showMessageOKCancel("You need to allow access permissions",
 DialogInterface.OnClickListener { dialog, which ->
 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
 requestPermission()
 }
 })
 }
 }
 }
 }
 }

 private fun showMessageOKCancel(
 message: String,
 okListener: DialogInterface.OnClickListener
 ) {
 AlertDialog.Builder(this@MainActivity)
 .setMessage(message)
 .setPositiveButton("OK", okListener)
 .setNegativeButton("Cancel", null)
 .create()
 .show()
 }

 companion object {
 private const val PERMISSION_REQUEST_CODE = 200
 }
}


</string>


The main command to call the video recorder is here :


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



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 :


2021-03-22 13:42:51.534 31138-31138/com.example.camera E/AndroidRuntime: FATAL EXCEPTION: main
 Process: com.example.camera, PID: 31138
 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 'button2'
 at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.resolveMethod(AppCompatViewInflater.java:436)
 at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:393)
 at android.view.View.performClick(View.java:7161)
 at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:967)
 at android.view.View.performClickInternal(View.java:7133)
 at android.view.View.access$3500(View.java:804)
 at android.view.View$PerformClick.run(View.java:27416)
 at android.os.Handler.handleCallback(Handler.java:883)
 at android.os.Handler.dispatchMessage(Handler.java:100)
 at android.os.Looper.loop(Looper.java:241)
 at android.app.ActivityThread.main(ActivityThread.java:7617)
 at java.lang.reflect.Method.invoke(Native Method)
 at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
2021-03-22 13:42:51.546 31138-31138/com.example.camera I/Process: Sending signal. PID: 31138 SIG: 9



What am I doing wrong ? Please advise.


edit


layout xml


<?xml version="1.0" encoding="utf-8"?>


 

 




-
Revision 571fce6546 : Merge "Fix use of NaN in firstpass" into experimental
18 mars 2013, par John KoleszarMerge "Fix use of NaN in firstpass" into experimental
-
Revision 9a56ea7e46 : Merge "Remove some unused rate control variables" into experimental
18 mars 2013, par John KoleszarMerge "Remove some unused rate control variables" into experimental