Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (61)

  • 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

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

Sur d’autres sites (9635)

  • Batch File for FFMPEG : Extracting MP3 from MP4 : Folders

    11 décembre 2023, par RunedElf

    Got a bit of a question. I would like a batch file that would pop into a defined folder, scan it and all its subfolders, rip the audio out of them all, and put them into another defined folder, but keeping the original subfolder hierarchy. For instance :

    


    music_videos/Rock & Roll/Bon Jovi - Livin' on a Prayer.mp4

    


    music/Rock & Roll/Bon Jovi - Livin' on a Prayer.mp3

    


    Ideally, if an MP3 with the same name already exists, it would skip it, so I can run the same batch file whenever a new addition to the folder/subfolders drops in.

    


    As a non-coder, I've asked AI to come up with something and this is the closest I could get :

    


    @echo off
setlocal enabledelayedexpansion

set "inputDirectory=X:\Media\YouTube\music_videos\"
set "outputDirectory=X:\Media\YouTube\music\"
set "bitrate=192k"  REM Adjust the bitrate as needed

:: Ensure output directory exists
if not exist "%outputDirectory%" mkdir "%outputDirectory%"

:: Loop through all MP4 files in the input directory and its subfolders
for /r "%inputDirectory%" %%i in (*.mp4) do (
    set "inputFile=%%i"
    
    :: Generate output path with the same subfolder structure in the output directory
    set "relativePath=!inputFile:%inputDirectory%=!"
    set "relativePath=!relativePath:\=!"
    set "outputFile=%outputDirectory%!relativePath!\%%~ni.mp3"

    :: Ensure the output directory for the current file exists
    if not exist "!outputFile!\.." mkdir "!outputFile!\.."

    :: Check if the output file already exists
    if not exist "!outputFile!" (
        :: Execute FFMPEG command to convert MP4 to MP3 with specified quality
        ffmpeg -i "!inputFile!" -vn -acodec mp3 -ab !bitrate! "!outputFile!"
    ) else (
        echo Output file for "!inputFile!" already exists. Skipping.
    )
)

echo Conversion completed.
pause


    


    However, while this code works to extract the audio, it doesn't seem to properly separate the subfolder from the filename, resulting in something along these lines :

    


    music_videos/Rock & Roll/Bon Jovi - Livin' on a Prayer.mp4

    


    music/Rock & RollBon Jovi - Livin' on a Prayer.mp3

    


    I've tried adding any number of forward slashes in and around the definitions of the various Path variables, but nothing seems to work.

    


    Fingers crossed ya'll be able to help !

    


  • ffmpeg exited with code 1 : Input/output error

    30 mai 2024, par Alessandro1918

    On my backend Node server, I am trying to read a stream from an online radio station, and save the audio as a file in my computer. As streams don't have start/end, I'm choosing to record an arbitrary value of 5 seconds.

    


    For this problem, I'm using the fluent-ffmpeg npm package for ffmpeg wrapper. Also, the @ffmpeg-installer/ffmpeg npm package to point to the directory of my local ffmpeg binary. As stream input, I'm reading from 89 FM - A Rádio Rock, a radio from São Paulo, BR, with the stream available at http://26593.live.streamtheworld.com/RADIO_89FMAAC.aac

    


    Here is the code I put together :

    


    import ffmpeg from "fluent-ffmpeg"
import ffmpegInstaller from "@ffmpeg-installer/ffmpeg"
ffmpeg.setFfmpegPath(ffmpegInstaller.path);
console.log(ffmpegInstaller.path)
console.log(ffmpegInstaller.url)
console.log(ffmpegInstaller.version)

const pathInput = "http://26593.live.streamtheworld.com/RADIO_89FMAAC.aac"
// const pathInput = "./tmp/demo.avi"
const pathOutput = "./tmp/output.m4a"

