
Recherche avancée
Autres articles (43)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
MediaSPIP Player : les contrôles
26 mai 2010, parLes contrôles à la souris du lecteur
En plus des actions au click sur les boutons visibles de l’interface du lecteur, il est également possible d’effectuer d’autres actions grâce à la souris : Click : en cliquant sur la vidéo ou sur le logo du son, celui ci se mettra en lecture ou en pause en fonction de son état actuel ; Molette (roulement) : en plaçant la souris sur l’espace utilisé par le média (hover), la molette de la souris n’exerce plus l’effet habituel de scroll de la page, mais diminue ou (...) -
Publier sur MédiaSpip
13 juin 2013Puis-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
Sur d’autres sites (7192)
-
FFMPEG Error Handling Not Working
23 mars 2017, par WaverunnerI’m fairly new to batch files and trying to create a Windows script that automatically converts all files in the extensions list I provide to MP4 and log the successes and failures. The problem I’m running into is that some of the videos are failing with zero byte outputs and even though there’s two levels of error handling so the originals don’t get deleted, they aren’t working and the originals get deleted regardless if the conversions succeed or not.
The two protections are :
(1) FFMPEG - abort_on empty_output option
(2) IF/ELSE loop that checks for zero-size files
Any ideas for better error handling would be appreciated.
:: Name: MKV2MP4.cmd
:: Purpose: Automatically converts non-MP4 video files to MP4 either by stream copy or by reencoding.
:: Revision: March 2017 - Initial version
:: Variables
:: %%L = List of Extensions
:: %%F = Files to be converted
:: %%N = New file
@echo OFF
CLS
setlocal
echo This script automatically converts non-MP4 video files to MP4 either by stream copy or by reencoding.
echo.
echo Changing to data directory...
Z:
cd Z:\Users\Todd\
echo.
FOR /F "delims=*" %%L IN (Z:\Logs\Extensions.txt) DO (
echo Collecting %%L files...
dir /b /s *.%%L > Z:\Logs\%%L.txt
)
echo.
echo File collection complete.
echo.
FOR /F "delims=*" %%L in (Z:\Logs\Extensions.txt) DO (
echo Working on %%L files...
echo.
FOR /F "delims=*" %%F in (Z:\Logs\%%L.txt) DO (
echo Converting "%%F"
echo.
ffmpeg.exe -y -i "%%F" -abort_on empty_output -aspect 16:9 -c:v copy -c:a copy "%%~dpnF.mp4" || ffmpeg.exe -y -i "%%F" -abort_on empty_output -aspect 16:9 -c:v libx265 -c:a copy "%%~dpnF.mp4"
echo.
set N="%%~dpnF.mp4"
IF %%~zN==0 (
echo Conversion failed! Skipping file.
echo Adding log entry...
echo %time% - Failed - "%%F" >> "Z:\Logs\%date:~-4,4%%date:~-10,2%%date:~-7,2% - %%L.txt"
) ELSE (
echo Conversion successful! Deleting old file.
echo Deleting "%%F"
del "%%F" /F
echo Adding log entry...
echo %time% - Successful - "%%F" >> "Z:\Logs\%date:~-4,4%%date:~-10,2%%date:~-7,2% - %%L.txt"
)
echo.
)
echo %%L files completed.
echo. Cleaning up...
del %%L /F /S
)
echo Job completed. Exiting.. -
Why do you need analytics for your WordPress ?
7 avril 2020, par Joselyn Khor — Analytics Tips, Plugins -
when i record video with javacv it comes "java.lang.NoClassDefFoundError : org.bytedeco.javacpp.avutil"
9 avril 2020, par Pradeep SimbaI make a video recorder android app with javacv.
But, when i run this app this error occurs "java.lang.NoClassDefFoundError : org.bytedeco.javacpp.avutil".



How can I solve this error ?



gradle.build file



android {
 ..............
 packagingOptions {
 exclude 'META-INF/services/javax.annotation.processing.Processor'
 pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.properties'
 pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.xml'
 pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.properties'
 pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.xml'
 }
}

