Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (33)

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

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang 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 (3684)

  • FFMPEG HTTP Stream error, failed : Connection refused

    17 juillet 2022, par Halo Gass

    I tried to stream a video frame from opencv to network using MPEG-Dash, HLS, or RTSP via FFMPEG, but everytime I tried everything, it always throw "Connection Error, Connection Refused" even streaming to 127.0.0.1.

    


    Here the code for testing :

    


    import subprocess
import cv2
rtmp_url = "rtmp://127.0.0.1:1935/stream/pupils_trace"

# webcamera is 0, also you can set a video file name instead, for example "/home/user/demo.mp4"
path = 0
cap = cv2.VideoCapture(path)

# gather video info to ffmpeg
fps = int(cap.get(cv2.CAP_PROP_FPS))
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))

# command and params for ffmpeg
command = ['ffmpeg',
           '-y',
           '-f', 'rawvideo',
           '-vcodec', 'rawvideo',
           '-pix_fmt', 'bgr24',
           '-s', "{}x{}".format(width, height),
           '-r', str(fps),
           '-i', '-',
           '-c:v', 'libx264',
           '-pix_fmt', 'yuv420p',
           '-preset', 'ultrafast',
           '-f', 'flv',
           rtmp_url]

# using subprocess and pipe to fetch frame data
p = subprocess.Popen(command, stdin=subprocess.PIPE)


