
Recherche avancée
Médias (91)
-
GetID3 - Boutons supplémentaires
9 avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
-
Core Media Video
4 avril 2013, par
Mis à jour : Juin 2013
Langue : français
Type : Video
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
-
Exemple de boutons d’action pour une collection collaborative
27 février 2013, par
Mis à jour : Mars 2013
Langue : français
Type : Image
-
Exemple de boutons d’action pour une collection personnelle
27 février 2013, par
Mis à jour : Février 2013
Langue : English
Type : Image
Autres articles (104)
-
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
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 ;
Sur d’autres sites (13041)
-
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 -
Safari sends excessive HTTP range requests during HTML5 MOV playback
28 mai, par LucyI am currently developing a web application based on React and Next.js, and I use the react-player library to play user-uploaded videos stored on AWS S3. The supported upload video formats are mp4, mov, and mkv, with codecs including H.264 or H.265 (HEVC).


Problem


However, some
H.264
videos in themov
format exhibit noticeably poor playback performance only in the Safari browser. The videos do not play smoothly and frequently experience stuttering or delays.

How Safari Handles Range Requests (As I Understand It) :


- 

- Safari first sends a normal GET request to check if the server supports Range requests. If the server responds with the header Accept-Ranges : bytes, Safari closes the connection.
- Then, Safari sends a very small range request like Range : bytes=0-1 to confirm it receives a 206 Partial Content response.
- Next, Safari requests some parts from the beginning and the end of the file to locate metadata such as the moov atom in MP4 files.
- After that, actual streaming begins, but Safari does not request the entire file at once ; instead, it divides the needed parts into multiple small Range requests.










Example of Actual Problematic Requests


Below are some of the Range requests Safari makes for the problematic
.mov
video (H.264 codec) :

# Request - 1
Connection: keep-alive
Range: bytes=0-1

# Response
HTTP/1.1 206 Partial Content
Accept-Ranges: bytes
Content-Disposition: attachment;filename*=utf-8''test.mov
Content-Length: 2
Content-Range: bytes 0-1/102801747
Content-Type: video/quicktime

-------------------------------------
# Request - 2
Connection: Keep-Alive
Range: bytes=0-102801746

# Response
HTTP/1.1 206 Partial Content
Accept-Ranges: bytes
Content-Disposition: attachment;filename*=utf-8''test.mov
Content-Length: 102801747
Content-Range: bytes 0-102801746/102801747
Content-Type: video/quicktime

-------------------------------------
# Request - 3
Connection: Keep-Alive
Range: bytes=102760448-102801746

# Response - 3
HTTP/1.1 206 Partial Content
Accept-Ranges: bytes
Content-Disposition: attachment;filename*=utf-8''test.mov
Content-Length: 41299
Content-Range: bytes 102760448-102801746/102801747
Content-Type: video/quicktime

-------------------------------------
# Request - 4
Connection: keep-alive
Range: bytes=3014656-3080191 # 64KB

# Response - 4
HTTP/1.1 206 Partial Content
Accept-Ranges: bytes
Content-Disposition: attachment;filename*=utf-8''IMG_7929.mov
Content-Length: 65536
Content-Range: bytes 3014656-3080191/102801747
Content-Type: video/quicktime



Safari continues to send hundreds of similar small Range requests repeatedly, gradually downloading the file.


This causes increased network load, which ultimately leads to video stuttering or playback delays.


Example of another
.mov
file that works properly :

In contrast, another .mov video using the same format and codec (H.264) sends Range requests over much larger byte ranges, downloading about 30MB of data at once. In this case, the video plays smoothly.


# Request 
Connection: Keep-Alive
Range: bytes=1310534-673918954 # Request : 672MB, Actual Downloaded : 32MB

# Response
Accept-Ranges: bytes
Content-Disposition: attachment;filename*=utf-8''mov-example-video-download-4k-uhd-3840x2160.mov
Content-Length: 672608421
Content-Range: bytes 1310534-673918954/673918955
Content-Type: video/quicktime



Question


In Safari, for certain video files, the browser repeatedly closes the connection after receiving only a few kilobytes per request and immediately sends the next request. As a result, dozens or even hundreds of small range requests occur consecutively. This causes increased connection overhead and latency, and although the web server can deliver data at sufficient speed, the player does not receive data in time, leading to poor and stuttering video playback.


- 

- What could be the reason Safari repeatedly makes these very small requests for certain files ?
- Could the internal structure of the video file (such as the moov atom) influence this request pattern ?






f you have any similar experience or advice, please share.


What I'ved tried


- 

- Using
ffmpeg
to move themoov atom
to the beginning of the file with-movflags faststart
does not resolve the issue — the same problem persists. - Converting the exact same video to MP4 format and testing it results in normal playback without issues.






Test Environment


- 

- Macbook pro 16
- mac OS - Sequoia 15.5
- Safari - Latest