dependencies {

implementation group: 'org.bytedeco', name: 'javacv', version: '1.1'
implementation group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.0.0-1.1', classifier: 'android-arm'
implementation group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.8.1-1.1', classifier: 'android-arm'
implementation group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.0.0-1.1', classifier: 'android-x86'
implementation group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.8.1-1.1', classifier: 'android-x86'

}




My demo code VideoService which will invoke in MainActivity



package com.fs.fs.api;

import com.fs.fs.App;
import com.fs.fs.utils.DateUtils;
import com.fs.fs.utils.FileUtils;

import org.bytedeco.javacpp.avcodec;
import org.bytedeco.javacv.FFmpegFrameRecorder;
import org.bytedeco.javacv.FrameRecorder;

import java.util.Date;

/**
 * Created by wyx on 2017/1/11.
 */
public class VideoService {
 private FFmpegFrameRecorder mFrameRecorder;
 private String path;

 private VideoService() {
 }

 private static class SingletonHolder {
 private static final VideoService INSTANCE = new VideoService();
 }

 public static VideoService getInstance() {
 return SingletonHolder.INSTANCE;
 }

 public void startRecordVideo() {
 String fileName = String.format("%s.%s", DateUtils.date2String(new Date(), "yyyyMMdd_HHmmss"), "mp4");
 path = FileUtils.getExternalFullPath(App.getInstance(), fileName);
 mFrameRecorder = new FFmpegFrameRecorder(path, 640, 480, 1);
 mFrameRecorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);
 mFrameRecorder.setVideoOption("tune", "zerolatency");
 mFrameRecorder.setVideoOption("preset", "ultrafast");
 mFrameRecorder.setVideoOption("crf", "28");
 mFrameRecorder.setVideoBitrate(300 * 1000);
 mFrameRecorder.setFormat("mp4");

 mFrameRecorder.setFrameRate(30);
 mFrameRecorder.setAudioOption("crf", "0");
 mFrameRecorder.setSampleRate(48 * 1000);
 mFrameRecorder.setAudioBitrate(960 * 1000);
 mFrameRecorder.setAudioCodec(avcodec.AV_CODEC_ID_AAC);
 try {
 mFrameRecorder.start();
 } catch (FrameRecorder.Exception e) {
 e.printStackTrace();
 }
 }

 public void stop() {
 if (mFrameRecorder != null) {
 try {
 mFrameRecorder.stop();
 mFrameRecorder.release();
 } catch (FrameRecorder.Exception e) {
 e.printStackTrace();
 }
 mFrameRecorder = null;
 }
 }

}




MainActivity



package com.fs.fs.activity;

import android.app.Activity;
import android.os.Bundle;

import com.fs.fs.R;
import com.fs.fs.api.VideoService;

import static java.lang.Thread.sleep;


public class MainActivity extends Activity {

 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);


 VideoService.getInstance().startRecordVideo();
 try {
 sleep(10 * 1000);
 } catch (InterruptedException e) {
 e.printStackTrace();
 }
 VideoService.getInstance().stop();
 }
}




Error



