
Recherche avancée
Médias (2)
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
-
GetID3 - Boutons supplémentaires
9 avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (6)
-
Les vidéos
21 avril 2011, parComme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...) -
Publier sur MédiaSpip
13 juin 2013Puis-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 -
Menus personnalisés
14 novembre 2010, parMediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
Menus créés à l’initialisation du site
Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)
Sur d’autres sites (3529)
-
Investigating Steam for Linux
1er mars 2013, par Multimedia Mike — Game HackingValve recently released the final, public version of their Steam client for Linux, and the Linux world rejoiced. At least, it probably did. The announcement was 2 weeks ago on Valentine’s Day and I had other things on my mind, so I missed any fanfare. When framed in this manner, the announcement timing becomes suspect– it’s as though Linux enthusiasts would have plenty of time that day or something.
Taming the Frontier
Speculation about a Linux Steam client had been kicking around for nearly as long as Steam has existed. However, sometime last year, the rumors became more substantive.I naturally wondered how to port something like Steam to Linux. I have some experience with trying to make a necessarily binary-only program that runs on Linux. I’m fairly well-versed in the assorted technical challenges that one might face when attempting such a feat. Because of this, whenever I hear rumors that a company might be entertaining the notion of porting a major piece of proprietary software to Linux, my instinctive reflex is, “What ?! Why, you fools ?! Save yourselves !”
At least, that’s how it used to be. The proposal of developing a proprietary binary for Linux has been rendered considerably less insane by a few developments, for example :
- The rise of Ubuntu Linux as a quasi de facto standard for desktop Linux computing
- The increasing homogeneity in personal desktop computing technology
What I would like to know is how the Steam client runs on Linux. Does it rely on any libraries being present on the system ? Or does it bring its own ? The latter is a trick that proprietary programs can use– transport all of the shared libraries that the main program binary depends upon, install them someplace out of the way on the filesystem, probably in /opt, and then make the main program a shell script which sets a preload path to rely on the known quantity libraries instead of the copies already on the system.
Downloading and Installing the Client
For this exercise, I installed x86_64 desktop Ubuntu 12.04 Linux on a l33t gaming rig that was totally top of the line about 5 years ago, and that someone didn’t want anymore and handed down to me recently. So it should be ideal for this project.At first, I was blown away– the Linux client is in a .deb package that is less than 2 MB large. I unpacked the steam.deb file and found a bunch of support libraries — mostly X11 and standard C/C++ runtimes. Just as I suspected. Still, I can’t believe how small the thing is. However, my amazement quickly abated when I actually ran Steam and saw this :
So it turns out steam.db is just the installer program which immediately proceeds to download an additional 160+ MB of data. So there’s actually a lot more information to possibly sift through.
Another component of the installation is to basically run a big ‘apt-get install’ command to make sure a bunch of required packages are installed :
After all these installation steps, the client was ready to run. However, whenever I tried to do so, I got this dialog which would cause Steam to close when the dialog was dismissed.
Not a huge deal ; later NVIDIA drivers are fairly straightforward to install on Ubuntu Linux. After a few minutes of downloading, installing and restarting X, Steam ran with minimal complaint (it still had some issue regarding the video drivers but didn’t seem to consider it a deal-breaker).
Using Steam on Linux
So here’s Steam running on Linux :
If you have experience with using Steam on Windows or Mac, you might observe that it looks exactly the same. I don’t have a very expansive library of games (I only started using Steam because purchasing a few computer components a few years ago entitled me to some free Steam downloads of some of the games on the list in the screenshot). I didn’t really expect any of the games to have Linux versions yet, but it turns out that the indie darling FTL : Faster Than Light has been ported to Linux. FTL was a much-heralded Kickstarter success story and sounded like something I wanted to support. I purchased this from Steam shortly after its release last year and was able to download the Linux version at no additional cost with a single click.
It runs natively on Linux (note the Ubuntu desktop window decorations) :
You might notice from the main Steam client that, despite purchasing FTL about a 1/2 year ago and starting it up at least a 1/2 dozen times, I haven’t really invested a whole lot of time into it. I only managed to get about 2 minutes further this time :
What can I say ? This game just bores me to tears. It’s frustrating because I know that this is one of the cool games that all real gamers are supposed to like, but I practically catch myself nodding off every time I try to run through the tutorial. It’s strange to think that I’ve invested far more time into games that offer considerably less stimulation. That’s probably because I had far more free time compared to gaming options during those times.
But that’s neither here nor there. We’ll file this under “games that aren’t for me.” I’m glad that people like FTL and a little indie underdog has met with such success. And I’m pleased that Steam on Linux works. It’s native and the games are also native, which is all quite laudable (there was speculation that everything would just be running on top of a Wine layer).
Deeper Analysis
So I set out wondering how Steam was able to create a proprietary program that would satisfy a large enough cross-section of Linux users (i.e., on different platforms and distros). Answer : well, they didn’t, per the stated requirements. The installation is only tuned to work on Ubuntu 12.04. However, it works on both 32- and 64-bit platforms, the only 2 desktop CPU platforms that matter these days (unless ARM somehow makes inroads on the desktop). The Steam client is quite clearly an x86_32 binary– look at the terminal screenshot above and observe that it’s downloading all :i386 support libraries.The file /usr/bin/steam isn’t a binary but a launcher shell script (something you’ll also see if you investigate /usr/bin/firefox on a Linux system). Here’s an interesting tidbit :
function detect_platform() # Maybe be smarter someday # Right now this is the only platform we have a bootstrap for, so hard-code it. echo ubuntu12_32
I wager that it’s possible to get Steam running on other distributions, it probably just takes a little more effort (assuming that Steam doesn’t put too much effort into thwarting such attempts).
As for the FTL game, it comes with binaries and libraries for both x86_32 and x86_64. So, good work to the dev team for creating and testing both versions. FTL also distributes versions of the libraries it expects to work with.
I suspect that the Steam client overall is largely a WWW rendering engine underneath the covers. That would help explain how Valve is able to achieve such a consistent look and feel, not only across OS platforms, but also through a web browser. When I browse the Steam store through Google Chrome, it looks and feels exactly like the native desktop client. When I first thought of how someone could port Steam to Linux, I immediately wondered about how they would do the UI.
A little Googling for “steam uses webkit” (just a hunch) confirms my hypothesis.
-
slicing and seeking extremeley small sections of video in ffmpeg
20 février 2021, par Zarc RowdenI am writing a program that maps midi data to timestamps in a video. The end result is a kind of automatic generation of audio visuals for beat making or techno heads. The program takes in midi, slices a video into chunks based on the midi events and mappings and finally joins the slices into a video with 1:1 timing of monophonic midi notes to sections of a video.


