
Recherche avancée
Médias (3)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Podcasting Legal guide
16 mai 2011, par
Mis à jour : Mai 2011
Langue : English
Type : Texte
-
Creativecommons informational flyer
16 mai 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (99)
-
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 ;
-
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 (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.
Sur d’autres sites (11162)
-
'Source code does not match byte code' Android Studio
26 août 2020, par ConnoeI'm developing an Android video editing app using FFmpeg libraries in Android Studio version 4.01. When I try to debug, the debugger steps into the decompiler and flashes, 'Source code does not match byte code' across multiple steps through the decompiled code. The debugger also seems to be jumping around the decompiled code semi-randomly, for example : here, where logSlowDispatch is false but the debugger steps into the contents of the if statement anyway without checking and flashes 'Source code does not match byte code'. I've looked at alot of posts about this problem and have tried many of the suggested solutions from invalidate cache/restart to a fresh install of Android Studio to no avail. I've read that redundant or outdated gradle dependencies might have something to do with this, but removing some of these dependencies hasn't helped :


apply plugin: 'com.android.application'

android {
 compileSdkVersion 29
 defaultConfig {
 applicationId "com.example.capstoneapplication"
 minSdkVersion 21
 targetSdkVersion 29
 versionCode 1
 versionName "1.0"
 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
 ndkVersion "21.3.6528147"
 }
 buildTypes {
 release {
 minifyEnabled false
 proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
 }
 }
}

dependencies {
 implementation fileTree(dir: 'libs', include: ['*.jar'])

 implementation 'com.android.support.constraint:constraint-layout:2.0.0'

 testImplementation 'junit:junit:4.12'
 androidTestImplementation 'com.android.support.test:runner:1.0.2'
 androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

 implementation 'com.writingminds:FFmpegAndroid:0.3.2'

 implementation 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0'

 implementation 'com.intuit.sdp:sdp-android:1.0.6'
}



My code seems to be running properly and executing the ffmpeg command on the desired video between these jumps to the decompiler, but the video does not save. Here is a snippet from the java class that might be causing this :


@Override
 public boolean onOptionsItemSelected(MenuItem menuItem){
 if(menuItem.getItemId()==R.id.trim){
 final AlertDialog.Builder alertDialog = new AlertDialog.Builder(com.example.capstoneapplication.VideoTrimmer.this);

 LinearLayout linLay = new LinearLayout(com.example.capstoneapplication.VideoTrimmer.this);
 linLay.setOrientation(LinearLayout.VERTICAL);
 LinearLayout.LayoutParams layPar = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
 layPar.setMargins(50, 0, 50, 100 );
 final EditText input = new EditText(com.example.capstoneapplication.VideoTrimmer.this);
 input.setLayoutParams(layPar);
 input.setGravity(Gravity.TOP|Gravity.START);
 input.setInputType(InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);
 linLay.addView(input,layPar);

 alertDialog.setMessage("Enter Video Name");
 alertDialog.setTitle("Change Video Name");
 alertDialog.setView(linLay);
 alertDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
 @Override
 public void onClick(DialogInterface dialog, int which) {
 dialog.dismiss();
 }
 });
 alertDialog.setPositiveButton("Submit", new DialogInterface.OnClickListener() {
 @Override
 public void onClick(DialogInterface dialog, int which) {
 fileName = input.getText().toString();

 try {
 snipVideo(videoDurBar.getAbsoluteMinValue().intValue(), videoDurBar.getSelectedMaxValue().intValue(), fileName);
 } catch ( FFmpegNotSupportedException e) {
 e.printStackTrace();
 }


 }
 });
 alertDialog.show();
 }
 return super.onOptionsItemSelected(menuItem);
 }

 private void snipVideo( int min, int max, String fileName) throws FFmpegNotSupportedException {

 File destFolder = new File("storage/emulated/0" + "/EditingApeSnippedVideos");
 if(!destFolder.exists()){
 destFolder.mkdir();
 }
 String fileExtension = ".mp4";
 destination = new File(destFolder, fileName + fileExtension);
 inputVideoPath = getPathFromUri(getApplicationContext(),uri);


 command = new String[]{"-ss", "" + min/1000 , "-y", "-i", inputVideoPath, "-t", ""+ (max-min)/1000 ,"-vcodec", "mpeg4", "-b:v","2097152","-b:a", "48000", "-ac","2","-ar","22050", destination.getAbsolutePath()};

 //testing command
 //command = new String []{"-y", "-i", inputVideoPath, "-ss", "00:00:02" , "-to", "00:00:03", "-c", "copy", destination.getAbsolutePath()};
 final FFmpeg ff = FFmpeg.getInstance(this);
 ff.loadBinary(new FFmpegLoadBinaryResponseHandler() {

 @Override
 public void onStart() {

 Log.i("VideoTrimmer","onStart");
 }

 @Override
 public void onFinish() {
 Log.i("VideoTrimmer","onFinish");
 }

 @Override
 public void onFailure() {
 Log.i("VideoTrimmer","onFailure");
 }

 @Override
 public void onSuccess() {
 Log.i("VideoTrimmer","Success");
 try {
 ff.execute(command, new ExecuteBinaryResponseHandler());
 } catch (FFmpegCommandAlreadyRunningException e) {
 Log.i("VideoTrimmer","FFmpegAlreadyRunning Exception");

 }
 }
 });
 }



Has anyone found a solution to this debugger issue ?


-
Low latency rendering pipeline Implementation [closed]
9 septembre 2024, par Makis ChristouThe goal that I am trying to accomplish is to be able to render small/per-compressed (<5MB) videos based on a given config on demand. The config would tell the renderer what text/icons to overlay on the video for example. Currently I have decided to go with
ffmpeg
and wrapping it in a flask api using Python (I use theffmpeg-python
module). The api has 2 routes. An upload route and a render route. So some other service first uploads their background video (which will be reused) and then use the render route to choose a different config, on demand, to render on top of their background video.

