
Recherche avancée
Autres articles (85)
-
L’agrémenter visuellement
10 avril 2011MediaSPIP est basé sur un système de thèmes et de squelettes. Les squelettes définissent le placement des informations dans la page, définissant un usage spécifique de la plateforme, et les thèmes l’habillage graphique général.
Chacun peut proposer un nouveau thème graphique ou un squelette et le mettre à disposition de la communauté. -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)
Sur d’autres sites (11170)
-
How to split the Video into Frames using FFMPEG in Spring-Boot ?
8 octobre 2020, par Abhinay KTo fetch Frames from Video with 5fps rate with specified Start and end Time in video with following FFMPEG command,


ffmpeg -i input.mp4 -ss 00:00:54 -to 00:01:53 -r 5 -f image2 image-%13d.png,


I want to implement the same in the Spring-boot application,


I found the following code snippet to fetch frames from Video,


public static void main(String[] args) {
 Java2DFrameConverter bimConverter = new Java2DFrameConverter();
 FFmpegFrameGrabber g = new FFmpegFrameGrabber("input.mp4");
 try {
 g.start();
 for (int i = 0; i < 50; i++) {
 ImageIO.write(bimConverter.convert(g.grab()), "png", new File(
 "image-" + System.currentTimeMillis() + ".png"));
 }
 g.stop();
 } catch (IOException ie) {
 ie.printStackTrace();
 } catch (Exception e) {
 e.printStackTrace();
 }
}



but I required logic to implement as output from following command,


ffmpeg -i input.mp4 -ss 00:00:54 -to 00:01:53 -r 5 -f image2 image-%13d.png,


Please help me out the logic need to implement,


-
Joining/Concatenating more than one video files in Java Spring Boot
7 décembre 2020, par Rohan ShahI am trying to join/concate multiple files in Java, so far the procedure that I was following (
https://github.com/bramp/ffmpeg-cli-wrapper
) was going alright, but in this procedure, there were a couple of lines that I could not understand.

Code I am following :


FFmpeg ffmpeg = new FFmpeg("/path/to/ffmpeg");
FFprobe ffprobe = new FFprobe("/path/to/ffprobe");

FFmpegBuilder builder = new FFmpegBuilder()

 .setInput("input.mp4") // Filename, or a FFmpegProbeResult
 .addInput("input2.mp4") // <-------------------------------- Second file that I added
 .overrideOutputFiles(true) // Override the output if it exists

 .addOutput("output.mp4") // Filename for the destination
 .setFormat("mp4") // Format is inferred from filename, or can be set
 .setTargetSize(250_000) // Aim for a 250KB file

 .disableSubtitle() // No subtiles

 .setAudioChannels(1) // Mono audio
 .setAudioCodec("aac") // using the aac codec
 .setAudioSampleRate(48_000) // at 48KHz
 .setAudioBitRate(32768) // at 32 kbit/s

 .setVideoCodec("libx264") // Video using x264
 .setVideoFrameRate(24, 1) // at 24 frames per second
 .setVideoResolution(640, 480) // at 640x480 resolution

 .setStrict(FFmpegBuilder.Strict.EXPERIMENTAL) // Allow FFmpeg to use experimental specs
 .done();

FFmpegExecutor executor = new FFmpegExecutor(ffmpeg, ffprobe);

// Run a one-pass encode
executor.createJob(builder).run();

// Or run a two-pass encode (which is better quality at the cost of being slower)
executor.createTwoPassJob(builder).run();



These are the lines throwing error :


FFmpeg ffmpeg = new FFmpeg("/path/to/ffmpeg");
FFprobe ffprobe = new FFprobe("/path/to/ffprobe");



In these lines, I am providing a path like this,


FFmpeg ffmpeg = new FFmpeg("D:/");
FFprobe ffprobe = new FFprobe("D:/");



which leads to an error


java.io.IOException: CreateProcess error=5



I believe the
ffmpeg
in/path/to/ffmpeg
andffprobe
in/path/to/ffprobe
are files, not directories, which is why it threw an execution permission error, but as I looked into the repository (link given above) I was not able to find this particular file in the given link.

There were a couple of Java files named
ffmpeg.java
andffprobe.java
, but when I tried using them in the code then I got the same error, so I want to know which files am I supposed to have in these paths

-
How to use Jaffree with Spring Boot for streaming a RTSP flow
25 août 2022, par JmarchiIm trying to build a APIRest and one of the things i want to do is recirculate the rtsp video provided by some security cameras to the frontend.


I have found the Jaffree, a dependency that integrates the ffmpeg into spring, until then all is good.


The problem is when i try to send the video to the frontend (make in React) i recieve this error :




Starting process : ffmpeg


Waiting for process to finish


...


Input #0, mpjpeg, from __________


Duration : N/A, bitrate : N/A


Stream #0:0 : Video : mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1920x1080 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn


[warning] Codec AVOption b (set bitrate (in bits/s)) specified for output file #0 (tcp ://127.0.0.1:52225) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.


Output #0, ismv, to 'tcp ://127.0.0.1:52225' :


Metadata :


encoder : Lavf59.27.100


Stream #0:0 : Video : mjpeg (Baseline) (mp4v / 0x7634706D), yuvj420p(pc, bt470bg/unknown/unknown), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 tbr, 10000k tbn


Stream mapping :


Stream #0:0 -> #0:0 (copy)


frame= 21 fps=7.2 q=-1.0 size= 252kB time=00:00:00.80 bitrate=2580.9kbits/s speed=0.275x


...


: Interrupting starter thread (task-1) because of exception : TCP negotiation failed




The code in the backend is this :


@GetMapping(value = "/{id}/video")
public ResponseEntity<streamingresponsebody> getVideo() {
 String url = "**********";

 return ResponseEntity.ok()
 .contentType(MediaType.APPLICATION_OCTET_STREAM)
 .body(os ->{
 FFmpeg.atPath()
 .addArgument("-re")
 .addArguments("-acodec", "pcm_s16le")
 // .addArguments("-rtsp_transport", "tcp")
 .addArguments("-i", url)
 .addArguments("-vcodec", "copy")
 .addArguments("-af", "asetrate=22050")
 .addArguments("-acodec", "aac")
 .addArguments("-b:a", "96k" )
 .addOutput(PipeOutput.pumpTo(os)
 .disableStream(StreamType.AUDIO)
 .disableStream(StreamType.SUBTITLE)
 .disableStream(StreamType.DATA)
 .setFrameCount(StreamType.VIDEO, 100L)
 //1 frame every 10 seconds
 .setFrameRate(0.1)
 .setDuration(1, TimeUnit.HOURS)
 .setFormat("ismv"))
 .addArgument("-nostdin")
 .execute();
 });
 }
</streamingresponsebody>


And this is the html part :


<video width="100%" height="auto" controls="controls" autoplay="autoplay" muted="muted" src="http://localhost:7500/***/1/video">
 Sorry, your browser doesn't support embedded videos.
 </video>



What is it missing for the TCP negotiation ?