Recherche avancée

Médias (91)

Autres articles (74)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (4294)

  • Extracting Thumbnail URL from Video URL

    29 août 2023, par Deepak Sangle

    So, I have a video URL in an Amazon S3 bucket. I must extract the thumbnail image (preview image) from the video URL. The catch is that I do not have the luxury to download or upload the complete video since it takes time. My approach is something like this.
I first created a blob object containing the first few seconds of that video using something like this.

    


      const chunkSize = 1024*1024; // 1MB
  const start = 0;
  const end = chunkSize - 1;
  const rangeHeader = `bytes=${start}-${end}`;
  
  const VideoResponse = await axios.get(url, { 
    responseType: 'arraybuffer',
    headers: { Range: rangeHeader }
  });

  const chunkData = VideoResponse.data; 
  
  const videoBlob = new Blob([chunkData], { type: 'video/mp4' });
  const videoUrl = URL.createObjectURL(videoBlob);
  console.log({chunkData, videoBlob, videoUrl});


    


    Console gives me something like this

    


    {&#xA;  chunkData: <buffer 00="00" 1c="1c" 66="66" 74="74" 79="79" 70="70" 6d="6d" 34="34" 32="32" 69="69" 73="73" 6f="6f" 61="61" 76="76" 63="63" 31="31" 02="02" bd="bd" ab="ab" 6c="6c" 68="68" 64="64" c7="c7" 1048526="1048526" more="more" bytes="bytes">,&#xA;  videoBlob: Blob { size: 1048576, type: &#x27;video/mp4&#x27; },&#xA;  videoUrl: &#x27;blob:nodedata:764fce87-792f-47e8-bc3e-15921ee5787f&#x27;&#xA;}&#xA;</buffer>

    &#xA;

    Now, there are many options after this. I am trying to download this blob object by converting it into a file. After I successfully convert it into an mp4 file, I can easily take a screenshot of it using fluent-ffmpeg package. However, I couldn't convert it into a file. If I try to do something like this

    &#xA;

      const BlobResponse = await axios({&#xA;    method: &#x27;GET&#x27;,&#xA;    url: videoUrl,&#xA;    responseType: &#x27;stream&#x27;&#xA;  });&#xA;&#xA;  const file = fs.createWriteStream(`video.mp4`);&#xA;  BlobResponse.data.pipe(file);&#xA;  &#xA;  file.on("error", (error) => {&#xA;    console.log(`There was an error writing the file. Details: $ {error}`);&#xA;  });&#xA;&#xA;  file.on(&#x27;finish&#x27;, () => {&#xA;    file.close();&#xA;    console.log("File downloaded successfully");&#xA;  });&#xA;

    &#xA;

    But it throws me the error AxiosError: Unsupported protocol blob:

    &#xA;

    I also tried to directly convert the blob object to a jpeg object but to no avail.

    &#xA;

    I have searched complete StackOverflow, and I have not found a single solution working so please let me know why those are not working or if there is any new solution to do this.

    &#xA;

  • Running ffmpeg in Docker environment on AWS EC2 [duplicate]

    5 mai 2024, par must

    I want to use FFMPEG inside my Java application.&#xA;I want to instal ffmpeg in environment where this app is running.

    &#xA;

    My current Dockerfile :

    &#xA;

    # Stage 1: Build the application&#xA;FROM maven:3.8.4-openjdk-17 AS build&#xA;WORKDIR /app&#xA;COPY pom.xml .&#xA;COPY src ./src&#xA;RUN mvn clean install -Dmaven.test.skip=true&#xA;&#xA;# Stage 2: Run the application&#xA;FROM openjdk:17&#xA;WORKDIR /app&#xA;COPY --from=build /app/target/application.jar ./app.jar&#xA;EXPOSE 8080&#xA;CMD ["java", "-jar", "-Dspring.profiles.active=pr", "app.jar"]&#xA;

    &#xA;

    I simply built a docker image by running docker buildx build --platform linux/amd64 -t repo/app:1.0 .

    &#xA;

    Then in AWS Console I run docker run and pull built image.

    &#xA;

    Everyone writes about adding

    &#xA;

    RUN apt-get -y update &amp;&amp; apt-get -y upgrade &amp;&amp; apt-get install -y --no-install-recommends ffmpeg&#xA;

    &#xA;

    but I cannot do it as I'm building image on MacOS and I do no have apt-get command.

    &#xA;

    When I was trying to pull some image form DockerHub FFMPEG could not be found.

    &#xA;

    I tried this one : https://hub.docker.com/r/jrottenberg/ffmpeg

    &#xA;

    and declared DockerFile as :

    &#xA;

    # Stage 1: Build the application&#xA;FROM maven:3.8.4-openjdk-17 AS build&#xA;WORKDIR /app&#xA;COPY pom.xml .&#xA;COPY src ./src&#xA;RUN mvn clean install -Dmaven.test.skip=true&#xA;&#xA;# Stage 2: Install ffmpeg&#xA;FROM jrottenberg/ffmpeg:latest AS ffmpeg&#xA;&#xA;# Stage 3: Run the application&#xA;FROM openjdk:17&#xA;WORKDIR /app&#xA;COPY --from=build /app/target/application.jar ./app.jar&#xA;COPY --from=ffmpeg /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg&#xA;&#xA;EXPOSE 8080&#xA;CMD ["java", "-jar", "-Dspring.profiles.active=pr", "app.jar"]&#xA;

    &#xA;

    but still it did not work. I get :

    &#xA;

    ffmpeg: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory&#xA;

    &#xA;

    I'm using Amazon Linux on EC2.

    &#xA;

    Can someone get me on the right track ?

    &#xA;

  • Flask send_file not sending file

    30 avril 2021, par jackmerrill

    I'm using Flask with send_file() to have people download a file off the server.

    &#xA;&#xA;

    My current code is as follows :

    &#xA;&#xA;

    @app.route(&#x27;/&#x27;, methods=["GET", "POST"])&#xA;def index():&#xA;    if request.method == "POST":&#xA;        link = request.form.get(&#x27;Link&#x27;)&#xA;        with youtube_dl.YoutubeDL(ydl_opts) as ydl:&#xA;            info_dict = ydl.extract_info(link, download=False)&#xA;            video_url = info_dict.get("url", None)&#xA;            video_id = info_dict.get("id", None)&#xA;            video_title = info_dict.get(&#x27;title&#x27;, None)&#xA;            ydl.download([link])&#xA;        print("sending file...")&#xA;        send_file("dl/"&#x2B;video_title&#x2B;".f137.mp4", as_attachment=True)&#xA;        print("file sent, deleting...")&#xA;        os.remove("dl/"&#x2B;video_title&#x2B;".f137.mp4")&#xA;        print("done.")&#xA;        return render_template("index.html", message="Success!")&#xA;    else:&#xA;        return render_template("index.html", message=message)&#xA;

    &#xA;&#xA;

    The only reason I have .f137.mp4 added is because I am using AWS C9 to be my online IDE and I can't install FFMPEG to combine the audio and video on Amazon Linux. However, that is not the issue. The issue is that it is not sending the download request.

    &#xA;&#xA;

    Here is the console output :

    &#xA;&#xA;

    127.0.0.1 - - [12/Dec/2018 16:17:41] "POST / HTTP/1.1" 200 -&#xA;[youtube] 2AYgi2wsdkE: Downloading webpage&#xA;[youtube] 2AYgi2wsdkE: Downloading video info webpage&#xA;[youtube] 2AYgi2wsdkE: Downloading webpage&#xA;[youtube] 2AYgi2wsdkE: Downloading video info webpage&#xA;WARNING: You have requested multiple formats but ffmpeg or avconv are not installed. The formats won&#x27;t be merged.&#xA;[download] Destination: dl/Meme Awards v244.f137.mp4&#xA;[download] 100% of 73.82MiB in 00:02&#xA;[download] Destination: dl/Meme Awards v244.f140.m4a&#xA;[download] 100% of 11.63MiB in 00:00&#xA;sending file...&#xA;file sent, deleting...&#xA;done.&#xA;127.0.0.1 - - [12/Dec/2018 16:18:03] "POST / HTTP/1.1" 200 -&#xA;

    &#xA;&#xA;

    Any and all help is appreciated. Thanks !

    &#xA;