Recherche avancée

Médias (16)

Mot : - Tags -/mp3

Autres articles (106)

  • 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

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (11538)

  • Video converted with FFMPEG cannot be played

    20 mai 2023, par EugeneH

    I am developing a function that converts RTSP files to HLS and displays them in a web browser (chrome).
Development is node.js, I am using ffmpeg.

    


    The part that is converted to HLS and displayed on the screen plays well without any problems.
Video cannot be played the moment the folder is changed for file management.

    


    This is the existing working ffmpeg code and m3u8 code.

    


     ffmpeg -rtsp_transport tcp -i rtsp://210.99.70.120:1935/live/cctv001.stream -c:v copy -f hls -hls_time 1 -hls_segment_type mpegts -hls_flags delete_segments+independent_segments+omit_endlist -hls_list_size 0 -master_pl_name playlist.m3u8 -hls_segment_filename /Users/name/Movies/cam/1/hls/1684560902700_%06d.ts -var_stream_map v:0 /Users/name/Movies/cam/1/hls/1684560902700_playlist.m3u8

Local Path : /Users/name/Movies/cam/1/hls/1684560902700_playlist.m3u8
EndPoint : http://localhost:3000/video/cam/1/hls/1684560902700_playlist.m3u8
 #EXTM3U
#EXT-X-VERSION:6
#EXT-X-TARGETDURATION:2
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-INDEPENDENT-SEGMENTS
#EXTINF:2.000000,
1684560902700_000000.ts
#EXTINF:1.969000,
1684560902700_000001.ts
#EXTINF:2.000000,
1684560902700_000002.ts
#EXTINF:2.015000,
1684560902700_000003.ts


    


    This is the ffmpeg code and the m3u8 code with the path added.(Video not played)

    


    ffmpeg -rtsp_transport tcp -i rtsp://210.99.70.120:1935/live/cctv001.stream -c:v copy -f hls -hls_time 1 -hls_segment_type mpegts -hls_flags delete_segments+independent_segments+omit_endlist -hls_list_size 0 -master_pl_name playlist.m3u8 -hls_segment_filename /Users/name/Movies/cam/1/hls/1684561736286/cam_%06d.ts -var_stream_map v:0 /Users/name/Movies/cam/1/hls/1684561736286/playlist.m3u8

Local Path : /Users/name/Movies/cam/1/hls/1684561736286/playlist.m3u8
EndPoint : http://localhost:3000/video/cam/1/hls/1684561736286/playlist.m3u8
#EXTM3U
#EXT-X-VERSION:6
#EXT-X-TARGETDURATION:2
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-INDEPENDENT-SEGMENTS
#EXTINF:1.986000,
cam_000000.ts
#EXTINF:1.984000,
cam_000001.ts
#EXTINF:2.000000,
cam_000002.ts
#EXTINF:2.000000,
cam_000003.ts


    


    The difference is the file name and the folder created one step further.

    


    If you change POSIX from file name to folder name, you will not know the problem of not playing the video.
Can someone please explain this ?

    


  • RTMP streaming not working with fluent-ffmpeg and gl

    15 avril 2023, par Smile

    I'm trying to send opengl rendering results to rtmp using gl and fluent-ffmpeg packages.
    
The render function writes opengl output to glBuf.
    
And the render function is called about 60 times per second.
    
And it calls ffmpeg with that glBuf as input.

    


    import ffmpeg from "fluent-ffmpeg";
import GL from "gl";
import { env } from "./env";
import { PassThrough } from "stream";

const WIDTH = 1920;
const HEIGHT = 1080;
const gl = GL(WIDTH, HEIGHT);

