Recherche avancée

Médias (0)

Mot : - Tags -/optimisation

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

Autres articles (60)

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

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

Sur d’autres sites (6061)

  • Script - split video file in equivalent segments

    4 octobre 2014, par Code_Ed_Student

    I am currently using ffmpeg to slice video files. I automated the process through a script called ffmpeg_split.sh. To view the full script click HERE.
    When I ran this script on a few .mp4 files I had, it would return nothing :

    __DURATION_HMS=$(ffmpeg -i "$__FILE" 2>&1 | grep Duration | \
       grep '\d\d:\d\d:\d\d.\d\d' -o)

    NOTE : This is line #54.

    So without this value, the calls that come after it to the function parse_duration_info() are returning the error message.

    According to the comments in the original script, there should be 2 arguments to parse_duration_info().

    # arg1: duration in format 01:23:45.67
    # arg2: offset for group 1 gives hours, 2 gives minutes,
    #       3 gives seconds, 4 gives milliseconds

    Here is the syntax to slice a video with script : ffmpeg_split.sh -s test_vid.mp4 -o video-part%03d.mp4 -c 00:00:08

    Belowe is where I parse the duration :

    function parse_duration_info() {
       if [[ $1 ]] && [[ $2 -gt 0 ]] && [[ $2 -lt 5 ]] ; then
           __OFFSET=$2
           __DURATION_PATTERN='\([0-9][0-9]\):\([0-9][0-9]\):\([0-9][0-9]\)\.\([0-9][0-9]\)'
           echo "$1" | sed "s/$__DURATION_PATTERN/\\$__OFFSET/"
       else
           echo "Bad input to parse_duration_info()"
           echo "Givven duration $1"
           echo "Givven offset $2"
           echo "Exiting..."
           exit 1
       fi
    }
  • What's the best way to get video metadata from a MP4 file in ASP.Net MVC using C# ?

    1er janvier 2017, par Maddhacker24

    I’ve been searching on Google and StackOverflow for a good couple of hours. There seems to be a lot of similar questions on StackOverflow but they are all about 3-5 years old.

    Is using FFMPEG still the best way these days to pull metadata from a video file in a .NET web application ? And if so, what’s the best C# wrapper out there ?

    I’ve tried MediaToolkit, MediaFile.dll without any luck. I saw ffmpeg-csharpe but that looks like it hasn’t been touched in a few years.

    I haven’t found any current data on this subject. Is the ability to pull metadata from a video built into the latest version of .NET now ?

    I’m basically looking for any direction at this point.

    I should add that whatever I use could be invoked thousands of times per hour so it will need to be efficient.

  • ffmpeg very big duration and very small fps with mpeg4 rtsp input

    16 septembre 2014, par Xuch

    I’m trying to dump video from network camera to HDD with ffmpeg libraries. It’s fine working with h264 rtsp input, but with mpeg4 rtsp I’ve got corrupted video file : its duration more than 3000 hours and invalid fps but in fact duration is 300 seconds.

    At start I doing (var ’Index’ contain index valid video stream from input rtsp) :

    ofmt = av_guess_format(NULL, FullPath().c_str(), NULL);
    Ofcx = avformat_alloc_context();
    Ofcx->oformat = ofmt;
    avio_open2(&Ofcx->pb, FullPath().c_str(), AVIO_FLAG_WRITE, NULL, NULL);
    Ost = avformat_new_stream(Ofcx, Ifcx->streams[Index]->codec->codec);
    avcodec_copy_context(Ost->codec, Ifcx->streams[Index]->codec);
    Ost->sample_aspect_ratio.num = Iccx->sample_aspect_ratio.num;
    Ost->sample_aspect_ratio.den = Iccx->sample_aspect_ratio.den;
    Ost->r_frame_rate = Ist->r_frame_rate;
    Ost->avg_frame_rate = Ist->avg_frame_rate;
    Ost->time_base = Ist->time_base;
    Ost->codec->time_base = Ost->time_base;
    avformat_write_header(Ofcx, NULL);
    Ost->codec->ticks_per_frame = Iccx->ticks_per_frame;
    Ost->codec->sample_aspect_ratio.num = Iccx->sample_aspect_ratio.num;

    And next srtart dumping cycle :

    int FfPipeline::DumpCycle()
    {
     AVPacket pkt;
     int index = GetVideoIndex();

     av_init_packet(&pkt);

     av_read_play(Ifcx);

     while((av_read_frame(Ifcx, &pkt) >= 0) && (!IsNeedStop()))
       {
         if (pkt.stream_index == index)    // Then packet is video
           {
             if ((IsWaitingKeyframe()) && !(pkt.flags & AV_PKT_FLAG_KEY))
               {
                 av_free_packet(&pkt);
                 continue;
               }

             if (IsWaitingKeyframe())
               {
                 ClearWaitingKeyframeFlag();

                 pkt.pts = pkt.dts = AV_NOPTS_VALUE;

                 SetStartTimestamp();
                 SetRecState(REC_WRITING);
               }

             pkt.stream_index = Ost->id;   // Need to be remove in next time??

             Ofcx->streams[index]->avg_frame_rate = Ifcx->streams[index]->avg_frame_rate;

             pkt.pts = av_rescale_q(pkt.pts, Ifcx->streams[index]->codec->time_base, Ofcx->streams[index]->time_base);
             pkt.dts = av_rescale_q(pkt.dts, Ifcx->streams[index]->codec->time_base, Ofcx->streams[index]->time_base);

             pkt.pts *= Ifcx->streams[index]->codec->ticks_per_frame;
             pkt.dts *= Ifcx->streams[index]->codec->ticks_per_frame;

             av_interleaved_write_frame(Ofcx, &pkt);
           }
         av_free_packet(&pkt);
         av_init_packet(&pkt);
       }

     // Now we stopping
     av_free_packet(&pkt);
     av_read_pause(Ifcx);

     av_write_trailer(Ofcx);

     avio_close(Ofcx->pb);

     avformat_close_input(&Ifcx);
     avformat_free_context(Ofcx);

     AddEndClipToDb();

     Ifcx = NULL;
     Ofcx = NULL;

     return 0;
    }
    • Input stream :
      ’rtsp ://192.168.0.15:554/axis-media/media.amp ?videocodec=mpeg4&fps=25&resolution=800x600&audio=0’
    • Output file : test_out.mkv

    I’m trying various output format but result was fully equal - very big duration and very small fps.

    Please tell me in what direction I need seek ?

    Thanks a big !

    P.S. dump_format() :

    Input #0, rtsp, from 'rtsp://192.168.0.11:554/mpeg4/media.amp?resolution=800x600&audio=0':
     Metadata:
       title           : Media Presentation
     Duration: N/A, start: 0.133344, bitrate: N/A
       Stream #0:0: Video: mpeg4 (Advanced Simple Profile), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 100 fps, 100 tbr, 90k tbn, 100 tbc
    Output #0, matroska, to '/me':
     Metadata:
       encoder         : Lavf53.32.100
       Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 100 fps, 100 tbr, 1k tbn, 90k tbc