
Recherche avancée
Autres articles (61)
-
Les vidéos
21 avril 2011, parComme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...) -
Pas question de marché, de cloud etc...
10 avril 2011Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
sur le web 2.0 et dans les entreprises qui en vivent.
Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...) -
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs
Sur d’autres sites (6954)
-
What CRF matches with a JPEG compression rate
21 janvier 2017, par XlsxI have a very basic program that I wrote in python that takes a video from a webcam and saves it to an mp4 file. Each frame is saved as a jpeg file, and then I use ffmpeg to merge all the frames together. There are two different compression options - the JPEG compression quality, and the mp4 CRF. Which CRF should I use relative to the JPEG compression quality so that the mp4 file is the smallest file size it can be, while not losing data from the already lossy jpeg and not adding extra data to the mp4 ?
For example, I save my JPEGs with a quality of 30
When I use ffmpeg, I set the -crf parameter to 38
When I look at the final mp4 file, I have lost quality from the JPEGs -
JavaCV record video in Android
11 janvier 2017, par wyxI want to record video quiet and without preview in Android. So I choice MediaRecorder but I could record only without preview but what make me crazy is that when MediaRecorder start or stop it will with a sound dee.... I try many methods about that . But I think it perhaps sth related to the OS of the mobile. So I try JavaCV because I also want to have a Live function in my app.
But JavaCV spent me to too much time to solve some strange problems because it’s my first time to do sth about C++ src and video.
Just
compile group: 'org.bytedeco', name: 'javacv-platform', version: '1.3'
as the README.md ,I even can’t build my apk.Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK org/bytedeco/javacpp/macosx-x86_64/libusb-1.0.dylib
File1: /Users/wyx/.gradle/caches/modules-2/files-2.1/org.bytedeco.javacpp-presets/libfreenect/0.5.3-1.3/736d65a3ef042258429d8e7742128c411806b432/libfreenect-0.5.3-1.3-macosx-x86_64.jar
File2: /Users/wyx/.gradle/caches/modules-2/files-2.1/org.bytedeco.javacpp-presets/libdc1394/2.2.4-1.3/f1498dacc46162ab68faeb8d66cf02b96fe41c61/libdc1394-2.2.4-1.3-macosx-x86_64.jarAnd then I modified it according this issuse
use this to repalce. It can build the apk. But the can’t run.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 {
compile group: 'org.bytedeco', name: 'javacv', version: '1.3'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.2.1-1.3', classifier: 'android-x86'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.2.1-1.3', classifier: 'android-arm'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.1.0-1.3', classifier: 'android-x86'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.1.0-1.3', classifier: 'android-arm'
}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 which make me want to cry.
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.fs.fs, PID: 30259
java.lang.NoClassDefFoundError: java.lang.ClassNotFoundException: 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>So I want to know a comfortable method to achieve my goal : recode video quiet and without preview. And Live real time ?
I found ffmpeg4android is a prefect library to run ffmpeg command. I just use it to compress videos from MediaRecorder But I don’t how to do use it to achieve my goal.
-
understanding libx264 output [closed]
11 août 2015, par nmxprimeI used libx264 in ffmpeg to encode . Finally i got below output .
Can anyone guide me understanding & interpreting this ?? Any reference/documentation ?
01-01 06:34:43.650: I/stderr(6603): [libx264 @ 0xdd2040] frame I:7 Avg QP:27.51 size: 11996
01-01 06:34:43.650: I/stderr(6603): [libx264 @ 0xdd2040] frame P:32 Avg QP:26.90 size: 217
01-01 06:34:43.650: I/stderr(6603): [libx264 @ 0xdd2040] frame B:25 Avg QP:32.73 size: 39
01-01 06:34:43.650: I/stderr(6603): [libx264 @ 0xdd2040] consecutive B-frames: 20.0% 80.0%
01-01 06:34:43.650: I/stderr(6603): [libx264 @ 0xdd2040] mb I I16..4: 74.1% 17.0% 8.9%
01-01 06:34:43.650: I/stderr(6603): [libx264 @ 0xdd2040] mb P I16..4: 0.7% 0.1% 0.0% P16..4: 2.0% 0.3% 0.2% 0.0% 0.0% skip:96.6%
01-01 06:34:43.650: I/stderr(6603): [libx264 @ 0xdd2040] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 1.2% 0.0% 0.0% direct: 0.1% skip:98.8% L0: 5.5% L1:94.5% BI: 0.0%
01-01 06:34:43.650: I/stderr(6603): [libx264 @ 0xdd2040] final ratefactor: 22.43
01-01 06:34:43.650: I/stderr(6603): [libx264 @ 0xdd2040] 8x8 transform intra:16.9% inter:51.1%
01-01 06:34:43.650: I/stderr(6603): [libx264 @ 0xdd2040] coded y,uvDC,uvAC intra: 12.8% 27.2% 24.4% inter: 0.3% 0.6% 0.0%
01-01 06:34:43.650: I/stderr(6603): [libx264 @ 0xdd2040] i16 v,h,dc,p: 95% 5% 0% 0%
01-01 06:34:43.650: I/stderr(6603): [libx264 @ 0xdd2040] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 2% 30% 60% 0% 1% 0% 2% 0% 4%
01-01 06:34:43.650: I/stderr(6603): [libx264 @ 0xdd2040] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 7% 58% 10% 2% 4% 2% 9% 1% 8%
01-01 06:34:43.650: I/stderr(6603): [libx264 @ 0xdd2040] i8c dc,h,v,p: 14% 81% 3% 3%
01-01 06:34:43.650: I/stderr(6603): [libx264 @ 0xdd2040] Weighted P-Frames: Y:0.0% UV:0.0%
01-01 06:34:43.650: I/stderr(6603): [libx264 @ 0xdd2040] ref P L0: 81.2% 16.6% 1.8% 0.4%
01-01 06:34:43.650: I/stderr(6603): [libx264 @ 0xdd2040] ref B L0: 70.8% 29.2%
01-01 06:34:43.650: I/stderr(6603): [libx264 @ 0xdd2040] kb/s:287.21Edit :
I want to know what determines rate factor ? Is it relevant to fps ?
What is QP and it’s relation with rate factor ?Thank You !!