
Recherche avancée
Autres articles (41)
-
ANNEXE : Les extensions, plugins SPIP des canaux
11 février 2010, parUn plugin est un ajout fonctionnel au noyau principal de SPIP. MediaSPIP consiste en un choix délibéré de plugins existant ou pas auparavant dans la communauté SPIP, qui ont pour certains nécessité soit leur création de A à Z, soit des ajouts de fonctionnalités.
Les extensions que MediaSPIP nécessite pour fonctionner
Depuis la version 2.1.0, SPIP permet d’ajouter des plugins dans le répertoire extensions/.
Les "extensions" ne sont ni plus ni moins que des plugins dont la particularité est qu’ils se (...) -
Submit bugs and patches
13 avril 2011Unfortunately 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 (...) -
Changer son thème graphique
22 février 2011, parLe thème graphique ne touche pas à la disposition à proprement dite des éléments dans la page. Il ne fait que modifier l’apparence des éléments.
Le placement peut être modifié effectivement, mais cette modification n’est que visuelle et non pas au niveau de la représentation sémantique de la page.
Modifier le thème graphique utilisé
Pour modifier le thème graphique utilisé, il est nécessaire que le plugin zen-garden soit activé sur le site.
Il suffit ensuite de se rendre dans l’espace de configuration du (...)
Sur d’autres sites (4914)
-
Re-encode mp4 files to working hls (m3u8) segment files
6 août 2022, par gameboysMy issue is that I need to create a hls playlist with all the segments being below 8 MB. At first, I generated all the segments and then checked if they were all under 8MB and if not rerun with a lower
-hls_time
but this could take a long period of time with high-quality videos. Then after some research realized that FFmpeg seems not to natively support file size limiting segments. I found this answer on splitting up mp4 video so that they are all under a certain length, but now I can't get them working in an actual m3u8 file.

If I keep them as an mp4 file I get this from vlc :


no moov before mdat and the stream is not seekable



I attempted to fix it by running
-movflags faststart
But then I get this from mpv (I read that vlc might have some issues with hls playlists)

[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: Found duplicated MOOV Atom. Skipped it



After this, I attempted to switch the mp4 splitter script to outputting .ts files but this just caused even more issues. It turns out that hls playlists require precise timestamps in each segment of a ts file otherwise it just start jumping around the video. Theses are the errors that mpv put in terminal


ffmpeg/demuxer] mpegts: Packet corrupt (stream = 0, dts = 1194750).
[ffmpeg/demuxer] mpegts: DTS 127271 < 1194750 out of order 
[ffmpeg/demuxer] hls: DTS 127271 < 1194750 out of order 
AV: 00:00:11 / 00:10:29 (1%) A-V: 0.000
Invalid audio PTS: 11.911837 -> 0.000000
Reset playback due to audio timestamp reset.
(...) AV: 00:00:00 / 00:10:29 (0%) A-V: 0.000
Invalid video timestamp: 11.875000 -> 0.014122
AV: 00:00:11 / 00:10:29 (1%) A-V: 0.000

Audio/Video desynchronisation detected! Possible reasons include too slow
hardware, temporary CPU spikes, broken drivers, and broken files. Audio
position will not match to the video (see A-V status field).



So I attempted to write a script to fix these issues by adding the timestamps back in :


def get_length(filename): //https://stackoverflow.com/questions/3844430/how-to-get-the-duration-of-a-video-in-python

 result = subprocess.run(["ffprobe", "-v", "error", "-show_entries",
 "format=duration", "-of",
 "default=noprint_wrappers=1:nokey=1", filename],
 stdout=subprocess.PIPE,
 stderr=subprocess.STDOUT)
 return float(result.stdout)
dirr = 0
for fi in sorted(os.listdir('out'), key=lambda k: int(k.split(".")[0]) if not ".m3u8" in k else 0):
 if fi.endswith(".ts"):
 fn = os.path.join("out", fi)
 ln = get_length(fn)
 print(dirr, fn)
 os.system(f"ffmpeg -i {fn} -muxdelay {dirr} tmp.ts ; mv tmp.ts {fn}")
 dirr+=ln



But somehow this still didn't work and mpv would report that the timestamps were different then what I gave them.


Invalid audio PTS: 11.911837 -> 23.833333
Reset playback due to audio timestamp reset.
(...) AV: 00:00:00 / 00:10:29 (0%) A-V: 0.000
Invalid video timestamp: 11.885911 -> 23.844244



If anybody knows how to Re-encode the mp4 files which are limited in file size please help me out, at this point, it appears that it may well be impossible.


In case it somehow matters I was using this video for testing.


