
Recherche avancée
Autres articles (109)
-
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Pas question de marché, de cloud etc...
10 avril 2011Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
sur le web 2.0 et dans les entreprises qui en vivent.
Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...)
Sur d’autres sites (31303)
-
Why does not work audio element currentTime on ffmpeg encoded mp3 file in Chrome browser
25 juillet 2013, par PeterI have an HTML5 audio element :
<audio preload="auto">
<source src="./Sound/recording.mp3" type="audio/mpeg">
</source></audio>and I need to be able to play last 4 seconds from mp3 recording. My javaScript is :
audio.currentTime = audio.duration-4;
audio.play();Works ok in IE10 and Firefox, but Chrome starts playing from a wrong place. The difference between reported audio.currentTime and actual playback position is about 20s. The recording.mp3 is created with ffmpeg :
ffmpeg -i recording.wav -ab 32k recording.mp3
It works, when I strip the ID3v2 header from the recording.mp3 (deleting the first couple bytes in the file before the audio data).
It also works when I compress to ogg. Can somebody point me to the right direction (ffmpeg switches, audio element attributes or whatever) to get it work also in chrome ?
Thanks in advance
-
after restarting the page in the browser, the player stops loading
28 juillet 2024, par UximyI have a problem which is that when I start icecast server on ubuntu and not only on ubuntu but also on windows regardless of the operating system, when I first go to the radio station in icecast2 http://localhost:8000/radio the music plays but after restarting the page in the browser, the player stops loading, I tried the solution with nocache in the browser in the address bar, nothing helps, I looked at many users configs, they did not encounter such problems, I will leave my config below, I also wrote a code on nodejs I will also leave it below, the problem plays the same that if I go to a direct icecast link, what I will do through the node js code + ffmpeg, also about the logs, nothing outputs even a hint of any error that is related to this problem


Config IceCast :


<icecast>
 <location>Earth</location>
 <admin>icemaster@localhost</admin>
 <hostname>localhost</hostname>

 <limits>
 <clients>100</clients>
 <sources>10</sources>
 524288
 60
 30
 10
 1
 65536
 </limits>

 <authentication>
 hackme
 hackme
 admin
 hackme
 </authentication>

 
 <port>8000</port>
 0.0.0.0
 
 
 
 <port>8443</port>
 0.0.0.0
 <ssl>1</ssl>
 

 
 <header value="*"></header>
 <header value="Origin, X-Requested-With, Content-Type, Accept"></header>
 <header value="GET, POST, OPTIONS"></header>
 <header value="no-cache, no-store, must-revalidate"></header>
 <header value="no-cache"></header>
 <header value="0"></header>
 

 
 <mount type="normal">
 /radio
 <password>mypassword</password>
 <public>1</public>
 100
 Anime Vibes
 Anime Vibes
 <genre>various</genre>
 audio/ogg
 65536
 
 
 <header value="*"></header>
 <header value="Origin, X-Requested-With, Content-Type, Accept"></header>
 <header value="GET, POST, OPTIONS"></header>
 <header value="no-cache, no-store, must-revalidate"></header>
 <header value="no-cache"></header>
 <header value="0"></header>
 
 </mount>

 <fileserve>1</fileserve>

 <paths>
 <logdir>/var/log/icecast2</logdir>
 <webroot>/etc/icecast2/web</webroot>
 <adminroot>/etc/icecast2/admin</adminroot>
 
 <alias source="/" destination="/status.xsl"></alias>
 
 /etc/icecast2/cert/icecast.pem
 
 </paths>

 <logging>
 <accesslog>access.log</accesslog>
 <errorlog>error.log</errorlog>
 <playlistlog>playlist.log</playlistlog>
 <loglevel>1</loglevel> 
 <logsize>10000</logsize> 
 <logarchive>1</logarchive>
 </logging>
</icecast>



Code Node.js :


const express = require('express');
const { spawn } = require('child_process');
const path = require('path');
const fs = require('fs');
const https = require('https');
const app = express();
const port = 3000;

const privateKey = fs.readFileSync('./cert/privateKey.key', 'utf8');
const certificate = fs.readFileSync('./cert/certificate.crt', 'utf8');

const credentials = {
 key: privateKey,
 cert: certificate
};

app.use(express.static(path.join(__dirname)));

// Check if playlist file exists
const playlistPath = path.join(__dirname, 'playlist.txt');
if (!fs.existsSync(playlistPath)) {
 console.error('Playlist file does not exist');
 process.exit(1);
}

console.log(`Playlist path: ${playlistPath}`);

// Start FFmpeg process to create continuous stream from playlist
const ffmpegProcess = spawn('ffmpeg', [
 '-re',
 '-f', 'concat',
 '-safe', '0',
 '-protocol_whitelist', 'file,http,https,tcp,tls',
 '-i', playlistPath,
 '-c:a', 'libvorbis',
 '-f', 'ogg',
 '-tls', '1',
 'icecast://source:mypassword@localhost:8443/radio'
]);

