Recherche avancée

Médias (1)

Mot : - Tags -/ticket

Autres articles (8)

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

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

  • Other interesting software

    13 avril 2011, par

    We don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
    The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
    We don’t know them, we didn’t try them, but you can take a peek.
    Videopress
    Website : http://videopress.com/
    License : GNU/GPL v2
    Source code : (...)

Sur d’autres sites (2841)

  • ffmpeg dash Segment offset

    18 mars 2019, par inkubux

    I’m trying to integrate live-transcoding like "plex" or "emby" with my application.

    I am able to serve dash content over to shaka-player or dash.js but only in ’live-mode’. But I want to enable seeking through the player.

    I looked at plex and to enable this they create their own mpd file with duration so the player will have a full seekbar.

    However when seeking the player will ask for a segment number eg : 449. I need to stop ffmpeg and restart with an offset (-ss &lt;<segment>>)</segment>, but ffmpeg will just restart a transcode session from segment 0 with an initial segment.

    What I want is to tell ffmpeg to start at a seekpoint but only output from segment number and now-on.

    When playing with hls and mpegts, I can tell ffmpeg to output at a certain segment : with the option -segment_start_number but this is not available for dash. And plex use their own transcoder based of ffmpeg with the option -skip_to_segment

    I tried to ’hack’ around by keeping a manual offset on my web-server, even if I serve the "supposed" right segment after the seek point dash.js and shaka-player can’t recover the stream.. VLC on the other habd is able to (probably more tolerent) to errors in segments.

    Is the supposed right segment after a seek in dash (contains the initial segment) or only the segment.

    Is ffmpeg able to start segmenting dash as a supposed segment (for seek and resume)

    The same technique works in hls with forced key frames and a custom m3u8 (with all the "predicted" segments) but calculating the right segment length and the right bandwidth is much harder and hackish and dash is more tolerant to variation.

    I would really like to be able to seek through my live transcoding video.

    For reference here is a custom mpd file I serve to enable "seeking" :

    <mpd xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" suggestedpresentationdelay="PT1S" mediapresentationduration="PT49M2.920S" maxsegmentduration="PT2S" minbuffertime="PT10S">
       <period start="PT0S" duration="PT49M2.920S">
           <adaptationset segmentalignment="true">
               <segmenttemplate timescale="1" duration="1" initialization="$RepresentationID$/initial.mp4" media="$RepresentationID$/$Number$.m4s" startnumber="1">
               </segmenttemplate>
               <representation mimetype="video/mp4" codecs="avc1.640029" bandwidth="3766000" width="1920" height="1080">
               </representation>
           </adaptationset>
           <adaptationset segmentalignment="true">
               <segmenttemplate timescale="1" duration="1" initialization="$RepresentationID$/initial.mp4" media="$RepresentationID$/$Number$.m4s" startnumber="1">
               </segmenttemplate>
               <representation mimetype="audio/mp4" codecs="mp4a.40.2" bandwidth="188000" audiosamplingrate="48000">
                   <audiochannelconfiguration schemeiduri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="6"></audiochannelconfiguration>
               </representation>
           </adaptationset>
       </period>
    </mpd>

    And here is the ffmpeg command to pull it off :

    ffmpeg -ss 0 -i movie.mkv -y -acodec aac -vcodec libx264 -f dash -min_seg_duration 1000000 -individual_header_trailer 0 -pix_fmt yuv420p -vf scale=trunc(min(max(iw\,ih*dar)\,1920)/2)*2:trunc(ow/dar/2)*2 -bsf:v h264_mp4toannexb -profile:v high -level 4.1 -map_chapters -1 -map_metadata -1 -preset veryfast -movflags frag_keyframe+empty_moov -use_template 1 -use_timeline 0 -remove_at_exit 1 -crf 23 -bufsize 7532k -maxrate 3766k -start_at_zero -threads 0 -force_key_frames expr:if(isnan(prev_forced_t),eq(t,t),gte(t,prev_forced_t+1)) -init_seg_name $RepresentationID$/0_initial.mp4 -media_seg_name $RepresentationID$/0_$Number$.m4s /transcoding_temp/Z1GVWEc/index.mpd

    The media_seg_name is where I prepend the custom seek_point let’s say I want to seek to segment 1233 the template would be :

    -media_seg_name $RepresentationID$/1233_$Number$.m4s

    and the segments would be 1233_1 1233_2 1233_* So I can serve the right segment after seek. but the player does not recover and still downloading subsequent segments. I guess since a new initial segment is generated and I somehow miss headers for continuous playback after seek but I’m probably wrong.

    Thanks for your help

  • swf action script convert into flv

    6 juillet 2013, par Kazim King

    this is a action script : symmetrydigital-labs.com/junior/kazim/portal/flv/Shahid_Kapoor_07.swf

    image is call outside from server.
    i want to convert this .swf file into .flv and generate thumbnail.

    Problem :
    1 : .swf file converts only video not with image (call from outsource) .swf
    2 : code was not run in server run only in localhost.

    and i am try to using this command

    $ffmpeg = &#39;C:\FFmpeg\ffmpeg-20130614-git-6fe419b-win32-static\bin\ffmpeg&#39;;    
    $ffmpeg = &#39;/usr/bin/ffmpeg&#39;;  
    $cmd = "$ffmpeg -i Shahid_Kapoor_07.swf Shahid_Kapoor_07.flv";  
    $image = "$ffmpeg -i Shahid_Kapoor_07.swf -an -ss 00:00:03 -an -r 1 -vframes 1 -y  abc.jpg";
    shell_exec($cmd);
    shell_exec($image);
  • ffmpeg trim video works on emulator but fails on arm (real device)

    21 octobre 2017, par fthopkins

    I’m trimming the videos with ffmpeg that is bigger than 10 seconds. On my JNI edit function i use commands to trim video. I try to debug but as you all know debugging on JNI function is not like native android JAVA function. Maybe it is.. but not for my knowledge. Also i used coffecatch library to catch exception but didn’t succeeded. I did go for error step by step and reached the this line of ffmpeg main function.

    EDIT

    current_time = ti = getutime(); // edited : lastly can print message on here.
    if (transcode() &lt; 0) // transcode() &lt; 0 => true and run exit_program(1).
       exit_program(1);
    ti = getutime() - ti;

    On emulator everything is working good and fast. But on real device it gives some kind of error but i couldn’t catch it. When i check the Android Monitor of Android Studio my JNI edit function’s logs appear but disappear in a second. It is weird. Also when i check the output path on device, ffmpeg gives an trimmed video output (but very slow). So it is working on background and gives a trimmed video. It is very weird too because app crashes while main method is working. I need help to figure it out. I stucked.

    My video edit JNI function

    JNIEXPORT jint JNICALL
    Java_com_farukest_app_library_AppVideoEditer_natives_VideoEditer_edit
    (JNIEnv *env,jclass someclass, jstring inputFile, jstring outFile, jint
    startTime,jint endTime, jstring fileSize, jboolean mustCompress) {

       log_message("Starting to cut");

       int numberOfArgs = 19;

       char** $commands = calloc(numberOfArgs, sizeof(char*));
       char start[5], end[5];
       const char *in, *out, *fileSz;
       itoa(startTime, start);
       itoa(endTime, end);

       in = (*env)->GetStringUTFChars(env, inputFile, 0);
       out = (*env)->GetStringUTFChars(env, outFile, 0);
       fileSz = (*env)->GetStringUTFChars(env, fileSize, 0);


       $commands[0] = "ffmpeg";
       $commands[1] = "-ss";
       $commands[2] = start;
       $commands[3] = "-y";
       $commands[4] = "-i";
       $commands[5] = in;
       $commands[6] = "-t";
       $commands[7] = end;
       $commands[8] =  "-vcodec";
       $commands[9] =  "mpeg4";
       $commands[10] =  "-b:v";

       if(mustCompress){
         $commands[11] =  "3072000"; // 3mb
       }else{
         $commands[11] =  fileSz;
       }
       $commands[12] =  "-b:a";
       $commands[13] =  "48000";
       $commands[14] =  "-ac";
       $commands[15] =  "2";
       $commands[16] =  "-ar";
       $commands[17] =  "22050";
       $commands[18] =  out;

       int i;
       for (i = 0; i &lt; numberOfArgs; i++) {
           log_message($commands[i]);
       }
       log_message("Printed all"); // lastly prints on here

       main(numberOfArgs, $commands); // stuck on here
       log_message("Finished cutting"); // not reach here
       free($commands);
       (*env)->ReleaseStringUTFChars(env, inputFile, in);
       (*env)->ReleaseStringUTFChars(env, outFile, out);

       return 0;
    }

    FFMPEG main function

    int main(int argc, char **argv)
    {
    int i, ret;
    int64_t ti;

    init_dynload();

    register_exit(ffmpeg_cleanup);

    setvbuf(stderr,NULL,_IONBF,0); /* win32 runtime needs this */

    av_log_set_flags(AV_LOG_SKIP_REPEATED);
    parse_loglevel(argc, argv, options);

    if(argc>1 &amp;&amp; !strcmp(argv[1], "-d")){
       run_as_daemon=1;
       av_log_set_callback(log_callback_null);
       argc--;
       argv++;
    }

    avcodec_register_all();
    # if CONFIG_AVDEVICE
    avdevice_register_all();
    #endif
    avfilter_register_all();
    av_register_all();
    avformat_network_init();

    show_banner(argc, argv, options);

    /* parse options and open all input/output files */
    ret = ffmpeg_parse_options(argc, argv);
    if (ret &lt; 0)
       exit_program(1);

    if (nb_output_files &lt;= 0 &amp;&amp; nb_input_files == 0) {
       show_usage();
       av_log(NULL, AV_LOG_WARNING, "Use -h to get full help or, even better, run 'man %s'\n", program_name);
       exit_program(1);
    }

    /* file converter / grab */
    if (nb_output_files &lt;= 0) {
       av_log(NULL, AV_LOG_FATAL, "At least one output file must be specified\n");
       exit_program(1);
    }

    // if (nb_input_files == 0) {
    // av_log(NULL, AV_LOG_FATAL, "At least one input file must be specified\n");
    // exit_program(1);
    //     }

    for (i = 0; i &lt; nb_output_files; i++) {
       if (strcmp(output_files[i]->ctx->oformat->name, "rtp"))
           want_sdp = 0;
    }

    current_time = ti = getutime();
    if (transcode() &lt; 0)
       exit_program(1);
    ti = getutime() - ti;
    if (do_benchmark) {
       av_log(NULL, AV_LOG_INFO, "bench: utime=%0.3fs\n", ti / 1000000.0);
    }
    av_log(NULL, AV_LOG_DEBUG, "%"PRIu64" frames successfully decoded, %"PRIu64" decoding errors\n",
          decode_error_stat[0], decode_error_stat[1]);
    if ((decode_error_stat[0] + decode_error_stat[1]) * max_error_rate &lt; decode_error_stat[1])
       exit_program(69);

    exit_program(received_nb_signals ? 255 : main_return_code);
    return main_return_code;
    }

    EDIT

    I debugged and found which line exiting me from the app. It is transcode() &lt; 0 line But couldn’t find why ? Is there anyone to help me. I really need help. Can discuss and share more code.