Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (75)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (4497)

  • Can ffmpeg concatenate mp3 files using the process at audio-joiner.com ?

    7 juin 2020, par Ed999

    I have a dozen or more mp3 audio files, which I need to concatenate into a single mp3 file. The files all have the same bitrate (320 kbps) and sample rate (44.1 kHz), but all of them have differing durations.

    



    I have studied the three methods of concatenation recommended on stackoverflow (How to concatenate two MP4 files using FFmpeg). One method actually works, but when I play back the output file I find that there are noticeable audio artifacts (audible glitches) at each join point.

    



    I've been told that this problem is caused by the input files not having identical duration. This seems likely, because I've had some successes in concatenating audio files with identical bit rate, sample rate, and duration.

    



    I have seen, online, some much more complex scripts which are, at present, miles beyond my understanding. One solution I was directed to required a fairly deep knowledge of Python !

    



    However, my research also included a site at audio-joiner.com - and this had the only completely successful method I've yet found, for files of non-identical duration. That site processed some of my input files, joined the multiple files into one, and the concatenated output file it produced did not have any audible glitches at the joins.

    



    I looked into the process the site was using, hoping to get a clue as to where I've been going wrong, but the script on the site (which looks like ajax-based javascript) is too complex for me to follow.

    



    Because the process seemed to take quite a long time, I wouldn't be too surprised to learn that the mp3 input files are being converted to some other audio format, joined, then converted back to mp3 for the output. But if so, that wouldn't put me off using the process.

    



    Is anyone familiar with the approach being used, and can say whether it might be reproducible using ffmpeg ?

    



    .

    



    ADDED -

    



    There are 7 scripts, in all, listed in the source of the relevant page :

    



    https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.0/jquery.min.js
https://static.123apps.com/js/socket.io.js
https://static.123apps.com/js/shared_0.js
https://static.123apps.com/js/shared_1.js
https://static.123apps.com/js/ajoiner.js
https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js


    



    .

    



    ADDED -

    



    The successful (javascript) function seems to be this, but it isn't obvious to me why it is succeeding (too complex for me !). Can anyone suggest what approach it is taking ? For example, is it transcoding the mp3 files to an intermediate format, and concatenating the intermediate files ?

    



    function start_join(e){
  l("start_join():"),l(e);
  var t;
  return(t=$.parseJSON(e)) && $("#ajoiner").ajoiner("set_params",t),!0
}

function cancel_join(e){
  return l("cancel_join():"),l(e),!0
}