const glBuf = new PassThrough();
const render = () => {
  gl.viewport(0, 0, WIDTH, HEIGHT);
  gl.clearColor(0, 0, 0, 1);
  gl.clear(gl.COLOR_BUFFER_BIT);

  const pixels = new Uint8Array(WIDTH * HEIGHT * 4);
  gl.readPixels(0, 0, WIDTH, HEIGHT, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  glBuf.write(pixels);
};

const FRAMES = 10;
setInterval(() => {
  for (let i = 0; i < FRAMES; i++) {
    render();
  }
}, FRAMES * 1.1 * (1000 / 60));

ffmpeg()
  .input(glBuf)
  .inputFormat("rawvideo")
  .inputOptions([`-video_size ${WIDTH}x${HEIGHT}`, "-pix_fmt rgba"])
  .inputFPS(60)
  .outputFormat("flv")
  .outputOptions([
    "-c:v libx264",
    "-preset veryfast",
    "-maxrate 3000k",
    "-bufsize 6000k",
    "-pix_fmt yuv420p",
    "-g 60",
    "-c:a aac",
    "-b:a 160k",
    "-ac 2",
  ])
  .on("error", (err) => {
    console.error(err);
  })
  .output(`${env.stream_url}/${env.stream_key}`)
  .run();


    


    However, stream health shows No data. That is, the data is ignored.
    
Not works

    


    So I modified the code to save flv file. It works then.

    


    import ffmpeg from "fluent-ffmpeg";
import GL from "gl";
import { env } from "./env";
import { PassThrough } from "stream";

const WIDTH = 1920;
const HEIGHT = 1080;
const gl = GL(WIDTH, HEIGHT);

const glBuf = new PassThrough();
const render = () => {
  gl.viewport(0, 0, WIDTH, HEIGHT);
  gl.clearColor(0, 0, 0, 1);
  gl.clear(gl.COLOR_BUFFER_BIT);

  const pixels = new Uint8Array(WIDTH * HEIGHT * 4);
  gl.readPixels(0, 0, WIDTH, HEIGHT, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  glBuf.write(pixels);
};

const FRAMES = 10;
const renderInterval = setInterval(() => {
  for (let i = 0; i < FRAMES; i++) {
    render();
  }
}, FRAMES * 1.1 * (1000 / 60));

setTimeout(() => {
  clearInterval(renderInterval);
  glBuf.end();
  console.log("done!");
}, 3000);

ffmpeg()
  .input(glBuf)
  .inputFormat("rawvideo")
  .inputOptions([`-video_size ${WIDTH}x${HEIGHT}`, "-pix_fmt rgba"])
  .inputFPS(60)
  .outputFormat("flv")
  .outputOptions([
    "-c:v libx264",
    "-preset veryfast",
    "-maxrate 3000k",
    "-bufsize 6000k",
    "-pix_fmt yuv420p",
    "-g 60",
    "-c:a aac",
    "-b:a 160k",
    "-ac 2",
  ])
  .on("error", (err) => {
    console.error(err);
  })
  .output(`output.flv`)
  .run();



    


    It works then

    


    Why doesn't first code work ?

    


  • ffmpeg messes up delayed inputs (repeats at the beginning)

    20 mars 2023, par Ralph

    ffmpeg plays audio inputs delayed to t1, t2 etc at t=0.
If there are several inputs, then it replicates one after the other (after in0 finishes with its duration duration(in0), plays another one at t=duration(in0), etc.)

    


    In the following example, the in0 is played at t=0.

    


    ffmpeg -i in0.mp3 -i in1.mp3 -i in2.mp3 -filter_complex "[0]adelay=1000[delayed1];[1]adelay=2000[delayed2];[2]adelay=3000[delayed3];[delayed1][delayed2][delayed3]amix=inputs=3:duration=longest" -codec:a libmp3lame -q:a 4 output.mp3


    


    The command performs the following : 1. The ffmpeg processes three input files (mp3). 2. The complex filter delays the inputs by 1, 2, 3 seconds input-wise. 3. amix mixes the delayed outputs together. 4. And finally, a coded transforms it into an output mp3.

    


    Another short version : 2 delayed beeps, an finally there come 3 beeps out (@ 0, 1, 2 seconds) :

    


    ffmpeg -i beep.mp3 -filter_complex "[0]adelay=1000[delayed1];[0]adelay=2000[delayed2];[delayed1][delayed2]amix=inputs=2:duration=longest" -codec:a libmp3lame -q:a 4 output.mp3


    


    ffmpeg version N-110011-gf456c192d9-tessus on a Mac M1, downloaded as binary from https://evermeet.cx/ffmpeg (01.2023).

    


    I added also a silent input file from 0 to 1 seconds without any alteration of the outcome.
I added a silent stream as input as well without improvement. E.g. :

    


    ... -filter_complex "aevalsrc=0:d=4[silence];...


    


    Another test with another ffmpeg version 5.1 Copyright (c) 2000-2022 the FFmpeg developers built with Apple clang version 13.1.6 (clang-1316.0.21.2.5) :
ffmpeg -i beep.mp3 -filter_complex "[0]adelay=1000[delayed1];aevalsrc=0:d=5[silence];[silence][delayed1]amix=inputs=2:duration=longest" -codec:a libmp3lame -q:a 4 output.mp3
There are again 2 beeps, at 0 and 1 second.

    


    (comment : concat solves the issue. But I want to have a flexible solution with possibly overlapping audio streams.) Thanks for giving a hint !