ffmpeg()
  .input(pathInput)
  .duration(5)
  .save(pathOutput)
  .on("start", function(command) {
    console.log("Spawned Ffmpeg with command: " + command)
  })
  .on("error", function (err) {
    console.log("An error occurred: " + err.message)
  })
  .on("end", async function () {
    console.log("Processing finished!")
  })


    


    On my local machine (Mac, running darwin-x64), the program outputs OK :

    


    /.../node_modules/@ffmpeg-installer/darwin-x64/ffmpeg
https://evermeet.cx/ffmpeg/
92718-g092cb17983
Spawned Ffmpeg with command: ffmpeg -i http://26593.live.streamtheworld.com/RADIO_89FMAAC.aac -y -t 5 ./tmp/record.m4a
Processing finished!


    


    On my docker container (linux-x64), which I need to deploy the project, the ffmpeg returns an error :

    


    /usr/app/node_modules/@ffmpeg-installer/linux-x64/ffmpeg
https://www.johnvansickle.com/ffmpeg/
20181210-g0e8eb07980
Spawned Ffmpeg with command: ffmpeg -i http://26593.live.streamtheworld.com/RADIO_89FMAAC.aac -y -t 5 ./tmp/output.m4a
main-1  | An error occurred: ffmpeg exited with code 1: http://26593.live.streamtheworld.com/RADIO_89FMAAC.aac: Input/output error


    


    Dockerfile for the container :

    


    FROM node:alpine

WORKDIR /usr/app

COPY package*.json ./

# Install ffmpeg in the container:
RUN apk update
RUN apk add ffmpeg

RUN npm install

COPY . .

CMD [ "npm", "run", "dev" ]



    


    Obs : this error seems to happen only for stream -> file save. When using as input a path from a local .avi file (thus, converting from .avi to .m4a), both localhost and docker versions run OK.

    


    Has anyone has any clue as to why this error happens on this version ?
Or how I can run a ffmpeg command, server-side, on a docker container, to record a radio stream ?

    


  • How to dump ALL metadata from a media file, including cover image title ? [closed]

    9 avril, par Unideal

    I have an MP3 song :

    


    # ffprobe -hide_banner -i filename.mp3
Input #0, mp3, from 'filename.mp3':
  Metadata:
    composer        : Music Author
    title           : Song Name
    artist          : Singer
    encoder         : Lavf61.7.100
    genre           : Rock
    date            : 2025
  Duration: 00:03:14.04, start: 0.023021, bitrate: 208 kb/s
  Stream #0:0: Audio: mp3 (mp3float), 48000 Hz, stereo, fltp, 192 kb/s
      Metadata:
        encoder         : Lavc61.19
  Stream #0:1: Video: png, rgb24(pc, gbr/unknown/unknown), 600x600 [SAR 1:1 DAR 1:1], 90k tbr, 90k tbn (attached pic)
      Metadata:
        title           : Cover
        comment         : Cover (front)


    


    The task is to save its metadata to a text file and restore from that file later. Both goals should be accomplished with ffmpeg.

    


    The simpliest method is to run :

    


    # ffmpeg -i filename.mp3 -f ffmetadata metadata.txt


    


    After that, metadata.txt contains :

    


    ;FFMETADATA1
composer=Music Author
title=Song Name
artist=Singer
date=2025
genre=Rock
encoder=Lavf61.7.100


    


    I got global metadata only, but stream-specific info (cover image title and comment in my case) are missing.

    


    Google suggested a more complex form of the command above to extract all metadata fields without any exclusions :

    


    # ffmpeg -y -i filename.mp3 -c copy -map_metadata 0 -map_metadata:s:v 0:s:v -map_metadata:s:a 0:s:a -f ffmetadata metadata.txt


    


    But the output is exactly the same :

    


    ;FFMETADATA1
composer=Music Author
title=Song Name
artist=Singer
date=2025
genre=Rock
encoder=Lavf61.7.100


    


    Again, no info about the attached image.

    


    Please explain what am I doing wrong.