File information


Due to company policy, I am unable to share the problematic video files directly. However, I am attaching the file information obtained via ffprobe for your reference.


ffprobe -v error -show_format -show_streams -print_format json test.mov

{
 "streams": [
 {
 "index": 0,
 "codec_name": "h264",
 "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
 "profile": "High",
 "codec_type": "video",
 "codec_tag_string": "avc1",
 "codec_tag": "0x31637661",
 "width": 3840,
 "height": 2160,
 "coded_width": 3840,
 "coded_height": 2160,
 "closed_captions": 0,
 "film_grain": 0,
 "has_b_frames": 0,
 "pix_fmt": "yuv420p",
 "level": 51,
 "color_range": "tv",
 "color_space": "bt709",
 "color_transfer": "bt709",
 "color_primaries": "bt709",
 "chroma_location": "left",
 "field_order": "progressive",
 "refs": 1,
 "is_avc": "true",
 "nal_length_size": "4",
 "id": "0x1",
 "r_frame_rate": "30000/1001",
 "avg_frame_rate": "18200/607",
 "time_base": "1/600",
 "start_pts": 0,
 "start_time": "0.000000",
 "duration_ts": 10925,
 "duration": "18.208333",
 "bit_rate": "44900923",
 "bits_per_raw_sample": "8",
 "nb_frames": "546",
 "extradata_size": 158,
 "disposition": {
 "default": 1,
 "dub": 0,
 "original": 0,
 "comment": 0,
 "lyrics": 0,
 "karaoke": 0,
 "forced": 0,
 "hearing_impaired": 0,
 "visual_impaired": 0,
 "clean_effects": 0,
 "attached_pic": 0,
 "timed_thumbnails": 0,
 "non_diegetic": 0,
 "captions": 0,
 "descriptions": 0,
 "metadata": 0,
 "dependent": 0,
 "still_image": 0,
 "multilayer": 0
 },
 "tags": {
 "creation_time": "",
 "language": "und",
 "handler_name": "Core Media Video",
 "vendor_id": "[0][0][0][0]",
 "encoder": "H.264"
 }
 },
 {
 "index": 1,
 "codec_name": "aac",
 "codec_long_name": "AAC (Advanced Audio Coding)",
 "profile": "LC",
 "codec_type": "audio",
 "codec_tag_string": "mp4a",
 "codec_tag": "0x6134706d",
 "sample_fmt": "fltp",
 "sample_rate": "44100",
 "channels": 2,
 "channel_layout": "stereo",
 "bits_per_sample": 0,
 "initial_padding": 0,
 "id": "0x2",
 "r_frame_rate": "0/0",
 "avg_frame_rate": "0/0",
 "time_base": "1/44100",
 "start_pts": 0,
 "start_time": "0.000000",
 "duration_ts": 802988,
 "duration": "18.208345",
 "bit_rate": "187218",
 "nb_frames": "787",
 "extradata_size": 2,
 "disposition": {
 "default": 1,
 "dub": 0,
 "original": 0,
 "comment": 0,
 "lyrics": 0,
 "karaoke": 0,
 "forced": 0,
 "hearing_impaired": 0,
 "visual_impaired": 0,
 "clean_effects": 0,
 "attached_pic": 0,
 "timed_thumbnails": 0,
 "non_diegetic": 0,
 "captions": 0,
 "descriptions": 0,
 "metadata": 0,
 "dependent": 0,
 "still_image": 0,
 "multilayer": 0
 },
 "tags": {
 "creation_time": "",
 "language": "und",
 "handler_name": "Core Media Audio",
 "vendor_id": "[0][0][0][0]"
 }
 },
 {
 "index": 2,
 "codec_type": "data",
 "codec_tag_string": "mebx",
 "codec_tag": "0x7862656d",
 "id": "0x3",
 "r_frame_rate": "0/0",
 "avg_frame_rate": "0/0",
 "time_base": "1/600",
 "start_pts": 0,
 "start_time": "0.000000",
 "duration_ts": 10925,
 "duration": "18.208333",
 "bit_rate": "4",
 "nb_frames": "1",
 "disposition": {
 "default": 1,
 "dub": 0,
 "original": 0,
 "comment": 0,
 "lyrics": 0,
 "karaoke": 0,
 "forced": 0,
 "hearing_impaired": 0,
 "visual_impaired": 0,
 "clean_effects": 0,
 "attached_pic": 0,
 "timed_thumbnails": 0,
 "non_diegetic": 0,
 "captions": 0,
 "descriptions": 0,
 "metadata": 0,
 "dependent": 0,
 "still_image": 0,
 "multilayer": 0
 },
 "tags": {
 "creation_time": "",
 "language": "und",
 "handler_name": "Core Media Metadata"
 }
 },
 {
 "index": 3,
 "codec_type": "data",
 "codec_tag_string": "mebx",
 "codec_tag": "0x7862656d",
 "id": "0x4",
 "r_frame_rate": "0/0",
 "avg_frame_rate": "0/0",
 "time_base": "1/600",
 "start_pts": 0,
 "start_time": "0.000000",
 "duration_ts": 10925,
 "duration": "18.208333",
 "bit_rate": "6756",
 "nb_frames": "80",
 "disposition": {
 "default": 1,
 "dub": 0,
 "original": 0,
 "comment": 0,
 "lyrics": 0,
 "karaoke": 0,
 "forced": 0,
 "hearing_impaired": 0,
 "visual_impaired": 0,
 "clean_effects": 0,
 "attached_pic": 0,
 "timed_thumbnails": 0,
 "non_diegetic": 0,
 "captions": 0,
 "descriptions": 0,
 "metadata": 0,
 "dependent": 0,
 "still_image": 0,
 "multilayer": 0
 },
 "tags": {
 "creation_time": "",
 "language": "und",
 "handler_name": "Core Media Metadata"
 }
 },
 {
 "index": 4,
 "codec_type": "data",
 "codec_tag_string": "mebx",
 "codec_tag": "0x7862656d",
 "id": "0x5",
 "r_frame_rate": "0/0",
 "avg_frame_rate": "0/0",
 "time_base": "1/600",
 "start_pts": 0,
 "start_time": "0.000000",
 "duration_ts": 10925,
 "duration": "18.208333",
 "bit_rate": "50764",
 "nb_frames": "546",
 "disposition": {
 "default": 1,
 "dub": 0,
 "original": 0,
 "comment": 0,
 "lyrics": 0,
 "karaoke": 0,
 "forced": 0,
 "hearing_impaired": 0,
 "visual_impaired": 0,
 "clean_effects": 0,
 "attached_pic": 0,
 "timed_thumbnails": 0,
 "non_diegetic": 0,
 "captions": 0,
 "descriptions": 0,
 "metadata": 0,
 "dependent": 0,
 "still_image": 0,
 "multilayer": 0
 },
 "tags": {
 "creation_time": "",
 "language": "und",
 "handler_name": "Core Media Metadata"
 }
 },
 {
 "index": 5,
 "codec_type": "data",
 "codec_tag_string": "mebx",
 "codec_tag": "0x7862656d",
 "id": "0x6",
 "r_frame_rate": "0/0",
 "avg_frame_rate": "0/0",
 "time_base": "1/600",
 "start_pts": 0,
 "start_time": "0.000000",
 "duration_ts": 10925,
 "duration": "18.208333",
 "bit_rate": "19",
 "nb_frames": "1",
 "disposition": {
 "default": 1,
 "dub": 0,
 "original": 0,
 "comment": 0,
 "lyrics": 0,
 "karaoke": 0,
 "forced": 0,
 "hearing_impaired": 0,
 "visual_impaired": 0,
 "clean_effects": 0,
 "attached_pic": 0,
 "timed_thumbnails": 0,
 "non_diegetic": 0,
 "captions": 0,
 "descriptions": 0,
 "metadata": 0,
 "dependent": 0,
 "still_image": 0,
 "multilayer": 0
 },
 "tags": {
 "creation_time": "",
 "language": "und",
 "handler_name": "Core Media Metadata"
 }
 }
 ],
 "format": {
 "filename": "test.mov",
 "nb_streams": 6,
 "nb_programs": 0,
 "nb_stream_groups": 0,
 "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
 "format_long_name": "QuickTime / MOV",
 "start_time": "0.000000",
 "duration": "18.208345",
 "size": "102801747",
 "bit_rate": "45166871",
 "probe_score": 100,
 "tags": {
 "major_brand": "qt ",
 "minor_version": "0",
 "compatible_brands": "qt ",
 "creation_time": "",
 "com.apple.quicktime.location.accuracy.horizontal": "76.200233",
 "com.apple.quicktime.full-frame-rate-playback-intent": "0",
 "com.apple.quicktime.location.ISO6709": "",
 "com.apple.quicktime.make": "Apple",
 "com.apple.quicktime.model": "iPhone 15 Pro",
 "com.apple.quicktime.software": "18.4.1",
 "com.apple.quicktime.creationdate": ""
 }
 }
}



-
ffmpeg - Record Server Desktop Without Connection
21 janvier, par chrispI set up an application which uses ffmpeg to record a desktop on an Amazon AWS EC2 instance having Windows Server 2012 R2 installed. It records the desktop and puts the result into a file.



This works as long as a Remote Desktop or TeamViewer connection is active for that particular Amazon AWS EC2 instance. As soon as I close the Remote Desktop and TeamViewer connection the recording stops and continues as soon as I reconnect.



I assume that it's because the GPU doesn't deliver frames without a display in use.



How can I make sure that frames are constantly being rendered so that I can record them ?