while cap.isOpened():
    ret, frame = cap.read()
    if not ret:
        print("frame read failed")
        break

    # YOUR CODE FOR PROCESSING FRAME HERE

    # write to pipe
    p.stdin.write(frame.tobytes())


    


    and below is the log :

    


    ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers&#xA;  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)&#xA;  configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared&#xA;  libavutil      56. 31.100 / 56. 31.100&#xA;  libavcodec     58. 54.100 / 58. 54.100&#xA;  libavformat    58. 29.100 / 58. 29.100&#xA;  libavdevice    58.  8.100 / 58.  8.100&#xA;  libavfilter     7. 57.100 /  7. 57.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  5.100 /  5.  5.100&#xA;  libswresample   3.  5.100 /  3.  5.100&#xA;  libpostproc    55.  5.100 / 55.  5.100&#xA;Input #0, rawvideo, from &#x27;pipe:&#x27;:&#xA;  Duration: N/A, start: 0.000000, bitrate: 221184 kb/s&#xA;    Stream #0:0: Video: rawvideo (BGR[24] / 0x18524742), bgr24, 1280x720, 221184 kb/s, 10 tbr, 10 tbn, 10 tbc&#xA;[tcp @ 0x556bea198680] Connection to tcp://127.0.0.1:1935 failed: Connection refused&#xA;[rtmp @ 0x556bea1a2640] Cannot open connection tcp://127.0.0.1:1935&#xA;rtmp://127.0.0.1:1935/stream/pupils_trace: Connection refused&#xA;Traceback (most recent call last):&#xA;  File "testing.py", line 42, in <module>&#xA;    p.stdin.write(frame.tobytes())&#xA;</module>

    &#xA;

    Here what I tried (All of it always "Connection Refused")

    &#xA;

      &#xA;
    1. Running the code directly
    2. &#xA;

    3. Running the code using sudo
    4. &#xA;

    5. Run with 'sudo su'
    6. &#xA;

    7. Allow the port used in ufw
    8. &#xA;

    9. Disable ufw
    10. &#xA;

    11. I tried executing command directly in terminal, also throws "connection refused"
    12. &#xA;

    13. using 127.0.0.1 or "localhost" or 0.0.0.0 or my local IP, everything throws connection error
    14. &#xA;

    15. Tried UDP and TCP
    16. &#xA;

    &#xA;

    Anyone can help me ?&#xA;Thanks

    &#xA;

  • FFMPEG missing audio when remuxing AVI to MP4

    24 juillet 2022, par Joba

    I want to convert from .avi to .mp4 without any quality impact.

    &#xA;

    When I use ffmpeg cli to remux the file the output file is missing the audio.

    &#xA;

    &#xA;

    ffmpeg -i input.mpg.avi -c copy output.mp4

    &#xA;

    &#xA;

    ➜  Desktop ffmpeg -i input.mpg.avi -c copy output.mp4&#xA;ffmpeg version 5.0.1 Copyright (c) 2000-2022 the FFmpeg developers&#xA;  built with Apple clang version 13.1.6 (clang-1316.0.21.2.5)&#xA;  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/5.0.1_3 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-neon&#xA;  libavutil      57. 17.100 / 57. 17.100&#xA;  libavcodec     59. 18.100 / 59. 18.100&#xA;  libavformat    59. 16.100 / 59. 16.100&#xA;  libavdevice    59.  4.100 / 59.  4.100&#xA;  libavfilter     8. 24.100 /  8. 24.100&#xA;  libswscale      6.  4.100 /  6.  4.100&#xA;  libswresample   4.  3.100 /  4.  3.100&#xA;  libpostproc    56.  3.100 / 56.  3.100&#xA;Input #0, avi, from &#x27;input.mpg.avi&#x27;:&#xA;  Metadata:&#xA;    software        : transcode-1.0.6&#xA;  Duration: 01:45:46.56, start: 0.000000, bitrate: 2055 kb/s&#xA;  Stream #0:0: Video: mpeg4 (Simple Profile) (DX50 / 0x30355844), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 1915 kb/s, 25 fps, 25 tbr, 25 tbn&#xA;  Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, fltp, 128 kb/s&#xA;Output #0, mp4, to &#x27;output.mp4&#x27;:&#xA;  Metadata:&#xA;    software        : transcode-1.0.6&#xA;    encoder         : Lavf59.16.100&#xA;  Stream #0:0: Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=2-31, 1915 kb/s, 25 fps, 25 tbr, 12800 tbn&#xA;  Stream #0:1: Audio: mp3 (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (copy)&#xA;  Stream #0:1 -> #0:1 (copy)&#xA;Press [q] to stop, [?] for help&#xA;frame=158664 fps=142852 q=-1.0 Lsize= 1587337kB time=01:45:46.55 bitrate=2048.9kbits/s speed=5.71e&#x2B;03x    &#xA;video:1483615kB audio:99165kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.287948%&#xA;

    &#xA;

  • Minimal sample of muxing two streams with no reencoding (av_interleaved_write_frame fails)

    19 juillet 2022, par Alvein

    What I'm trying to do : having two files, one is video-only and the other is audio-only, with identical durations, I want to "join" them in a single container.

    &#xA;

    I previously made a routine which just copied all the streams inside a container to another one. No reencoding, etc. This works perfectly :

    &#xA;

    while(true) {&#xA;    pkIn=av_packet_alloc();&#xA;    if(NULL==pkIn) {&#xA;        fprintf(stderr,"av_packet_alloc() failed");&#xA;        break;&#xA;    }&#xA;    iError=av_read_frame(fcIn,pkIn);&#xA;    if(0>iError)&#xA;        if(AVERROR_EOF==iError)&#xA;            break;&#xA;        else {&#xA;            fprintf(stderr,"av_read_frame() failed");&#xA;            break;&#xA;        }&#xA;    stIn=fcIn->streams[pkIn->stream_index];&#xA;    stOut=fcOut->streams[pkIn->stream_index];&#xA;    log_packet(fcIn,pkIn,"in");&#xA;    av_packet_rescale_ts(pkIn,stIn->time_base,stOut->time_base);&#xA;    pkIn->pos=-1;&#xA;    log_packet(fcOut,pkIn,"out");&#xA;    iError=av_interleaved_write_frame(fcOut,pkIn);&#xA;    if(0>iError) {&#xA;        fprintf(stderr,"av_interleaved_write_frame() failed");&#xA;        break;&#xA;    }&#xA;    av_packet_free(&amp;pkIn);&#xA;}&#xA;

    &#xA;

    I just did the analogy and tried to do the same, but taking each stream from a distinct container, like this :

    &#xA;

    while(true) {&#xA;    if(!bVideoInEOF) {&#xA;        pkVideoIn=av_packet_alloc();&#xA;        if(NULL==pkVideoIn) {&#xA;            fprintf(stderr,"av_packet_alloc(video in) failed");&#xA;            break;&#xA;        }&#xA;        iError=av_read_frame(fcVideoIn,pkVideoIn);&#xA;        if(0>iError)&#xA;            if(AVERROR_EOF==iError)&#xA;                bVideoInEOF=true;&#xA;            else {&#xA;                fprintf(stderr,"av_read_frame(video in) failed");&#xA;                break;&#xA;            }&#xA;        if(!bVideoInEOF) {&#xA;            log_packet(fcVideoIn,pkVideoIn,"video in");&#xA;            av_packet_rescale_ts(pkVideoIn,stVideoIn->time_base,stVideoOut->time_base);&#xA;            pkVideoIn->pos=-1;&#xA;            pkVideoIn->stream_index=stVideoOut->index; // Edit (2022-07-19)&#xA;            log_packet(fcVideoIn,pkVideoIn,"video out");&#xA;            iError=av_interleaved_write_frame(fcOut,pkVideoIn);&#xA;            if(0>iError) {&#xA;                fprintf(stderr,"av_interleaved_write_frame(video out) failed");&#xA;                break;&#xA;            }&#xA;        }&#xA;        av_packet_free(&amp;pkVideoIn);&#xA;    }&#xA;    if(!bAudioInEOF) {&#xA;        pkAudioIn=av_packet_alloc();&#xA;        if(NULL==pkAudioIn) {&#xA;            fprintf(stderr,"av_packet_alloc(audio in) failed");&#xA;            break;&#xA;        }&#xA;        iError=av_read_frame(fcAudioIn,pkAudioIn);&#xA;        if(0>iError)&#xA;            if(AVERROR_EOF==iError)&#xA;                bAudioInEOF=true;&#xA;            else {&#xA;                fprintf(stderr,"av_read_frame(audio in) failed");&#xA;                break;&#xA;            }&#xA;        if(!bAudioInEOF) {&#xA;            log_packet(fcAudioIn,pkAudioIn,"audio in");&#xA;            av_packet_rescale_ts(pkAudioIn,stAudioIn->time_base,stAudioOut->time_base);&#xA;            pkAudioIn->pos=-1;&#xA;            pkAudioIn->stream_index=stAudioOut->index; // Edit (2022-07-19)&#xA;            log_packet(fcAudioIn,pkAudioIn,"audio out");&#xA;            iError=av_interleaved_write_frame(fcOut,pkAudioIn);&#xA;            if(0>iError) {&#xA;                fprintf(stderr,"av_interleaved_write_frame(audio out) failed");&#xA;                break;&#xA;            }&#xA;        }&#xA;        av_packet_free(&amp;pkAudioIn);&#xA;    }&#xA;    if(bVideoInEOF&amp;&amp;bAudioInEOF)&#xA;        break;&#xA;}&#xA;

    &#xA;

    I know the previous code looks like redundant but I wanted to leave both streams "processing" separated the way you understand my plans.

    &#xA;

    Anyway, that code ends quickly with "av_interleaved_write_frame(audio out) failed".

    &#xA;

    The error detail is "Invalid argument", and the debugger shows this :

    &#xA;

    &#xA;

    Application provided invalid, non monotonically increasing dts to&#xA;muxer in stream 0.

    &#xA;

    &#xA;

    If I disable any of the main blocks "if(!bVideoInEOF)" / "if(!bAudioInEOF)", the file is written successfully, with the obvious lack of the disabled stream.

    &#xA;

    I'm new into using this library so probably I'm doing something really stupid, or missing something obvious.

    &#xA;

    Suggestions ?

    &#xA;

    Edit (2022-07-19) :

    &#xA;

    By checking the logs, I noticed I was writing every frame to the stream #0. Hence, the horrible jumps in PTS/DTS.

    &#xA;

    Code edited by adding the corresponding "...->stream_index=" before each call to av_interleaved_write_frame().

    &#xA;

    ...

    &#xA;

    Though it works, I still think my code is far from perfect. Comments are welcome.

    &#xA;