When it is successful, the result is very cool and watching the video jump around and lock in to midi notes is very interesting


However, I am affraid that the ffmpeg commands I use are not giving exact results.


The code I feed to ffmpeg looks like this


EVENTS : left is midinote number, right is time from start of recording in which note occurs.


[{"note"=>"start", "timestamp"=>0.0},
 {"note"=>48, "timestamp"=>0.5700000037904829},
 {"note"=>51, "timestamp"=>383.7100000018836},
 {"note"=>45, "timestamp"=>884.3500000002678},
 {"note"=>48, "timestamp"=>999.0449999968405},
 {"note"=>51, "timestamp"=>1383.544999996957},
 {"note"=>45, "timestamp"=>1884.2599999989034},
 {"note"=>48, "timestamp"=>1998.890000002575},
 {"note"=>51, "timestamp"=>2383.4199999982957},
 {"note"=>45, "timestamp"=>2884.1000000029453},
 {"note"=>48, "timestamp"=>2998.7200000032317},
 {"note"=>51, "timestamp"=>3383.2800000018324},
 {"note"=>45, "timestamp"=>3883.894999999029},
 {"note"=>48, "timestamp"=>3998.6250000001746},
 {"note"=>51, "timestamp"=>4384.550000002491},
 {"note"=>45, "timestamp"=>4883.780000003753},
 {"note"=>48, "timestamp"=>4998.404999998456},
 {"note"=>51, "timestamp"=>5384.39500000095},
 {"note"=>45, "timestamp"=>5883.565000003728},
 {"note"=>48, "timestamp"=>5998.464999996941},
 {"note"=>51, "timestamp"=>6384.254999997211},
 {"note"=>45, "timestamp"=>6883.4550000028685},
 {"note"=>48, "timestamp"=>6998.585000001185},
 {"note"=>51, "timestamp"=>7384.055000002263},
 {"note"=>45, "timestamp"=>7883.249999998952},],



MAPPINGS : left side is midi note, right is timestamp in seconds


{
 48=>234.3489,
 45=>124.334489,
 51=>2789.34,
}