ffmpegProcess.stdout.on('data', (data) => {
 console.log(`FFmpeg stdout: ${data}`);
});

ffmpegProcess.stderr.on('data', (data) => {
 console.error(`FFmpeg stderr: ${data}`);
});

ffmpegProcess.on('close', (code) => {
 console.log(`FFmpeg process exited with code ${code}`);
});

app.get('/radio', (req, res) => {
 res.setHeader('Content-Type', 'audio/ogg');
 res.setHeader('Transfer-Encoding', 'chunked');

 const requestOptions = {
 hostname: 'localhost',
 port: 8443,
 path: '/radio',
 method: 'GET',
 headers: {
 'Accept': 'audio/ogg'
 },
 rejectUnauthorized: false
 };

 const request = https.request(requestOptions, (response) => {
 response.pipe(res);

 response.on('end', () => {
 res.end();
 });
 });

 request.on('error', (err) => {
 console.error(`Request error: ${err.message}`);
 res.status(500).send('Internal Server Error');
 });

 request.end();
});
https.globalAgent.options.ca = [certificate];
// Create HTTPS server
const httpsServer = https.createServer(credentials, app);

httpsServer.listen(port, () => {
 console.log(`Server is running at https://localhost:${port}`);
});



I hope for your help and any advice, thanks in advance


-
Is there any way to change file FPS in javascript browser or prepare wav conventer to 60FPS videos ?
16 novembre 2020, par SZtyroI'm making web application which stores short audio files that have been cut from large video files. User uploads .mp4 file, chooses sound length and here's a little trick. Cutting audio can only be done in backend (correct me if I'm wrong) and sending 700MB data is not good option, so I use code below to decode audio data from .mp4 and then I send it with start and stop params. Backend (Node.js) use's FFMPEG to cut audio and save's it.


This part works, but i realised that decoded audio from 60FPS video doesn't sound good (not terrible but totally useless in my app). My goal is to avoid third party, especially desktop, apps (like audacity) and allow user to cut revelant part of audio from any mp4 video. Is there any way to convert 60FPS video to 30FPS video (ArrayBuffer) in browser and then decode audio ?


fileInput.onchange = event => {
 this.file = event.target["files"][0];
 //.mp4 file
 this.fileURL = URL.createObjectURL(this.file)

 let baseAudioContext = new AudioContext();
 this.file.arrayBuffer().then(buff => {

 baseAudioContext.decodeAudioData(buff,
 success => {
 console.log(success)
 this.bufferToWave(success, 0, success.length);
 },
 err => console.log(err));
 })
 }

 bufferToWave(abuffer, offset, len) {

 var numOfChan = abuffer.numberOfChannels,
 length = len * numOfChan * 2 + 44,
 buffer = new ArrayBuffer(length),
 view = new DataView(buffer),
 channels = [], i, sample,
 pos = 0;

 // write WAVE header
 setUint32(0x46464952); // "RIFF"
 setUint32(length - 8); // file length - 8
 setUint32(0x45564157); // "WAVE"

 setUint32(0x20746d66); // "fmt " chunk
 setUint32(16); // length = 16
 setUint16(1); // PCM (uncompressed)
 setUint16(numOfChan);
 setUint32(abuffer.sampleRate);
 setUint32(abuffer.sampleRate * 2 * numOfChan); // avg. bytes/sec
 setUint16(numOfChan * 2); // block-align
 setUint16(16); // 16-bit (hardcoded in this demo)

 setUint32(0x61746164); // "data" - chunk
 setUint32(length - pos - 4); // chunk length

 // write interleaved data
 for (i = 0; i < abuffer.numberOfChannels; i++)
 channels.push(abuffer.getChannelData(i));

 while (pos < length) {
 for (i = 0; i < numOfChan; i++) { // interleave channels
 sample = Math.max(-1, Math.min(1, channels[i][offset])); // clamp
 sample = (0.5 + sample < 0 ? sample * 32768 : sample * 32767) | 0; // scale to 16-bit signed int
 view.setInt16(pos, sample, true); // update data chunk
 pos += 2;
 }
 offset++ // next source sample
 }

 // create Blob
 //return (URL || webkitURL).createObjectURL(new Blob([buffer], { type: "audio/wav" }));
 var u = (URL || webkitURL).createObjectURL(new Blob([buffer], { type: "audio/wav" }));

 //temporary part
 //downloading file to check quality
 //in this part sound is already broken, no need to show backend code
 const a = document.createElement('a');
 a.style.display = 'none';
 a.href = u;
 a.download = name;
 document.body.appendChild(a);
 a.click();



 function setUint16(data) {
 view.setUint16(pos, data, true);
 pos += 2;
 }

 function setUint32(data) {
 view.setUint32(pos, data, true);
 pos += 4;
 }
 }