Recherche avancée

Médias (0)

Mot : - Tags -/navigation

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (66)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une 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 (...)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • Configuration spécifique pour PHP5

    4 février 2011, par

    PHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
    Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
    Modules spécifiques
    Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)

Sur d’autres sites (10918)

  • IllegalStateException while compressing video at "dequeueOutputBuffer()" [on hold]

    11 juillet 2017, par Mr Narendra

    I’ve also checked a few or more similar posted questions, but none of them was having any satisfying response.

    My requirement is to compress videos in approx. 1-2 minutes.
    The video size restriction in my app is 500 MB and the duration limit is 4 minutes.

    The commands, I have tried -

    -i /storage/sdcard0/Videos/Lat_test.mp4 -r 20 -vcodec mpeg4 -preset ultrafast -c:a copy -tune fastdecode -strict -2 -b:v 150k
    /storage/sdcard0/Videos/output.mp4

    -y -i /storage/sdcard0/Videos/test3.mp4 -crf 24 -vcodec mpeg4 -preset ultrafast -c:a copy -me_method zero -tune fastdecode -tune zerolatency
    -strict -2 -b:v 1000k -pix_fmt yuv420p /storage/sdcard0/Videos/output.mp4

    and a few more mentioned here

    1) https://github.com/Tourenathan-G5organisation/SiliCompressor (the one using MediaCodec, instead of FFMPEG).

    2) https://github.com/lalongooo/VideoCompressor

    When tried with Samsung Galaxy Grand GT-i9082, version 5.0.1 (rooted), it failed with the below error -

    > java.lang.IllegalStateException
    > at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
    > at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:1033)
    > at com.iceteck.silicompressorr.videocompression.MediaController.convertVideo(MediaController.java:491)
    > at com.iceteck.silicompressorr.SiliCompressor.compressVideo(SiliCompressor.java:300)
    > at com.iceteck.silicompressor.SelectPictureActivity$VideoCompressAsyncTask.doInBackground(SelectPictureActivity.java:379)
    > at com.iceteck.silicompressor.SelectPictureActivity$VideoCompressAsyncTask.doInBackground(SelectPictureActivity.java:358)
    > at android.os.AsyncTask$2.call(AsyncTask.java:288)
    > at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    > at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
    > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
    > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
    > at java.lang.Thread.run(Thread.java:818)

    Please suggest how to resolve this issue.

    Or please suggest any other better video compressing approach / sample / reference, if possible

    I have tried various samples of video compression using FFMPEG, as well as MediaCodec, but none of them are working well. A few are very very slow. and rest gets failed in a few devices.

  • Unable to retrieve video stream from RTSP URL inside Docker container

    6 février, par birdalugur

    I have a FastAPI application running inside a Docker container that is trying to stream video from an RTSP camera URL using OpenCV. The setup works fine locally, but when running inside Docker, the /video endpoint does not return a stream and times out. Below are the details of the issue.

    


    Docker Setup :

    


    Dockerfile :

    


    FROM python:3.10.12

RUN apt-get update && apt-get install -y \
    libgl1-mesa-glx \
    libglib2.0-0

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

CMD ["python", "app.py"]



    


      

    • Docker Compose :
    • 


    


    services:
  api:
    build: ./api
    ports:
      - "8000:8000"
    depends_on:
      - redis
      - mongo
    networks:
      - app_network
    volumes:
      - ./api:/app
    environment:
      - REDIS_HOST=redis
      - REDIS_PORT=6379
      - MONGO_URI=mongodb://mongo:27017/app_db

  frontend:
    build: ./frontend
    ports:
      - "3000:3000"
    depends_on:
      - api
    networks:
      - app_network
    volumes:
      - ./frontend:/app
      - /app/node_modules

redis:
    image: "redis:alpine"
    restart: always
    networks:
      - app_network
    volumes:
      - redis_data:/data

  mongo:
    image: "mongo:latest"
    restart: always
    networks:
      - app_network
    volumes:
      - mongo_data:/data/db

