Recherche avancée

Médias (1)

Mot : - Tags -/ogv

Autres articles (50)

  • 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

  • Pas question de marché, de cloud etc...

    10 avril 2011

    Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
    sur le web 2.0 et dans les entreprises qui en vivent.
    Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
    Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
    le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
    Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

Sur d’autres sites (6210)

  • FFMPEG Custom Read function reads all the data

    15 juillet 2014, par Hafedh Haouala

    I’m trying to implement a custom read function for ffmpeg that will retrieve a buffer from local video ( from device in the future) and then deocde this buffer, etc..

    So, here’s my read function

    int IORead(void *opaque, uint8_t *buf, int buf_size)
    {
    FileReader* datrec = (FileReader*)opaque;
    int ret = datrec->Read(buf, buf_size);
    return ret;
    }

    As for the FileReader :

    class FileReader {
    protected:
     int fd;
    public:
     FileReader(const char *filename){ //, int buf_size){
         fd = open(filename, O_RDONLY);
         };

    ~FileReader() {
          close(fd);
        };

    int Read(uint8_t *buf, int buf_size){
      int len = read(fd, buf, buf_size);
      return len;
         };
    };

    and for the my execution :

    FileReader *receiver = new FileReader("/sdcard/clip.ts");

    AVFormatContext *avFormatContextPtr = NULL;
    this->iobuffer = (unsigned char*) av_malloc(4096 + FF_INPUT_BUFFER_PADDING_SIZE);
    avFormatContextPtr = avformat_alloc_context();
    avFormatContextPtr->pb = avio_alloc_context(this->iobuffer, 4096, 0, receiver, IORead, NULL, NULL);
    avFormatContextPtr->pb->seekable    = 0;

    int err = avformat_open_input(&avFormatContextPtr, "", NULL, NULL) ;
    if( err != 0)
    {...}
    // Decoding process
     {...}

    However, once the avformat_open_input() is called, the read function IORead is called and keeps reading the file clip.ts until it reaches its end and only then it exit and the decoding process is reached with no data to decode ( as all of it was consumed)

    I don’t know what is the problem especially that this code

    AVFormatContext *avFormatContextPtr = NULL;
    int err = avformat_open_input(&avFormatContextPtr, "/sdcard/clip.ts", NULL, NULL) ;

    isn’t blocking untill the end of the file is reached.

    Am I missing something ?
    I appreciate your help.

  • Video decoder on Cuda ffmpeg

    25 avril 2013, par Oleksandr Kyrpa

    I starting to implement custum video decoder that utilize cuda HW decoder to generate YUV frame for next to encode it.

    How can I fill "CUVIDPICPARAMS" struc ???
    Is it possible ?

    My algorithm are :

    For get video stream packet I'm use ffmpeg-dev libs avcodec, avformat...

    My steps :

    1) Open input file :

    avformat_open_input(&ff_formatContext,in_filename,nullptr,nullptr);

    2) Get video stream property's :

    avformat_find_stream_info(ff_formatContext,nullptr);

    3) Get video stream :

    ff_video_stream=ff_formatContext->streams[i];

    4) Get CUDA device and init it :

    cuDeviceGet(&cu_device,0);
    CUcontext cu_vid_ctx;

    5) Init video CUDA decoder and set create params :

    CUVIDDECODECREATEINFO *cu_decoder_info=new CUVIDDECODECREATEINFO;
    memset(cu_decoder_info,0,sizeof(CUVIDDECODECREATEINFO));
    ...
    cuvidCreateDecoder(cu_video_decoder,cu_decoder_info);

    6)Read frame data to AVpacket

    av_read_frame(ff_formatContext,ff_packet);

    AND NOW I NEED decode frame packet on CUDA video decoder, in theoretical are :

    cuvidDecodePicture(pDecoder,&picParams);

    BUT before I need fill CUVIDPICPARAMS

    CUVIDPICPARAMS picParams ;//=new CUVIDPICPARAMS ;
    memset(&picParams, 0, sizeof(CUVIDPICPARAMS)) ;

    HOW CAN I FILL "CUVIDPICPARAMS" struc ???

    typedef struct _CUVIDPICPARAMS
    {
       int PicWidthInMbs;      // Coded Frame Size
       int FrameHeightInMbs;   // Coded Frame Height
       int CurrPicIdx;         // Output index of the current picture
       int field_pic_flag;     // 0=frame picture, 1=field picture
       int bottom_field_flag;  // 0=top field, 1=bottom field (ignored if field_pic_flag=0)
       int second_field;       // Second field of a complementary field pair
       // Bitstream data
       unsigned int nBitstreamDataLen;        // Number of bytes in bitstream data buffer
       const unsigned char *pBitstreamData;   // Ptr to bitstream data for this picture (slice-layer)
       unsigned int nNumSlices;               // Number of slices in this picture
       const unsigned int *pSliceDataOffsets; // nNumSlices entries, contains offset of each slice within the bitstream data buffer
       int ref_pic_flag;       // This picture is a reference picture
       int intra_pic_flag;     // This picture is entirely intra coded
       unsigned int Reserved[30];             // Reserved for future use
       // Codec-specific data
       union {
           CUVIDMPEG2PICPARAMS mpeg2;          // Also used for MPEG-1
           CUVIDH264PICPARAMS h264;
           CUVIDVC1PICPARAMS vc1;
           CUVIDMPEG4PICPARAMS mpeg4;
           CUVIDJPEGPICPARAMS jpeg;
           unsigned int CodecReserved[1024];
       } CodecSpecific;
    } CUVIDPICPARAMS;

    typedef struct _CUVIDH264PICPARAMS
    {
       // SPS
       int log2_max_frame_num_minus4;
       int pic_order_cnt_type;
       int log2_max_pic_order_cnt_lsb_minus4;
       int delta_pic_order_always_zero_flag;
       int frame_mbs_only_flag;
       int direct_8x8_inference_flag;
       int num_ref_frames;             // NOTE: shall meet level 4.1 restrictions
       unsigned char residual_colour_transform_flag;
       unsigned char bit_depth_luma_minus8;    // Must be 0 (only 8-bit supported)
       unsigned char bit_depth_chroma_minus8;  // Must be 0 (only 8-bit supported)
       unsigned char qpprime_y_zero_transform_bypass_flag;
       // PPS
       int entropy_coding_mode_flag;
       int pic_order_present_flag;
       int num_ref_idx_l0_active_minus1;
       int num_ref_idx_l1_active_minus1;
       int weighted_pred_flag;
       int weighted_bipred_idc;
       int pic_init_qp_minus26;
       int deblocking_filter_control_present_flag;
       int redundant_pic_cnt_present_flag;
       int transform_8x8_mode_flag;
       int MbaffFrameFlag;
       int constrained_intra_pred_flag;
       int chroma_qp_index_offset;
       int second_chroma_qp_index_offset;
       int ref_pic_flag;
       int frame_num;
       int CurrFieldOrderCnt[2];
       // DPB
       CUVIDH264DPBENTRY dpb[16];          // List of reference frames within the DPB
       // Quantization Matrices (raster-order)
       unsigned char WeightScale4x4[6][16];
       unsigned char WeightScale8x8[2][64];
       // FMO/ASO
       unsigned char fmo_aso_enable;
       unsigned char num_slice_groups_minus1;
       unsigned char slice_group_map_type;
       signed char pic_init_qs_minus26;
       unsigned int slice_group_change_rate_minus1;
       union
       {
           unsigned long long slice_group_map_addr;
           const unsigned char *pMb2SliceGroupMap;
       } fmo;
       unsigned int  Reserved[12];
       // SVC/MVC
       union
       {
           CUVIDH264MVCEXT mvcext;
           CUVIDH264SVCEXT svcext;
       };
    } CUVIDH264PICPARAMS;
  • tests/fate.sh : report different status for different errors

    10 juin 2014, par Timothy Gu
    tests/fate.sh : report different status for different errors
    

    The order of error codes will be useful in my future fateserver patches.

    Signed-off-by : Timothy Gu <timothygu99@gmail.com>
    Signed-off-by : Michael Niedermayer <michaelni@gmx.at>

    • [DH] tests/fate.sh