Recherche avancée

Médias (0)

Mot : - Tags -/signalement

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

Autres articles (20)

  • 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

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

Sur d’autres sites (3252)

  • FFmpeg : chromakey without green edges

    5 septembre 2020, par Igniter

    I have a video of a person on green background and I'm trying to turn background transparent by this :

    


    ffmpeg -i bg.mp4 -i man.mp4 -filter_complex '[1:v]colorkey=0x00ff00:0.3:0.3[ckout];[0:v][ckout]overlay[out]' -map '[out]' result.mp4


    


    Colorkey gives this quite noticeable green edge around the person's figure.
    
Any attempts to increase opacity or blend parameters result in disappearing facial features.

    


    enter image description here

    


    Is there any smart way to change pure green 0x00ff00 pixels with transparent ones ?

    


  • avcodec/movtextenc : Simplify writing to AVBPrint

    15 octobre 2020, par Andreas Rheinhardt
    avcodec/movtextenc : Simplify writing to AVBPrint
    

    The mov_text encoder uses an AVBPrint to assemble the subtitles ;
    yet mov_text subtitles are not pure text ; they also have a binary
    portion that was mostly handled as follows :

    uint32_t size = /* calculation */ ;
    size = AV_RB32(&size) ;
    av_bprint_append_data(bprint, (const char*)&size, 4) ;

    Here AV_RB32() is a no-op on big-endian systems and a LE-BE swap
    on little-endian systems, making the output endian-independent.

    Yet this is ugly and unclean : On LE systems, the variable size from
    the snippet above won't contain the correct value any more. Furthermore,
    using this pattern leads to lots of small writes to the AVBPrint.

    This commit therefore changes this to using a temporary buffer instead :

    uint8_t buf[4] ;
    AV_WB32(buf, /* size calculation */) ;
    av_bprint_append_data(bprint, buf, 4) ;

    This method also allows to use bigger buffers holding more than one
    element, saving calls to av_bprint_append_data() and reducing codesize.

    Reviewed-by : Philip Langdale <philipl@overt.org>
    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@gmail.com>

    • [DH] libavcodec/movtextenc.c
  • What could be serve as a nullptr in cython wrapper for C++ uint8_t multidimensional array ?

    20 juillet 2020, par yose93

    I've stuck with solving of one problem. I have to fill C++ structure with yuv420p frame data in my cython wrapper :

    &#xA;

    #define FR_PLANE_COUNT_MAX 8&#xA;&#xA;typedef struct fr_frame_s {&#xA;    int format = 0;&#xA;&#xA;    int width = 0;&#xA;    int height = 0;&#xA;&#xA;    uint8_t* data[FR_PLANE_COUNT_MAX];&#xA;&#xA;    int     stride[FR_PLANE_COUNT_MAX];&#xA;&#xA;    int     size[FR_PLANE_COUNT_MAX];&#xA;&#xA;    long long time = 0;&#xA;&#xA;} fr_frame_t;&#xA;&#xA;&#xA;

    &#xA;

    Where data is just a multidimensional array with length of 8. In this array first three elements to be y, u and v byte multidimensional arrays, and the rest are just nullptr values. The next chunk of code which I need to implement on pure python just to fill the structure with according data of the above structure itself :

    &#xA;

    bool VideoCapture::ConvertFrame(const AVFrame *src, fr_frame_t &amp;dst)&#xA;{&#xA;    if(src != NULL)&#xA;    {&#xA;        for (size_t i = 0; i &lt; FR_PLANE_COUNT_MAX; &#x2B;&#x2B;i)&#xA;        {&#xA;            if (src->data[i] != nullptr)&#xA;            {&#xA;                const int line = src->linesize[i];&#xA;                const int size = i == 0 ? line * src->height : int(line * (src->height / 2.0));&#xA;                dst.data[i] = (uint8_t*)malloc(size);&#xA;                memcpy(dst.data[i], src->data[i], size);&#xA;&#xA;                //dst.data[i] = src->data[i];&#xA;                dst.size[i] = size;&#xA;                dst.stride[i] = src->linesize[i];&#xA;            }else{&#xA;                dst.data[i] = nullptr;&#xA;                dst.size[i] = 0;&#xA;                dst.stride[i] = 0;&#xA;            }&#xA;        }&#xA;&#xA;

    &#xA;

    Here all the values after y, u, v arrays must be just of nullptr as it seems. So, what I can use as nullptr to fill np.ndarray after y, u, v.

    &#xA;

    And my python code :

    &#xA;

    def _get_read_frames(&#xA;        self,&#xA;        video: pathlib.PosixPath,&#xA;    ) -> Generator[Tuple[Union[teyefr.MetadataImage, float]], None, None]:&#xA;        """Video frames reader."""&#xA;        self._cap = cv2.VideoCapture(str(video))&#xA;        self._total_frames = self._cap.get(cv2.CAP_PROP_FRAME_COUNT)&#xA;        self._fps = math.ceil(self._cap.get(cv2.CAP_PROP_FPS))&#xA;        self._duration = self._total_frames / self._fps&#xA;&#xA;        while(self._cap.isOpened()):&#xA;            _, frame = self._cap.read()&#xA;&#xA;            if frame is None:&#xA;                break&#xA;            &#xA;            yuv420_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2YUV)&#xA;&#xA;            self._process_yuv420_frame(yuv420_frame)&#xA;&#xA;        self._cap.release()&#xA;    &#xA;    def _process_yuv420_frame(self, yuv420_frame: np.ndarray) -> None:&#xA;        """To fill `self._fr_frames` list.&#xA;&#xA;        Splits already converted frame into 3-channels y, u, v&#xA;        and takes all required data to fill `FRFrame` and push it.&#xA;        """&#xA;        data = np.array([])&#xA;        stride = np.array([])&#xA;        size = np.array([])&#xA;        frame_data = {}.fromkeys(FRFrame.__dataclass_fields__.keys())&#xA;&#xA;        channels = (y, u, v) = cv2.split(yuv420_frame)&#xA;&#xA;        for i in range(FR_PLANE_COUNT_MAX):&#xA;            if i &lt; len(channels):&#xA;                np.concatenate(data, channels[i])&#xA;            else:&#xA;                np.concatenate(data, np.array([]))&#xA;            &#xA;        frame_data[&#x27;height&#x27;], frame_data[&#x27;width&#x27;], _ = yuv420_frame.shape&#xA;

    &#xA;

    Please advise.

    &#xA;