!function(o){
  var t={
    init:function(e){
      var t=o(this),n=o.extend({lang:{cancel:"Cancel",download:"Download"}},e);
      o(this).data("ajoiner",{o:n,tmp_i:1,pid:-1,params:{}});
      t.data("ajoiner");
      t.ajoiner("_connect"),o("body").bind("socket_connected",function(){t.ajoiner("_connect")})
    },set_params:function(e){
      var t=o(this).data("ajoiner");
      isset(e)?(e.uid=Cookies.get("uid"),t.params=e,t.params.lang_id=lang_id,t.params.host=location.hostname,t.params.hostprotocol=location.protocol,l("socket emit join:"),l(t.params),socket.emit("join",t.params)):error("set_params: params not set")
    },_connect:function(){

      var t=o(this).data("ajoiner");

      l("_connect"),socket.on("join",function(e){
        "progress"==e.message_type?(t.tmp_i,t.tmp_i++,void 0!==getObj("theSWF")&&(getObj("theSWF").set_join_progress(parseInt(e.progress_value)),l("SWF.set_join_progress("+parseInt(e.progress_value)+")")),isset(e.pid)&&(t.pid=e.pid)):"final_result"==e.message_type?(void(e.tmp_i=0)!==getObj("theSWF")&&(getObj("theSWF").join_finished(o.stringifyJSON(e)),l("SWF.join_finished('"+o.stringifyJSON(e)+"')")),last_conv_result=e):"error"==e.message_type&&l(e.error_desc)
      }
    )},_cancel_convert:function(){
      var e=o(this).data("ajoiner");
      0code>

    


  • PHP Foreach query only displays final result for slideshow ?

    22 janvier 2023, par ShaneRibz

    Using a query I pull the most liked video's on a localhosted stream webpage, and use FFMPEG to create a thumbnail if one isnt already existing and the video length.

    


    The query succesfully pulls the 4 most liked video's and displays them in a carousel. FFMPEG succesfully creates each thumbnail, and gets the length of each video.

    


    Somewhere, for whatever reason I cant figure out, only the final slide in the carousel displays the thumbnail as its background.

    


    Sorry if my code is messy, I'm learning how to better optimize.

    


    &lt;?php&#xA;                $sql = "use info";&#xA;                $pdo->exec($sql);&#xA;                $stmt = $pdo->query("SELECT * FROM `files` ORDER BY `like` DESC LIMIT 4");&#xA;                $filelist = $stmt->fetchAll(PDO::FETCH_ASSOC);&#xA;                    $h = 0;&#xA;                  foreach ($filelist as $row) {&#xA;                        if ($h &lt; 25){&#xA;                        $h&#x2B;&#x2B;;&#xA;                &#xA;                            $name = $row[&#x27;name&#x27;];&#xA;                            $location = $row[&#x27;location&#x27;];&#xA;                            $type = $row[&#x27;type&#x27;];&#xA;                            $uploadby = $row[&#x27;uploadby&#x27;];&#xA;                            $like = $row[&#x27;like&#x27;];&#xA;                            $id = $row[&#x27;fileid&#x27;];&#xA;                            $cat1 = $row[&#x27;Cat1&#x27;];&#xA;                            $cat2 = $row[&#x27;Cat2&#x27;];&#xA;            &#xA;                $ffmpeg = &#x27;F:\\xampp\ffmpeg.exe&#x27;;  &#xA;                $location = str_replace("/","\\", $location);&#xA;                $video = &#x27;F:\xampp\htdocs\\&#x27;. $location;  &#xA;                $bigloc = "F:\\xampp\htdocs\\thumb\big";&#xA;                $smallloc = "F:\\xampp\htdocs\\thumb\small";&#xA;                $image = $bigloc . "\\" . $name . ".jpg"; &#xA;                $image2 = $smallloc . "\\" . $name. ".jpg"; &#xA;                            &#xA;                if (file_exists($image) and (file_exists($image2))) {&#xA;                    &#xA;                } else {&#xA;                echo $image . " does not exist";&#xA;                $cmd="$ffmpeg -ss 00:25:00 -i ". "\"" . $video . "\"". " -s 1920x540 -vframes 1 ". "\"" .$image. "\"" . " -report";  &#xA;                $cmd2="$ffmpeg -ss 00:25:00 -i ". "\"" . $video . "\""." -s 270x370 -vframes 1 ". "\"" .$image2. "\"";&#xA;                echo "<br />". $cmd . "<br />".$cmd2."<br />";&#xA;                exec($cmd);&#xA;                exec($cmd2);&#xA;                }&#xA;                &#xA;                $file = "\"". $video. "\"";&#xA;                $result = shell_exec(&#x27;ffmpeg -i &#x27; . escapeshellcmd($file) . &#x27; 2>&amp;1&#x27;);&#xA;                preg_match(&#x27;/(?&lt;=Duration: )(\d{2}:\d{2}:\d{2})\.\d{2}/&#x27;, $result, $match);&#xA;                $time = $match[1];&#xA;                $image = "thumb/big/" . $name . ".jpg"; &#xA;                $image2 = "thumb/small/" . $name. ".jpg";&#xA;&#xA;            ?>&#xA;&#xA;            <div class="single-hero-slider-wrap single-animation-wrap slider-height-hm4 bg-image-hm4 slider-bg-color-black d-flex align-items-center slider-bg-position-1 bg-black" style="&amp;lt;?php echo &amp;#x27;background-image:url(&amp;#x27;. $image.&amp;#x27;);&amp;#x27;;?>">&#xA;                <div class="slider-content-hm4 slider-animated">&#xA;                    <h1 class="title animated">&lt;?php echo $name;?></h1>&#xA;                    <div class="sub-title-time-wrap">&#xA;                        <span class="sub-title animated">&lt;?php if ($cat2 != ""){ echo $cat1 .", ". $cat2; }else{ echo $cat1;}?></span>&#xA;                        <span class="time animated">&lt;?php echo $time;?></span>&#xA;                    </div>&#xA;                    <div class="slider-button">&#xA;                        <a href="http://stackoverflow.com/feeds/tag/movie-details.html" class="btn-style-hm4 animated">Watch Now</a>&#xA;                    </div>&#xA;                </div>&#xA;            </div>&#xA;&#xA;            &lt;?php    &#xA;                        }&#xA;                  }              &#xA;            ?>&#xA;

    &#xA;

    When inspecting the source code on my web browser ;&#xA;"style="&lt;?php echo &#x27;background-image:url(&#x27;. $image.&#x27;);&#x27;;?>"", this will only appear on the final slide. The first 3 slides wont have "background-image" at all.

    &#xA;

    I feel as though I'm making a silly mistake and just cant see it.

    &#xA;

    EDIT&#xA;I should note, the "$name" and "$time" for each displays properly, its just the background-image that does not.

    &#xA;

    EDIT 2&#xA;Here is the source code :

    &#xA;

    <div class="single-hero-slider-wrap single-animation-wrap slider-height-hm4 bg-image-hm4 slider-bg-color-black d-flex align-items-center slider-bg-position-1 bg-black" style="background-image: url(&amp;#x27;thumb/big/Alita Battle Angel.png&amp;#x27;);">&#xA;</div>

    &#xA;

    The "background-image" shows in source, but during inspect element it does not. No errors populate either.

    &#xA;

  • How do I get an InputStream out of a Mono ?

    30 octobre 2022, par Einfari

    Bear with my noobness, I am learning web-flux. I had this simple application that takes a video and extract the audio using FFprobe and FFmpeg, so I thought of redoing it reactively, but I am failing miserably...

    &#xA;

    Controller :

    &#xA;

    @PostMapping("/upload")&#xA;public String upload(@RequestPart("file") Mono<filepart> filePartMono, final Model model) {&#xA;    Flux<string> filenameList = mediaComponent.extractAudio(filePartMono);&#xA;    model.addAttribute("filenameList", new ReactiveDataDriverContextVariable(filenameList));&#xA;    return "download";&#xA;}&#xA;</string></filepart>

    &#xA;

    Function to get audio streams out of the video :

    &#xA;

    public Mono<ffproberesult> getAudioStreams(InputStream inputStream) {&#xA;    try {&#xA;        return Mono.just(FFprobe.atPath(FFprobePath)&#xA;                .setShowStreams(true)&#xA;                .setSelectStreams(StreamType.AUDIO)&#xA;                .setLogLevel(LogLevel.INFO)&#xA;                .setInput(inputStream)&#xA;                .execute());&#xA;    } catch (JaffreeException e) {&#xA;        log.error(e.getMessage(), e);&#xA;        throw new MediaException("Audio formats could not be identified.");&#xA;    }&#xA;}&#xA;</ffproberesult>

    &#xA;

    Attempt 1 :

    &#xA;

    public Flux<string> extractAudio(Mono<filepart> filePartMono) {&#xA;    filePartMono.flatMapMany(Part::content)&#xA;            .map(dataBuffer -> dataBuffer.asInputStream(true))&#xA;            .flatMap(this::getAudioStreams)&#xA;            .subscribe(System.out::println);&#xA;    ...&#xA;}&#xA;</filepart></string>

    &#xA;

    Attempt 2 :

    &#xA;

    public Flux<string> extractAudio(Mono<filepart> filePartMono) {&#xA;    filePartMono.flatMapMany(Part::content)&#xA;            .reduce(InputStream.nullInputStream(), (inputStream, dataBuffer) -> new SequenceInputStream(&#xA;                    inputStream, dataBuffer.asInputStream()&#xA;            ))&#xA;            .flatMap(this::getAudioStreams)&#xA;            .subscribe(System.out::println);&#xA;    ...&#xA;}&#xA;</filepart></string>

    &#xA;

    Attempt 3 :

    &#xA;

    public Flux<string> extractAudio(Mono<filepart> filePartMono) {&#xA;    DataBufferUtils.write(filePartMono.flatMapMany(Part::content), OutputStream.nullOutputStream())&#xA;            .map(dataBuffer -> dataBuffer.asInputStream(true))&#xA;            .flatMap(this::getAudioStreams)&#xA;            .subscribe(System.out::println);&#xA;    ...&#xA;}&#xA;</filepart></string>

    &#xA;

    Attempt 1 and 3 seems to be the same in the end, FFprobe complains as follows :

    &#xA;

    2022-10-30 11:24:30.292  WARN 79049 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9162702340] [warning] STSZ atom truncated&#xA;2022-10-30 11:24:30.292 ERROR 79049 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9162702340] [error] stream 0, contradictionary STSC and STCO&#xA;2022-10-30 11:24:30.292 ERROR 79049 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9162702340] [error] error reading header&#xA;2022-10-30 11:24:30.294 ERROR 79049 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [error] tcp://127.0.0.1:51532: Invalid data found when processing input&#xA;2022-10-30 11:24:30.295  INFO 79049 --- [oundedElastic-3] c.g.k.jaffree.process.ProcessHandler     : Process has finished with status: 1&#xA;2022-10-30 11:24:30.409 ERROR 79049 --- [oundedElastic-3] c.e.s.application.MediaComponent         : Process execution has ended with non-zero status: 1. Check logs for detailed error message.&#xA;

    &#xA;

    Attempt 2 produces multiple of these :

    &#xA;

    Exception in thread "Runnable-0" java.lang.StackOverflowError&#xA;    at java.base/java.io.SequenceInputStream.read(SequenceInputStream.java:198)&#xA;

    &#xA;

    Could anybody point me in the right direction ? What am I doing wrong ? By the way, I am outputting to console just to see a result, but in the end I need to take all the outputted streams and pass them as arguments to another function that will finally extract the audio, so I need to figure out that as well.

    &#xA;

    Thank you in advance.

    &#xA;