
Recherche avancée
Médias (91)
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#2 Typewriter Dance
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#1 The Wires
11 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
ED-ME-5 1-DVD
11 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (109)
-
Organiser par catégorie
17 mai 2013, parDans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...) -
Récupération d’informations sur le site maître à l’installation d’une instance
26 novembre 2010, parUtilité
Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;
Sur d’autres sites (11577)
-
vulkan : parse instance list and add the DEBUG_UTILS extension
3 octobre 2024, par Lynne -
hwcontext_vulkan : don't enable deprecated VK_KHR_sampler_ycbcr_conversion extension
14 août 2024, par Lynne -
why am i getting this error when using FFmpeg in a spring boot app on a mac intel device : SIGSEGV (0xb) at pc=0x000000013d71b0e0, pid=49777, tid=42755
19 juillet 2024, par Godwill ChristopherI am working with FFmpeg library in spring boot app to stream live recording from an ip camera via RSTP and save to S3 bucket but i am running into the error below.


A fatal error has been detected by the Java Runtime Environment :


SIGSEGV (0xb) at pc=0x000000013d71b0e0, pid=49777, tid=42755


JRE version : OpenJDK Runtime Environment Corretto-19.0.2.7.1 (19.0.2+7) (build 19.0.2+7-FR)
Java VM : OpenJDK 64-Bit Server VM Corretto-19.0.2.7.1 (19.0.2+7-FR, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
Problematic frame :
C [libavutil.56.dylib+0xa0e0] av_strstart+0x10


No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
An error report file with more information is saved as :
/Users/CODA/Desktop/videoSaleService/hs_err_pid49777.log


If you would like to submit a bug report, please visit :
https://github.com/corretto/corretto-19/issues/
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.


Process finished with exit code 134 (interrupted by signal 6:SIGABRT)


public static void main(String[] args) {
 OkHttpClient client = new OkHttpClient();
 try (S3Client s3Client = S3Client.create()) {
 VideoService videoService = new VideoService(new VideoRepositoryImpl(),
 new S3Service(s3Client), new VideoExtractor(client), new ISApiClient());
 videoService.streamLiveVideoRSTP(System.out);
 } catch (IOException e) {
 log.error("Error occurred while streaming live video: {}", e.getMessage(), e);
 } catch (Exception e) {
 log.error("Unexpected error occurred: {}", e.getMessage(), e);
 }
}

public void streamLiveVideoRSTP(OutputStream outputStream) throws IOException {
 File tempFile = File.createTempFile("live_stream", ".mp4");

 try (InputStream inputStream = client.getLiveStreamingVideoRSTP();
 OutputStream fileOutputStream = new FileOutputStream(tempFile)) {
 byte[] buffer = new byte[4096];
 int bytesRead;
 while ((bytesRead = inputStream.read(buffer)) != -1) {
 outputStream.write(buffer, 0, bytesRead);
 fileOutputStream.write(buffer, 0, bytesRead);
 }
 } catch (Exception e) {
 log.error("Error occurred while streaming live video: {}", e.getMessage(), e);
 throw new IOException("Error occurred while streaming live video", e);
 }

 // Upload the captured video file to S3
 try {
 uploadStreamedVideoToS3(tempFile);
 } finally {
 if (tempFile.exists()) {
 if (!tempFile.delete()) {
 log.warn("Failed to delete temporary file: {}", tempFile.getAbsolutePath());
 }
 }
 }
}

private final BlockingQueue frameQueue = new ArrayBlockingQueue<>(10);

public ISApiClient() {
 new Thread(this::startGrabbingFrames).start();
}

public InputStream getLiveStreamingVideoRSTP() {
 return new InputStream() {
 private ByteArrayInputStream currentStream;

 @Override
 public int read() {
 if (currentStream == null || currentStream.available() == 0) {
 byte[] frame = frameQueue.poll();
 if (frame != null) {
 currentStream = new ByteArrayInputStream(frame);
 } else {
 return -1;
 }
 }
 return currentStream.read();
 }
 };
}

private void startGrabbingFrames() {
 try (FFmpegFrameGrabber frameGrabber = new FFmpegFrameGrabber(rtspUrl)) {
 frameGrabber.setOption("rtsp_transport", "tcp");
 frameGrabber.start();

 FFmpegFrameFilter frameFilter = new FFmpegFrameFilter("format=yuv420p",
 frameGrabber.getImageWidth(), frameGrabber.getImageHeight());
 frameFilter.setPixelFormat(frameGrabber.getPixelFormat());
 frameFilter.start();

 log.info("Started grabbing frames from RTSP stream.");

 while (true) {
 Frame frame = frameGrabber.grab();
 if (frame != null && frame.image != null) {
 log.info("Frame grabbed: width={} height={} timestamp={}",
 frame.imageWidth, frame.imageHeight, frame.timestamp);
 frameFilter.push(frame);
 Frame filteredFrame = frameFilter.pull();

 if (filteredFrame != null && filteredFrame.image != null) {
 log.info("Frame filtered: width={} height={} timestamp={}",
 filteredFrame.imageWidth, filteredFrame.imageHeight, filteredFrame.timestamp);
 byte[] imageBytes = convertFrameToBytes(filteredFrame);
 if (imageBytes.length > 0) {
 frameQueue.offer(imageBytes);
 log.info("Frame added to queue, queue size={}", frameQueue.size());
 }
 }
 }
 }
 } catch (IOException e) {
 log.error("Error grabbing frames: {}", e.getMessage(), e);
 }
}

private byte[] convertFrameToBytes(Frame frame) {
 if (frame == null || frame.image == null) {
 return new byte[0];
 }

 ByteBuffer byteBuffer = null;
 for (Object img : frame.image) {
 if (img instanceof ByteBuffer) {
 byteBuffer = (ByteBuffer) img;
 break;
 }
 }

 if (byteBuffer == null) {
 return new byte[0];
 }

 byte[] bytes = new byte[byteBuffer.remaining()];
 byteBuffer.get(bytes);
 return bytes;
}