Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (51)

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

  • Changer son thème graphique

    22 février 2011, par

    Le thème graphique ne touche pas à la disposition à proprement dite des éléments dans la page. Il ne fait que modifier l’apparence des éléments.
    Le placement peut être modifié effectivement, mais cette modification n’est que visuelle et non pas au niveau de la représentation sémantique de la page.
    Modifier le thème graphique utilisé
    Pour modifier le thème graphique utilisé, il est nécessaire que le plugin zen-garden soit activé sur le site.
    Il suffit ensuite de se rendre dans l’espace de configuration du (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (9902)

  • FFMPEG - local video to UDP streaming to OpenCV - video quality degraded

    6 juin 2021, par user3925023

    my goal is to re-stream local video content / desktop screencasting, to an UDP flow that I need to process on a Python script.

    



    Here is the FFMPEG script that I'm using :

    



    ffmpeg -re -i C:\Users\test\Downloads\out.ts -strict -2 -c:v copy -an -preset slower -tune stillimage -b 11200k -f rawvideo udp://127.0.0.1:5000


    



    And here is the simple Python script supposed to read the stream flow :

    



    import cv2

cap = cv2.VideoCapture('udp://127.0.0.1:5000',cv2.CAP_FFMPEG)
if not cap.isOpened():
    print('VideoCapture not opened')
    exit(-1)
width = cap.get(cv2.CAP_PROP_FRAME_WIDTH)  # float
height = cap.get(cv2.CAP_PROP_FRAME_HEIGHT)  # float
print(str(width))
print(str(height))
while True:
    ret, frame = cap.read()
    imgray = frame[int(round((height/100)*70,0)):int(round((width/100)*42,0)), int(round((height/100)*74,0)):int(round((width/100)*54,0))]
    if not ret:
        print('frame empty')
        break
    cv2.imshow('image', imgray)
    if cv2.waitKey(1)&0XFF == ord('q'):
        break
cap.release()


    



    I'm able to visualize portion of the stream video as expect, but I'm facing lot of issue in video quality degradation, specially video artifact probably due missing packet processing :

    



    enter image description here

    



    Also these are error log I'm geting from script :

    



    [h264 @ 0000026eb272f280] error while decoding MB 105 66, bytestream -21
[h264 @ 0000026eb2fcb740] error while decoding MB 100 53, bytestream -11
[h264 @ 0000026eb272f280] error while decoding MB 32 22, bytestream -11
[h264 @ 0000026ead9ee300] error while decoding MB 60 20, bytestream -25
[h264 @ 0000026eb27f00c0] error while decoding MB 9 62, bytestream -5
[h264 @ 0000026ead9ee780] error while decoding MB 85 44, bytestream -5
[h264 @ 0000026eb27f0800] error while decoding MB 64 25, bytestream -15
[h264 @ 0000026eb272f280] error while decoding MB 112 23, bytestream -17
[h264 @ 0000026eb2735200] error while decoding MB 30 21, bytestream -7


    



    Actually I don't care about video fluidity,I can also reduce the FPS, important thing is the video quality. Not sure if I'm doing wrong on the scripting python part or if I'm using wrong FFMPEG command.

    



    Many Thanks

    


  • swresample : Add AVFrame based API

    11 août 2014, par Michael Niedermayer
    swresample : Add AVFrame based API
    

    Based on commit fb1ddcdc8f51b9d261ae8e9c26b91e81f7b6bf45 by Luca Barbato <lu_zero@gentoo.org>
    Adapted for libswresample by Michael Niedermayer
    Signed-off-by : Michael Niedermayer <michaelni@gmx.at>

    • [DH] doc/APIchanges
    • [DH] libswresample/Makefile
    • [DH] libswresample/swresample.h
    • [DH] libswresample/swresample_frame.c
    • [DH] libswresample/version.h
  • Encoding audio_common messages to OPUS

    14 juin 2023, par djangbahevans

    &#xA;

    I am trying to stream microphone and camera data to Amazon KVS WebRTC. I'm able to make video work using this package (adapted for noetic) however I am struggling to make audio work. I'm using the audio_capture package to get mp3 frames. I'm trying to convert this to OPUS frames before streaming to KVS, but I'm unsure how to do this. I wrote this bit of code based on the small resources I can find on using ffmpeg, but it's not working. avcodec_fill_audio_frame is returning -22.

    &#xA;

    #include "opus_encoder.h"&#xA;&#xA;OPUSEncoder::OPUSEncoder() {&#xA;  av_register_all();&#xA;  codecContext == nullptr;&#xA;}&#xA;&#xA;OPUSEncoder::~OPUSEncoder() {&#xA;  if (codecContext != nullptr) {&#xA;    avcodec_free_context(&amp;codecContext);&#xA;  }&#xA;}&#xA;&#xA;int OPUSEncoder::Initialize(int Fs, int channels) {&#xA;  AVCodec *codec = avcodec_find_encoder(AV_CODEC_ID_OPUS);&#xA;  if (!codec) {&#xA;    printf("Codec not found\n");&#xA;    return -1;&#xA;  }&#xA;&#xA;  codecContext = avcodec_alloc_context3(codec);&#xA;  if (!codecContext) {&#xA;    printf("Could not allocate audio codec context\n");&#xA;    return -1;&#xA;  }&#xA;&#xA;  codecContext->sample_fmt = AV_SAMPLE_FMT_S16;&#xA;  codecContext->bit_rate = 128000;&#xA;  codecContext->sample_rate = Fs;&#xA;  codecContext->channel_layout = av_get_default_channel_layout(channels);&#xA;  codecContext->channels = channels;&#xA;&#xA;  if (avcodec_open2(codecContext, codec, nullptr) &lt; 0) {&#xA;    printf("Could not open codec\n");&#xA;    return -1;&#xA;  }&#xA;&#xA;  return 0;&#xA;}&#xA;&#xA;int OPUSEncoder::Encode(const uint8_t *audio_data, int frameSize,&#xA;                        uint8_t *out) {&#xA;  AVPacket pkt;&#xA;  av_init_packet(&amp;pkt);&#xA;  pkt.data = nullptr;&#xA;  pkt.size = 0;&#xA;&#xA;  AVFrame *frame = av_frame_alloc();&#xA;  frame->nb_samples = frameSize;&#xA;  frame->format = codecContext->sample_fmt;&#xA;  frame->channel_layout = codecContext->channel_layout;&#xA;&#xA;  int ret = avcodec_fill_audio_frame(frame, codecContext->channels,&#xA;                                     codecContext->sample_fmt, audio_data,&#xA;                                     frameSize * 2, 0);&#xA;  if (ret &lt; 0) {&#xA;    printf("Error filling audio frame: %d\n", ret);&#xA;    return -1;&#xA;  }&#xA;&#xA;  ret = avcodec_send_frame(codecContext, frame);&#xA;  if (ret &lt; 0) {&#xA;    printf("Error sending the frame to the encoder\n");&#xA;    return -1;&#xA;  }&#xA;&#xA;  while (ret >= 0) {&#xA;    ret = avcodec_receive_packet(codecContext, &amp;pkt);&#xA;    if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {&#xA;      return 0;&#xA;    } else if (ret &lt; 0) {&#xA;      printf("Error encoding audio frame\n");&#xA;      return -1;&#xA;    }&#xA;&#xA;    memcpy(out, pkt.data, pkt.size);&#xA;    out &#x2B;= pkt.size;&#xA;    av_packet_unref(&amp;pkt);&#xA;  }&#xA;&#xA;  av_frame_free(&amp;frame);&#xA;&#xA;  return 0;&#xA;}&#xA;

    &#xA;