networks:
  app_network:
    driver: bridge

volumes:
  redis_data:
  mongo_data:



    


    Issue :

    


    When I try to access the /video endpoint, the following warnings appear :

    


    [ WARN:0@46.518] global cap_ffmpeg_impl.hpp:453 _opencv_ffmpeg_interrupt_callback Stream timeout triggered after 30037.268665 ms


    


    However, locally, the RTSP stream works fine using OpenCV with the same code.

    


    Additional Information :

    


      

    1. Network : The Docker container can successfully ping the camera IP (10.100.10.94).
    2. 


    3. Local Video : I can read frames from a local video file without issues.
    4. 


    5. RTSP Stream : I am able to access the RTSP stream directly using OpenCV locally, but not inside the Docker container.
    6. 


    


    Code :

    


    Here's the relevant part of the code in my api/app.py :

    


    import cv2
from fastapi import FastAPI
from fastapi.responses import StreamingResponse

RTSP_URL = "rtsp://deneme:155115@10.100.10.94:554/axis-media/media.amp?adjustablelivestream=1&fps=10"

def generate_frames():
    cap = cv2.VideoCapture(RTSP_URL)
    if not cap.isOpened():
        print("Failed to connect to RTSP stream.")
        return

    while True:
        success, frame = cap.read()
        if not success:
            print("Failed to capture frame.")
            break

        _, buffer = cv2.imencode(".jpg", frame)
        frame_bytes = buffer.tobytes()

        yield (
            b"--frame\r\n" b"Content-Type: image/jpeg\r\n\r\n" + frame_bytes + b"\r\n"
        )

    cap.release()

@app.get("/video")
async def video_feed():
    """Return MJPEG stream to the browser."""
    return StreamingResponse(
        generate_frames(), media_type="multipart/x-mixed-replace; boundary=frame"
    )


    


    Has anyone faced similar issues or have suggestions on how to resolve this ?

    



    

  • The ffmpeg output binary stream front-end uses WebSocket to accept and cannot be played [closed]

    17 novembre 2024, par KIMEOOK

    Server push nodejs

    


    Use ws service to pass to the front end

    


          ffmpegs = spawn('ffmpeg', [
        '-f', 'gdigrab',  // 这是 Windows 下用于捕获屏幕的输入格式
        '-framerate', '60',  // 捕获帧率
        '-i', 'desktop',  // 捕获桌面(即屏幕)
        '-c:v', 'vp8',  // 视频编码格式
        '-f', 'webm',  // 设置输出为 mpegts 流
        '-pix_fmt', 'yuv420p',
        'pipe:1',  // 输出到管道
      ]);


    


    enter image description here
enter image description here

    


    Front-end rendering

    


    
      let videoElement = document.getElementById('screenVideo');

      let mediaSource = new MediaSource();
      videoElement.src = URL.createObjectURL(mediaSource);

      mediaSource.addEventListener('sourceopen', () => {

        let sourceBuffer = mediaSource.addSourceBuffer('video/webm; codecs="vp8"'); 

        let ws = new WebSocket(`ws://${ip}:3000/?device=${encodeURIComponent(selectedDevice)}`);

        ws.onmessage = (event) => {
          const data = new Uint8Array(event.data);
          if (!sourceBuffer.updating) {
            try {
              sourceBuffer.appendBuffer(data);
              console.log('ok')
            } catch (error) {
              console.error('Error appending buffer:', error);
            }
          } else {
            console.log('SourceBuffer is busy');
          }
        };

        ws.onerror = (error) => {
          console.error('WebSocket error:', error);
        };

        ws.onclose = () => {
          console.log('WebSocket connection closed');
        };

        if (mediaSource.readyState === 'open') {
          videoElement.play().catch(err => {
            console.error('Error attempting to play the video:', err);
          });
        }
}


    


    The video keeps spinning in circles and cannot be played normally.

    


    enter image description here

    


    Unable to play normally. What's the problem ?