E/AndroidRuntime: FATAL EXCEPTION: main
 Process: com.example.usb, PID: 660
 java.lang.NoClassDefFoundError: org.bytedeco.javacpp.avutil
 at org.bytedeco.javacpp.Loader.load(Loader.java:590)
 at org.bytedeco.javacpp.Loader.load(Loader.java:530)
 at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694)
 at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149)
 at com.fs.fs.api.VideoService.startRecordVideo(VideoService.java:34)
 at com.fs.fs.activity.MainActivity.onCreate(MainActivity.java:75)
 at android.app.Activity.performCreate(Activity.java:5304)
 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)
 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)
 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2331)
 at android.app.ActivityThread.access$1000(ActivityThread.java:143)
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)
 at android.os.Handler.dispatchMessage(Handler.java:102)
 at android.os.Looper.loop(Looper.java:136)
 at android.app.ActivityThread.main(ActivityThread.java:5291)
 at java.lang.reflect.Method.invokeNative(Native Method)
 at java.lang.reflect.Method.invoke(Method.java:515)
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
 at dalvik.system.NativeStart.main(Native Method)
 Caused by: java.lang.ClassNotFoundException: org.bytedeco.javacpp.avutil
 at java.lang.Class.classForName(Native Method)
 at java.lang.Class.forName(Class.java:251)
 at org.bytedeco.javacpp.Loader.load(Loader.java:585)
 at org.bytedeco.javacpp.Loader.load(Loader.java:530) 
 at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694) 
 at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149) 
 at com.fs.fs.api.VideoService.startRecordVideo(VideoService.java:34) 
 at com.fs.fs.activity.MainActivity.onCreate(MainActivity.java:75) 
 at android.app.Activity.performCreate(Activity.java:5304) 
 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090) 
 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245) 
 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2331) 
 at android.app.ActivityThread.access$1000(ActivityThread.java:143) 
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244) 
 at android.os.Handler.dispatchMessage(Handler.java:102) 
 at android.os.Looper.loop(Looper.java:136) 
 at android.app.ActivityThread.main(ActivityThread.java:5291) 
 at java.lang.reflect.Method.invokeNative(Native Method) 
 at java.lang.reflect.Method.invoke(Method.java:515) 
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849) 
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665) 
 at dalvik.system.NativeStart.main(Native Method) 
 Caused by: java.lang.NoClassDefFoundError: org/bytedeco/javacpp/avutil
 at java.lang.Class.classForName(Native Method) 
 at java.lang.Class.forName(Class.java:251) 
 at org.bytedeco.javacpp.Loader.load(Loader.java:585) 
 at org.bytedeco.javacpp.Loader.load(Loader.java:530) 
 at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694) 
 at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149) 
 at com.fs.fs.api.VideoService.startRecordVideo(VideoService.java:34) 
 at com.fs.fs.activity.MainActivity.onCreate(MainActivity.java:75) 
 at android.app.Activity.performCreate(Activity.java:5304) 
 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090) 
 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245) 
 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2331) 
 at android.app.ActivityThread.access$1000(ActivityThread.java:143) 
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244) 
 at android.os.Handler.dispatchMessage(Handler.java:102) 
 at android.os.Looper.loop(Looper.java:136) 
 at android.app.ActivityThread.main(ActivityThread.java:5291) 
 at java.lang.reflect.Method.invokeNative(Native Method) 
 at java.lang.reflect.Method.invoke(Method.java:515) 
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849) 
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665) 
 at dalvik.system.NativeStart.main(Native Method) 
 Caused by: java.lang.ClassNotFoundException: Didn't find class "org.bytedeco.javacpp.avutil" on path: DexPathList[[zip file "/data/app/com.fs.fs-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.fs.fs-2, /vendor/lib, /system/lib, /data/datalib]]
 at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
 at java.lang.Class.classForName(Native Method) 
 at java.lang.Class.forName(Class.java:251) 
 at org.bytedeco.javacpp.Loader.load(Loader.java:585) 
 at org.bytedeco.javacpp.Loader.load(Loader.java:530) 
 at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694) 
 at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149) 
 at com.fs.fs.api.VideoService.startRecordVideo(VideoService.java:34) 
 at com.fs.fs.activity.MainActivity.onCreate(MainActivity.java:75) 
 at android.app.Activity.performCreate(Activity.java:5304) 
 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090) 
 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245) 
 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2331) 
 at android.app.ActivityThread.access$1000(ActivityThread.java:143) 
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244) 
 at android.os.Handler.dispatchMessage(Handler.java:102) 
 at android.os.Looper.loop(Looper.java:136) 
 at android.app.ActivityThread.main(ActivityThread.java:5291) 
 at java.lang.reflect.Method.invokeNative(Native Method) 
 at java.lang.reflect.Method.invoke(Method.java:515) 
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849) 
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665) 
 at dalvik.system.NativeStart.main(Native Method) 
</init></clinit></init></clinit></init></clinit></init></clinit>



How can i solve this error ?



Why error occurs ?