
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (65)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Dépôt de média et thèmes par FTP
31 mai 2013, parL’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)
Sur d’autres sites (12221)
-
Record video with Media Recorder in WEBM format
21 mai 2017, par MathoI need to record two videos via media recorder and process them with ffmpeg in Android. I want to read videos via pipe in ffmpeg command string. From what I have read, I could not use 3GPP/MP4 format, because these formats contains header at the end of video. Because of it, I want to use WEBM video format, but my app is crashing, when I use webm/vp8 setting in media recorder. Ffmpeg I’m using is : com.writingminds:FFmpegAndroid:0.3.2. Could you help me please ?
RecorderPrepareTask :
class RecorderPrepareTask extends AsyncTask {
private Context mContext;
public RecorderPrepareTask(Context context) {
mContext = context;
}
@Override
protected Boolean doInBackground(Void... voids) {
Timber.d("Starting screen recording...");
if (!outputRoot.exists() && !outputRoot.mkdirs()) {
Timber.e("Unable to create output directory '%s'.", outputRoot.getAbsolutePath());
return false;
}
recorder = new MediaRecorder();
recorder.setVideoSource(SURFACE);
recorder.setOutputFormat(MediaRecorder.OutputFormat.WEBM);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.VP8);
recorder.setVideoSize(Config.VIDEO_SIZE_W, Config.VIDEO_SIZE_H);
recorder.setVideoFrameRate(Config.FRAME_RATE);
Timber.i("Output file '%s'.", outputFileName);
recorder.setOutputFile(RecordingActivity.pipe[1].getFileDescriptor());
try {
recorder.prepare();
} catch (IOException e) {
throw new RuntimeException("Unable to prepare MediaRecorder.", e);
}
projection = projectionManager.getMediaProjection(resultCode, data);
Surface surface = recorder.getSurface();
display = projection.createVirtualDisplay(DISPLAY_NAME, Config.VIDEO_SIZE_W, Config.VIDEO_SIZE_H, 560, VIRTUAL_DISPLAY_FLAG_PRESENTATION, surface, null, null);
recorder.start();
return true;
}
@Override
protected void onPostExecute(Boolean result) {
}}
getConvertCmd :
private String getConvertCmd(){
return "-re -r 30 -f webm -c:v vp8 -i pipe:"+ RecordingActivity.pipe[0].getFd() + " -threads 2 -preset ultrafast -profile:v main -level 3.1 -b:v 440k -ar 44100 -ab 128k -s "+ Config.CAMERA_VIDEO_SIZE_W + "x" + Config.CAMERA_VIDEO_SIZE_H + " -vcodec vp8 -acodec vorbis " + outputFileName3;
}Logs :
D/SoftVPXEncoder: VP8: internalSetAndroidVp8Params. BRMode: 0. TS: 0. KF: 24. QP: 0 - 0 BR0: 100. BR1: 0. BR2: 0
I/ACodec: setupVideoEncoder succeeded
E/OMXNodeInstance: setConfig(1a:google.vp8.encoder, ConfigPriority(0x6f800002)) ERROR: Undefined(0x80001001)
I/ACodec: codec does not support config priority (err -2147483648)
W/ACodec: do not know color format 0x7f000789 = 2130708361
I/SoftMPEG4Encoder: Construct SoftMPEG4Encoder
I/MediaCodec: MediaCodec will operate in async mode
E/OMXNodeInstance: getParameter(1b:google.mpeg4.encoder, ParamVideoErrorCorrection(0x6000007)) ERROR: NotImplemented(0x80001006)
I/ACodec: setupVideoEncoder succeeded
E/OMXNodeInstance: setConfig(1b:google.mpeg4.encoder, ConfigPriority(0x6f800002)) ERROR: Undefined(0x80001001)
I/ACodec: codec does not support config priority (err -2147483648)
D/SoftVPXEncoder: VP8: initEncoder. BRMode: 0. TSLayers: 0. KF: 24. QP: 0 - 0
I/AudioFlinger: AudioFlinger's thread 0xb2440000 ready to run
xW/AudioFlinger: acquireAudioSessionId() unknown client 10079 for session 7
I/MediaCodec: MediaCodec will operate in async mode
/system_process I/DisplayManagerService: Display device added: DisplayDeviceInfo{"RMR": uniqueId="virtual:sk.matho.rocket_monkeys.rocketmonkeysrecorder,10052,RMR,0", 480 x 640, modeId 6, defaultModeId 6, supportedModes [{id=6, width=480, height=640, fps=60.0}], density 560, 560.0 x 560.0 dpi, appVsyncOff 0, presDeadline 16666666, touch NONE, rotation 0, type VIRTUAL, state ON, owner sk.matho.rocket_monkeys.rocketmonkeysrecorder (uid 10052), FLAG_PRIVATE, FLAG_PRESENTATION}
E/OMXNodeInstance: setConfig(1c:google.amrnb.encoder, ConfigPriority(0x6f800002)) ERROR: Undefined(0x80001001)
I/ACodec: codec does not support config priority (err -2147483648)
E/WebmElement: mmap64 failed; errno = 22
E/WebmElement: fd 18; flags: 1
E/WebmElement: mmap64 failed; errno = 22
E/WebmElement: fd 18; flags: 1
E/WebmElement: mmap64 failed; errno = 22
E/WebmElement: fd 18; flags: 1
E/WebmElement: mmap64 failed; errno = 22
E/WebmElement: fd 18; flags: 1
E/WebmElement: mmap64 failed; errno = 22
E/WebmElement: fd 18; flags: 1
E/WebmElement: mmap64 failed; errno = 22
E/WebmElement: fd 18; flags: 1
D/gralloc_ranchu: gralloc_alloc: format 1 and usage 0x10003 imply creation of host color buffer
I/MediaCodecSource: MediaCodecSource (video) starting
I/MediaCodecSource: MediaCodecSource (video) started
D/MPEG4Writer: Video track stopping
E/MPEG4Writer: Stop() called but track is not started
D/MPEG4Writer: Audio track stopping
E/MPEG4Writer: Stop() called but track is not started
[ 05-21 13:03:44.101 9757: 9766 D/ ]
HostConnection::get() New Host Connection established 0xb344f140, tid 9766
/sk.matho.rocket_monkeys.rocketmonkeysrecorder E/MediaRecorder: start failed: -2147483648
/sk.matho.rocket_monkeys.rocketmonkeysrecorder E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
Process: sk.matho.rocket_monkeys.rocketmonkeysrecorder, PID: 10079
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:309)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.RuntimeException: start failed.
at android.media.MediaRecorder.start(Native Method)
at sk.matho.rocket_monkeys.rocketmonkeysrecorder.recording.CameraRecordingSession$MediaPrepareTask.doInBackground(CameraRecordingSession.java:181)
at sk.matho.rocket_monkeys.rocketmonkeysrecorder.recording.CameraRecordingSession$MediaPrepareTask.doInBackground(CameraRecordingSession.java:173)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
[ 05-21 13:03:44.109 9757:10315 D/ ]
HostConnection::get() New Host Connection established 0xb307c1c0, tid 10315 -
Record video with Media Recorder in WEBM format
21 mai 2017, par MathoI need to record two videos via media recorder and process them with ffmpeg in Android. I want to read videos via pipe in ffmpeg command string. From what I have read, I could not use 3GPP/MP4 format, because these formats contains header at the end of video. Because of it, I want to use WEBM video format, but my app is crashing, when I use webm/vp8 setting in media recorder. Ffmpeg I’m using is : com.writingminds:FFmpegAndroid:0.3.2. Could you help me please ?
RecorderPrepareTask :
class RecorderPrepareTask extends AsyncTask {
private Context mContext;
public RecorderPrepareTask(Context context) {
mContext = context;
}
@Override
protected Boolean doInBackground(Void... voids) {
Timber.d("Starting screen recording...");
if (!outputRoot.exists() && !outputRoot.mkdirs()) {
Timber.e("Unable to create output directory '%s'.", outputRoot.getAbsolutePath());
return false;
}
recorder = new MediaRecorder();
recorder.setVideoSource(SURFACE);
recorder.setOutputFormat(MediaRecorder.OutputFormat.WEBM);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.VP8);
recorder.setVideoSize(Config.VIDEO_SIZE_W, Config.VIDEO_SIZE_H);
recorder.setVideoFrameRate(Config.FRAME_RATE);
Timber.i("Output file '%s'.", outputFileName);
recorder.setOutputFile(RecordingActivity.pipe[1].getFileDescriptor());
try {
recorder.prepare();
} catch (IOException e) {
throw new RuntimeException("Unable to prepare MediaRecorder.", e);
}
projection = projectionManager.getMediaProjection(resultCode, data);
Surface surface = recorder.getSurface();
display = projection.createVirtualDisplay(DISPLAY_NAME, Config.VIDEO_SIZE_W, Config.VIDEO_SIZE_H, 560, VIRTUAL_DISPLAY_FLAG_PRESENTATION, surface, null, null);
recorder.start();
return true;
}
@Override
protected void onPostExecute(Boolean result) {
}}
getConvertCmd :
private String getConvertCmd(){
return "-re -r 30 -f webm -c:v vp8 -i pipe:"+ RecordingActivity.pipe[0].getFd() + " -threads 2 -preset ultrafast -profile:v main -level 3.1 -b:v 440k -ar 44100 -ab 128k -s "+ Config.CAMERA_VIDEO_SIZE_W + "x" + Config.CAMERA_VIDEO_SIZE_H + " -vcodec vp8 -acodec vorbis " + outputFileName3;
}Logs :
D/SoftVPXEncoder: VP8: internalSetAndroidVp8Params. BRMode: 0. TS: 0. KF: 24. QP: 0 - 0 BR0: 100. BR1: 0. BR2: 0
I/ACodec: setupVideoEncoder succeeded
E/OMXNodeInstance: setConfig(1a:google.vp8.encoder, ConfigPriority(0x6f800002)) ERROR: Undefined(0x80001001)
I/ACodec: codec does not support config priority (err -2147483648)
W/ACodec: do not know color format 0x7f000789 = 2130708361
I/SoftMPEG4Encoder: Construct SoftMPEG4Encoder
I/MediaCodec: MediaCodec will operate in async mode
E/OMXNodeInstance: getParameter(1b:google.mpeg4.encoder, ParamVideoErrorCorrection(0x6000007)) ERROR: NotImplemented(0x80001006)
I/ACodec: setupVideoEncoder succeeded
E/OMXNodeInstance: setConfig(1b:google.mpeg4.encoder, ConfigPriority(0x6f800002)) ERROR: Undefined(0x80001001)
I/ACodec: codec does not support config priority (err -2147483648)
D/SoftVPXEncoder: VP8: initEncoder. BRMode: 0. TSLayers: 0. KF: 24. QP: 0 - 0
I/AudioFlinger: AudioFlinger's thread 0xb2440000 ready to run
xW/AudioFlinger: acquireAudioSessionId() unknown client 10079 for session 7
I/MediaCodec: MediaCodec will operate in async mode
/system_process I/DisplayManagerService: Display device added: DisplayDeviceInfo{"RMR": uniqueId="virtual:sk.matho.rocket_monkeys.rocketmonkeysrecorder,10052,RMR,0", 480 x 640, modeId 6, defaultModeId 6, supportedModes [{id=6, width=480, height=640, fps=60.0}], density 560, 560.0 x 560.0 dpi, appVsyncOff 0, presDeadline 16666666, touch NONE, rotation 0, type VIRTUAL, state ON, owner sk.matho.rocket_monkeys.rocketmonkeysrecorder (uid 10052), FLAG_PRIVATE, FLAG_PRESENTATION}
E/OMXNodeInstance: setConfig(1c:google.amrnb.encoder, ConfigPriority(0x6f800002)) ERROR: Undefined(0x80001001)
I/ACodec: codec does not support config priority (err -2147483648)
E/WebmElement: mmap64 failed; errno = 22
E/WebmElement: fd 18; flags: 1
E/WebmElement: mmap64 failed; errno = 22
E/WebmElement: fd 18; flags: 1
E/WebmElement: mmap64 failed; errno = 22
E/WebmElement: fd 18; flags: 1
E/WebmElement: mmap64 failed; errno = 22
E/WebmElement: fd 18; flags: 1
E/WebmElement: mmap64 failed; errno = 22
E/WebmElement: fd 18; flags: 1
E/WebmElement: mmap64 failed; errno = 22
E/WebmElement: fd 18; flags: 1
D/gralloc_ranchu: gralloc_alloc: format 1 and usage 0x10003 imply creation of host color buffer
I/MediaCodecSource: MediaCodecSource (video) starting
I/MediaCodecSource: MediaCodecSource (video) started
D/MPEG4Writer: Video track stopping
E/MPEG4Writer: Stop() called but track is not started
D/MPEG4Writer: Audio track stopping
E/MPEG4Writer: Stop() called but track is not started
[ 05-21 13:03:44.101 9757: 9766 D/ ]
HostConnection::get() New Host Connection established 0xb344f140, tid 9766
/sk.matho.rocket_monkeys.rocketmonkeysrecorder E/MediaRecorder: start failed: -2147483648
/sk.matho.rocket_monkeys.rocketmonkeysrecorder E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
Process: sk.matho.rocket_monkeys.rocketmonkeysrecorder, PID: 10079
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:309)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.RuntimeException: start failed.
at android.media.MediaRecorder.start(Native Method)
at sk.matho.rocket_monkeys.rocketmonkeysrecorder.recording.CameraRecordingSession$MediaPrepareTask.doInBackground(CameraRecordingSession.java:181)
at sk.matho.rocket_monkeys.rocketmonkeysrecorder.recording.CameraRecordingSession$MediaPrepareTask.doInBackground(CameraRecordingSession.java:173)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
[ 05-21 13:03:44.109 9757:10315 D/ ]
HostConnection::get() New Host Connection established 0xb307c1c0, tid 10315 -
I could not encode using the Intel® Media Server Studio on the ZOTAC ZBOX PI225
22 avril 2018, par UbunkunI’ve succeeded to install the Intel® Media Server Studio to the
ZOTAC ZBOX PI225. And, I’ve built the ffmepg as following.$ ffmpeg -codecs | grep qsv
ffmpeg version N-90764-g396c019 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-16)
configuration: --enable-libmfx
libavutil 56. 15.100 / 56. 15.100
libavcodec 58. 19.100 / 58. 19.100
libavformat 58. 13.100 / 58. 13.100
libavdevice 58. 4.100 / 58. 4.100
libavfilter 7. 18.100 / 7. 18.100
libswscale 5. 2.100 / 5. 2.100
libswresample 3. 2.100 / 3. 2.100
DEV.LS h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_qsv ) (encoders: h264_qsv h264_vaapi )
DEV.L. hevc H.265 / HEVC (High Efficiency Video Coding) (decoders: hevc hevc_qsv ) (encoders: hevc_qsv hevc_vaapi )
DEVIL. mjpeg Motion JPEG (encoders: mjpeg mjpeg_qsv mjpeg_vaapi )
DEV.L. mpeg2video MPEG-2 video (decoders: mpeg2video mpegvideo mpeg2_qsv ) (encoders: mpeg2video mpeg2_qsv mpeg2_vaapi )
D.V.L. vc1 SMPTE VC-1 (decoders: vc1 vc1_qsv )
DEV.L. vp8 On2 VP8 (decoders: vp8 vp8_qsv ) (encoders: vp8_vaapi )When I’ve tried to encode using ffmpeg, but It occurred error as below.
$ ffmpeg -i original.avi -c:v h264_qsv -profile:v main -b:v 2000k -r 30 -s 1280x720 -look_ahead 0 qsv.mp4
ffmpeg version N-90764-g396c019 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-16)
configuration: --enable-libmfx
libavutil 56. 15.100 / 56. 15.100
libavcodec 58. 19.100 / 58. 19.100
libavformat 58. 13.100 / 58. 13.100
libavdevice 58. 4.100 / 58. 4.100
libavfilter 7. 18.100 / 7. 18.100
libswscale 5. 2.100 / 5. 2.100
libswresample 3. 2.100 / 3. 2.100
Input #0, avi, from 'original.avi':
Metadata:
encoder : FairUse Wizard - http://fairusewizard.com
Duration: 01:41:12.11, start: 0.000000, bitrate: 965 kb/s
Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 592x304 [SAR 1:1 DAR 37:19], 828 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc
Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp, 128 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mpeg4 (native) -> h264 (h264_qsv))
Stream #0:1 -> #0:1 (mp3 (mp3float) -> aac (native))
Press [q] to stop, [?] for help
[mpeg4 @ 0x2fe5700] Video uses a non-standard and wasteful way to store B-frames ('packed B-frames'). Consider using the mpeg4_unpack_bframes bitstream filter without encoding but stream copy to fix it.
[h264_qsv @ 0x2fce7c0] Encoder will work with partial HW acceleration
[h264_qsv @ 0x2fce7c0] Error initializing the encoder: invalid video parameters (-15)
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[aac @ 0x2ff0e00] Qavg: 14764.986
[aac @ 0x2ff0e00] 2 frames left in the queue on closing
Conversion failed!It seems like that something of parameter missing, I think.
If you have an idea to solve this, let me know.
Bests,