That Events are a sequential array of midi notes and time taken from recordings or standard midi file. The number is in milliseconds but I convert for ffmpeg before feeding the arguments.


The mappings are just in seconds and tell the program what to show when certain midi notes are encountered as we loop through the events and begin slicing the video.


The command I send to ffmpeg is constructed like this :


"ffmpeg -an -y -ss #{begin_at} -i #{project_tempfile_url} -t #{slice_duration} -c:v libx264 #{temp_url}"



When I concatenate these slices, they only look exact when my notes are very consistent like a kickdrum doing 4/4 rythms. Anything too fast or varied creates unpleasant results.


Is there a specific set of commands that will tell ffmpeg to cut down to the frame ? I think keyframe are not an ideal answer but not sure. I also think I can adjust by making sure that I only ever map the notes to keyframes, I can settle for it but it would be great if I could just cut almost anywhere between start and end like ANYWHERE like


rand(0...video.length)
 # and then have
 332.3253613134



But I may just be dreaming :P


Do you think that I would be better off writing a custom c program to cut frames like this ? I understand that frame rates could be an issue and that there may actually not be any data at 7.34667898999 seconds and that it might be here instead : 7.356788722342 and that ffmpeg probably searches for the nearest frame from whatever timestamp you input, but I feel like there must be a way to get good results still despite these limitations.


Thank you so much in advance for those who take the time to read this and understand this issue.


-
FFMPEG Muxing Audio stream is stopped 1seconds C++
5 décembre 2019, par BirdsI am trying to create MP4 video and AAC audio stream to .mkv file from desktop. Ultimately we will send this to RTSP.
I followed this example(https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/muxing.c)
I created a frame from the data received via audio capture (dshow) and video capture
After resampling the Audio AAC codec, I perform encoding and muxing. And I check mkv file.All of this works fine when doing audio file + video capture.
But Issue is that when I do audio capture (FFPMEG-dshow) + DXGI the audio is only record only 1-2 seconds.The only difference from trying it with a file is that the number of samples coming in via av_read_frame is different.
from Desktop pkt
from file pkt
For desktops, av_read_frame is called twice for 30fps (frame-> nb_samples = 22050) and file 16. (Frame-> nb_samples = 1024)
detailed description>>
input data format = PCM_S16 (Windows default microphone) / resampling format = PCM_FLTP / encode codec = AV_CODEC_ID_AAC / encode Bit_rate = 64000 / encode sample_rate = 44100 / encode frame size = 1024 / timebase 1 / 44100 / stream_time_base = 1 / 1000
I searched a lot of pkt.pts and stream_timebase issues. and tried but I still have same issue.
Here is my codes.
https://drive.google.com/file/d/1RkDdmFxMecQdJDfl8NcyDcZu-FFmKI0J/view?usp=sharing
It almost same muxing.c but in open_audioif (c->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)
nb_samples = 10000;
else
nb_samples = c->frame_size;
ost->frame = alloc_audio_frame(c->sample_fmt, c->channel_layout,
c->sample_rate, nb_samples);
ost->tmp_frame = alloc_audio_frame(AV_SAMPLE_FMT_S16, c->channel_layout,
c->sample_rate, 44100/*decoder sample_rate*/); //HERE
ost->st->codecpar->frame_size = nb_samples; //HEREand write_audio_frame
if (frame) {
/* convert samples from native format to destination codec format, using the resampler */
/* compute destination number of samples */
dst_nb_samples = av_rescale_rnd(swr_get_delay(ost->swr_ctx, c->sample_rate) + frame->nb_samples,
c->sample_rate, c->sample_rate, AV_ROUND_UP);
//av_assert0(dst_nb_samples == frame->nb_samples); //HERE
/* when we pass a frame to the encoder, it may keep a reference to it
* internally;
* make sure we do not overwrite it here
*/
ret = av_frame_make_writable(ost->frame);
if (ret < 0)
exit(1);
/* convert to destination format */
ret = swr_convert(ost->swr_ctx,
ost->frame->data, ost->enc->frame_size, //HERE
(const uint8_t **)frame->data, frame->nb_samples);
if (ret < 0) {
fprintf(stderr, "Error while converting\n");
exit(1);
}
frame = ost->frame;
frame->pts = av_rescale_q(ost->samples_count, { 1, c->sample_rate }, c->time_base);
ost->samples_count += dst_nb_samples;
}I doubted part of the pkt.pts calculation, but that’s right.
Thank you for watching.
Can anyone help me ?