
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 (59)
-
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 ;
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)
Sur d’autres sites (5736)
-
Android JavaCV FFmpeg webstream to local static website
26 mars 2017, par Thomas DevoogdtFor my integrated test I’m working on an application that needs to provide a live stream to a locally hosted website. I’ve already built a working site that run’s on nanohttpd. This application performs also special image processing. Therefore I use JavaCV. The library is working perfectly and all cpp bindings are working too.
My question : How to set up a live stream that can directly be played in a static site hosted by nanohttpd ? - I am on the right way ?
My code :
init :
private void initLiveStream() throws FrameRecorder.Exception {
/* ~~~ https://github.com/bytedeco/javacv/issues/598 ~~~ */
frameRecorder = new FFmpegFrameRecorder("http://localhost:9090", imageWidth, imageHeight, 0);
frameRecorder.setVideoOption("preset", "ultrafast");
frameRecorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);
frameRecorder.setAudioCodec(0);
frameRecorder.setPixelFormat(avutil.AV_PIX_FMT_YUV420P);
frameRecorder.setFormat("webm");
frameRecorder.setGopSize(10);
frameRecorder.setFrameRate(frameRate);
frameRecorder.setVideoBitrate(5000);
frameRecorder.setOption("content_type","video/webm");
frameRecorder.setOption("listen", "1");
frameRecorder.start();
}In my CameraView :
@Override
public void onPreviewFrame(byte[] data, Camera camera) {
Camera.Size size = camera.getParameters().getPreviewSize();
Frame frame = new AndroidFrameConverter().convert(data, size.width, size.height);
try {
if(frameRecorder!=null){
frameRecorder.record(frame);
}
} catch (FrameRecorder.Exception e) {
e.printStackTrace();
}
}Here is one of the stack traces that ar shown frequently in my search to the solution :
org.bytedeco.javacv.FrameRecorder$Exception: avio_open error() error -111: Could not open 'http://localhost:9090'
I couldn’t find any other thread addressing this specific issue.
Thanks in advance
EDIT
Thanks to Chester Cobus, Here is my used code :
Websocket :
//Constructor
AsyncHttpServer serverStream = new AsyncHttpServer();
List<websocket> sockets = new ArrayList<>();
//http://stackoverflow.com/a/33021907/5500092
//I'm planning to use more sockets. This is the only uniform expression I found.
serverStream.websocket("/((?:[^/]*/)*)(.*)", new AsyncHttpServer.WebSocketRequestCallback() {
@Override
public void onConnected(final WebSocket webSocket, AsyncHttpServerRequest request) {
String uri = request.getPath();
if (uri.equals("/live")) {
sockets.add(webSocket);
//Use this to clean up any references to your websocket
webSocket.setClosedCallback(new CompletedCallback() {
@Override
public void onCompleted(Exception ex) {
try {
if (ex != null)
Log.e("WebSocket", "Error");
} finally {
sockets.remove(webSocket);
}
}
});
}
}
});
//Updater (Observer pattern)
@Override
public void updated(byte[] data) {
for (WebSocket socket : sockets) {
socket.write(new ByteBufferList(data));
}
}
</websocket>Record Acitivy
private long start_time = System.currentTimeMillis();
@Override
public void onPreviewFrame(byte[] data, Camera camera) {
long now_time = System.currentTimeMillis();
if ((now_time - start_time) > 250) {
start_time = now_time;
//https://forums.xamarin.com/discussion/40991/onpreviewframe-issue-converting-preview-byte-to-android-graphics-bitmap
Camera.Size size = camera.getParameters().getPreviewSize();
YuvImage image = new YuvImage(data, ImageFormat.NV21, size.width, size.height, null);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
image.compressToJpeg(new Rect(0, 0, size.width, size.height), 60, byteArrayOutputStream);
MainActivity.getWebStreamer().updated(byteArrayOutputStream.toByteArray());
}
}JavaScript
var socket;
var imageElement;
/**
* path - String.Format("ws://{0}:8090/live", Window.Location.HostName)
* image - HTMLImageElement
*/
function imageStreamer(path, image) {
imageElement = image;
socket = new WebSocket(path);
socket.onmessage = function(msg) {
var arrayBuffer = msg.data;
var reader = new FileReader();
reader.onload = function(e) {
imageElement.src = e.target.result;
};
reader.readAsDataURL(arrayBuffer);
};
} -
FFMpeg : how to blur two fixed regions at the bottom of the video file ?
24 décembre 2022, par bully44I'm trying to blur to rectangular regions at the bottom of the video. Only short region around center should stay as it is, and 140 pixels regions on both sides should be blurred.
The left region is ok, but just cannot set correctly the right one. For visual reason, I'm displaying it higher, but I just cannot get x coordinate and size in correct position.


ffmpeg -i Test1.mp4 -filter_complex \
"[0:v]crop=iw/2-40:140:0:ih-140,avgblur=10[b0]; \
 [0:v]crop=iw/2-50:140:iw/2+200:ih-140,avgblur=5[b1]; \
 [0:v][b0]overlay=0:H-h[ovr0]; \
 [ovr0][b1]overlay=W/2+100:H-h-500" \
 -c:a copy -movflags +faststart Test_blur.mp4



As FFMpeg newbie, I must be doing something obviously wrong.
Thanks in advance,
regards.


-
ffmpeg converting mov to mp4
16 mai 2019, par alienbuildTrying to convert .mov to .mp4. Tried various suggestion codes on stackoverflow but nothing seems to be working.
`...muxer does not support non seekable output [48] => Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument [49] => Error initializing output stream 0:0 -- [50] => Conversion failed! ) 1`
I’ve tried various codec properties such as ac3, aac, libvo_aacenc
exec('
/usr/local/bin/ffmpeg -y -i https://***.***.com/assets/regions/region-1/input.mov' .
' -c:a ac3 '
. 'https://***.***.com/assets/regions/region-1/output.mp4'
. ' 2>&1', $out, $res);
$modx->log(modX::LOG_LEVEL_ERROR, print_r($out));
$modx->log(modX::LOG_LEVEL_ERROR, $res);
return true;