-
Playing Live Audio Stream in HTML5 - MediaSource Errors in Chrome
18 octobre 2016, par user882807I need a way to play a live audio stream using HTML5 (primarily in Google Chrome), so I tried using the following :
<audio>
<source src="my-live-stream.ogg" type="audio/ogg">
</source></audio>While this does work for a live stream, there seems to be a very large, uncontrollable delay/buffer of around 30 seconds or so when this is played.
I need the delay to be a couple of seconds or less so this method doesn’t work.
As an alternative I have tried sending the audio over a WebSocket connection as 1 second individual audio files, which are then appended to a SourceBuffer and played in an audio element using Media Source Extensions.
After experimenting with a number of formats (MediaSource.isTypeSupported seems to be rather limited in audio support), I got this working using a Vorbis audio stream in a WebM container, which sounds perfect with no audible gaps. Other formats worked less well as they need to be gapless - e.g. MP3 and AAC end up with tiny audible gaps between each 1 second segment.
While this seems to work at first, when looking at
chrome://media-internals
, the following errors repeatedly appear :00:00:09 544 info Estimating WebM block duration to be 3ms for the last (Simple)Block in the Cluster for this Track. Use BlockGroups with BlockDurations at the end of each Track in a Cluster to avoid estimation.
00:00:09 585 error Large timestamp gap detected; may cause AV sync to drift. time:8994999us expected:9231000us delta:-236001us
00:01:05 239 debug Skipping splice frame generation: not enough samples for splicing new buffer at 65077997us. Have 1us, but need 1000us.Eventually the playback stops as though the pause button has been pressed on the audio element. It still shows the pause rather than play button, but the current time stops advancing :
Pressing the pause button and then the play button that replaces it doesn’t make it start playing again, but manually dragging the position slider further ahead makes it continue playing.
I have tried setting
sourceBuffer.mode = 'sequence';
but this doesn’t seem to help.Is there anything that needs to be changed in how the audio files are being encoded, or how they are played back in JavaScript to fix this ?
Additional details :
- The audio stream is encoded into 1 second WebM/Vorbis files using FFmpeg on Windows.
- A background worker is used in the browser to receive the audio segments and pass them to the main page thread, which appends them to the audio stream. Otherwise the playback freezes.
Source code :
- Web player : https://github.com/SamuelFisher/WebSocketAudio
- WebSocket server and encoder : https://github.com/SamuelFisher/WebSocketAudioServer
-
Improper use of system() call ?
28 mai 2013, par Dima1982I have a particle system program that generates a
.dat
file with particle coordinates in every iteration. The end goal is to run the program multiple times via a script with different parameters. So, I am trying to setup my program in a way that, for every run, all relevant data are going to be stored in a folder.What I do is to generate
PNGs
from the.dat
files withGnuplot
, callffmpeg
to create a video out of thePNGs
, useWinRAR
to compress the.dat
files and finally clean up, by deleting all the intermediate files. This works, when I do it in the working directory.Now I try to create a new directory and do the same stuff in there. My code :
// Load the proper library to use chdir() function
#ifdef _WIN32
#include
#elif defined __linux__ || defined __APPLE__&&__MACH__
#include
#endif
// Make output directory and change working directory to new directory
ostringstream dirCommand;
dirCommand << "mkdir " << folderName_str;
system(dirCommand.str().c_str());
const char* test = folderName_str.c_str();
#ifdef _WIN32
if(_chdir(test))
{
printf( "Unable to locate the directory: %s\n",test);
return;
}
#elif defined __linux__ || defined __APPLE__&&__MACH__
if(chdir(test))
{
printf( "Unable to locate the directory: %s\n",test);
return;
}
#endif
else
printf("Created output directory...\n");Already for this part, I know that there are going to be objections. I have looked extensively on SO and many people favor
SetCurrentDirectory()
for Windows, or they are skeptical about usingsystem()
. In my defense, I am a novice programmer and my knowledge is really limited...Now, when I try to make the video with
FFMpeg
and then rar/tar my files :// Make video
std::cout << "Generating Video..." << endl;
ostringstream command;
command << "ffmpeg -f image2 -r 1/0.1 -i output_%01d.png -vcodec mpeg4 " << videoName_str << ".avi -loglevel quiet";
std::system(command.str().c_str());
// Clean Up!
std::cout << "Cleaning up!" << endl;
ostringstream command2;
#ifdef _WIN32
command2 << "rar -inul a " << videoName_str << ".rar *.dat settings.gp loadfile.gp";
#elif defined __linux__ || defined __APPLE__&&__MACH__
command2 << "tar cf " << videoName_str << ".tar *.dat settings.gp loadfile.gp";
#endif
std::system(command2.str().c_str());I get very different behaviors in Win/ Linux.
Win 7 x64, Visual Studio 2010/12
In windows, the folder is created. The
.dat
files are generated correctly andgnuplot
plots thePNGs
as well. Whenffmpeg
is called, nothing happens. No error message fromFFMpeg
or anything. The same goes forWinRAR
. Maybe, for the last thing, I can use the command line utility of7z
which is free !Linux Mint 14 x64, Qt 4.8.1
Strangely enough, the behavior is inverted from that of Windows. As soon as the dir is changed, only the first
.dat
file is generated. It is as if every subsequent call I make tofprintf()
for my file generation does not work, or gets lost somewhere.Gnuplot
works, as doffmpeg
andtar
!!I am really perplexed. Any help, would be really appreciated.