Currently an average video takes 0.4s (on a 7950x 128GB RAM) to be rendered and the whole request including I/O, starting ffmpeg, reading assets from SSD and everything takes around 0.7s. That is when the server is not busy at all. Once we increase the concurrent requests it quickly drops to 4-5s range when handling 10 concurrent requests and increases linearly thereafter. We have a predefined output resolution and its the lowest possible before quality takes a hit so reducing further is not an option.


My goal here is 2 fold.


- 

- Reduce latency i.e. keep it under 2s instead of 5 for 10 concurrent renders (the hard part)
- Increase throughput (easier to achieve but looking for cost effectiveness here)






Besides vertical scaling (to reduce render time < 0.4s), moving the server closer to the client (to reduce network latency) are there any obvious ways to reduce the latency of a single request ? One inefficiency that I see is that ffmpeg starts/stops as a new process in every request. Also assets are loaded from disk when ffmpeg starts for each request. Not sure if there is a way to solve this by keeping it all in RAM 24/7. Also have not tried GPUs but I assume it will be worse since copying to the GPU back and forth is expensive.


For increasing throughput, load balancing on multiple machines is the way to go but then I would need a shared storage solution with caching. Any recommendations that are performance oriented ?


Explained above.


- 

- use ffmpeg
- use a better server






-
How to use FFMPEG on Python/Windows10 with Pipe for Screen recording ?
20 septembre 2020, par TrmottaI'd like to record the screen with ffmpeg as it seems to be the only player out there who can record a region of the screen along with the mouse cursor.


The following code was adapted from i want to display mouse pointer in my recording but it doesn't work on a Windows 10 (x64) setup (using Python 3.6).


#!/usr/bin/env python3

# ffmpeg -y -pix_fmt bgr0 -f avfoundation -r 20 -t 10 -i 1 -vf scale=w=3840:h=2160 -f rawvideo /dev/null

import sys
import cv2
import time
import subprocess
import numpy as np

w,h = 100, 100

def ffmpegGrab():
 """Generator to read frames from ffmpeg subprocess"""

 #ffmpeg -f gdigrab -framerate 30 -offset_x 10 -offset_y 20 -video_size 640x480 -show_region 1 -i desktop output.mkv #CODE THAT ACTUALLY WORKS WITH FFMPEG CLI

 cmd = 'D:/Downloads/ffmpeg-20200831-4a11a6f-win64-static/ffmpeg-20200831-4a11a6f-win64-static/bin/ffmpeg.exe -f gdigrab -framerate 30 -offset_x 10 -offset_y 20 -video_size 100x100 -show_region 1 -i desktop -f image2pipe, -pix_fmt bgr24 -vcodec rawvideo -an -sn' 

 proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 #out, err = proc.communicate()
 while True:
 frame = proc.stdout.read(w*h*3)
 yield np.frombuffer(frame, dtype=np.uint8).reshape((h,w,3))

# Get frame generator
gen = ffmpegGrab()

# Get start time
start = time.time()

# Read video frames from ffmpeg in loop
nFrames = 0
while True:
 # Read next frame from ffmpeg
 frame = next(gen)
 nFrames += 1

 cv2.imshow('screenshot', frame)

 if cv2.waitKey(1) == ord("q"):
 break

 fps = nFrames/(time.time()-start)
 print(f'FPS: {fps}')


cv2.destroyAllWindows()
out.release()



By using 'cmd' as stated above, I'll get the following error :


b"ffmpeg version git-2020-08-31-4a11a6f Copyright (c) 2000-2020 the FFmpeg developers\r\n built with gcc 10.2.1 (GCC) 20200805\r\n configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --enable-librav1e --enable-libsvtav1 --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf\r\n libavutil 56. 58.100 / 56. 58.100\r\n libavcodec 58.101.101 / 58.101.101\r\n libavformat 58. 51.101 / 58. 51.101\r\n libavdevice 58. 11.101 / 58. 11.101\r\n libavfilter 7. 87.100 / 7. 87.100\r\n libswscale 5. 8.100 / 5. 8.100\r\n libswresample 3. 8.100 / 3. 8.100\r\n libpostproc 55. 8.100 / 55. 8.100\r\nTrailing option(s) found in the command: may be ignored.\r\n[gdigrab @ 0000017ab857f100] Capturing whole desktop as 100x100x32 at (10,20)\r\nInput #0, gdigrab, from 'desktop':\r\n Duration: N/A, start: 1599021857.538752, bitrate: 9612 kb/s\r\n Stream #0:0: Video: bmp, bgra, 100x100, 9612 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc\r\n**At least one output file must be specified**\r\n"



Which is the contents of proc (and also of proc.communicate). The program crashes right after when trying to resize this message to an image of size 100x100.


I do not want to have an output file. I need to use Python subprocess along with Pipe in order to directly deliver those screen frames to my Python code, no IO required at all.


If I try the following :


cmd = 'D :/Downloads/ffmpeg-20200831-4a11a6f-win64-static/ffmpeg-20200831-4a11a6f-win64-static/bin/ffmpeg.exe -f gdigrab -framerate 30 -offset_x 10 -offset_y 20 -video_size 100x100 -i desktop -pix_fmt bgr24 -vcodec rawvideo -an -sn -f image2pipe'


proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)



Then 'frame', inside 'while True', is filled with b''.


Tried using the following libraries with no success, as I couldnt either find how to capture the mouse cursor or capture the screen at all : https://github.com/abhiTronix/vidgear, https://github.com/kkroening/ffmpeg-python


What am I missing ?
Thank you.