
Recherche avancée
Médias (1)
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (7)
-
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
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 (4336)
-
Launch Leech and the History of WMV
14 septembre 2010, par Multimedia Mike — GeneralI was combing through my programming archives again and came across an old Perl script called launch-leech.pl. This was a private script I used to maintain for the benefit of myself and a few friends. See, there was this site called Launch.com (URL doesn’t seem to do anything as of this writing but here’s the Wikipedia page). Purchased by Yahoo ! in 2001, Launch still maintained their independent branding. They also carried a lot of music videos, of which I am a huge junkie. launch-leech.pl was the tool I used to download the videos. This was particularly useful since I stubbornly clung to dialup internet access until mid-2004 and it would have been impossible to stream video at any decent quality (though there were 56k streams, so like I said– not possible at any decent quality).
Technically
I followed Launch.com for many years. To be honest, I only “followed” in that I figured out where their “latest videos” URL lived and regularly polled it. Each video had either a 6-, 7-, or 8-digit unique ID that could be plugged into the launch-leech.pl script which would then have a conversation with the relevant servers, determine the correct streaming URL with the highest quality, then download and save the URL by handing it off to an external program (first ASFRecorder, though I later switched to mmsclient).At one point, I even wrote a crawler that compiled an offline database of all the videos, their IDs and their metadata. I never thought of anything interesting to do with it, though.
Windows Media Legacy
During these glory days of leeching, Launch.com streamed using Windows Media. I admit, it’s a bit of a blur now — the site might have used Real or QuickTime, but I was obviously most in tune with the WM side. I remember when I first found the site circa 2000-2001, the videos were in MS MPEG-4v3, and the high quality bitrate was 300 kbits/sec. Eventually, Launch.com would stream WMV7, WMV8, and finally WMV9, with bitrates up to 700 kbits/sec. However, they never broke free of the 320×240 encoding resolution, which was frustrating. When I wasn’t able to notice any substantial difference between 300 and 700 kbits/sec, I felt it might be time to put those extra bits to work on a resolution upgrade.At least they were nice enough to re-encode a number of old videos using better codecs and bitrates with each revision, thus prompting me to scan through the site collecting updated video IDs for download.
Epilogue
I don’t clearly remember when I stopped visiting Launch.com. Video-wise, the web has been a blur of Flash video ever since about 2006. Meanwhile, I spent a lot of time collecting a bunch of music videos in the first half of the decade only to find that pretty much every version of every music video made since the dawn of time is available on demand thanks to YouTube. I have found that this phenomenon manifests in many areas as internet technology marches on.The Real Entertainment
The launch-leech.pl tool represents a recurring pattern for me. I derive as much — if not more — entertainment from creating programs like launch-leech.pl (and implicitly reverse engineering something in the process ; in this case, a website) as I do from the intended entertainment media itself. I seem to have this issue a lot with games, too.Is this an issue for anyone else ? Am I the only one who would rather play with the box that a shiny toy comes packaged in ?
-
ffmpeg command never work in lambda function using nodejs [closed]
4 décembre 2022, par Santosh swainI am trying to implement FFmpeg video streaming functionality such as Instagram countdown functionality. In this code, first of all, I get records(URLs) from the s3 bucket and then split them according to my need, and then create the command and execute it with exec() belonging to childe_process. in this, I am trying to store the out in some specific folder in lambda function but it was never stored. I thought lambda does allow to write files locally so I am trying to do the direct upload on the s3 bucket by using the stdout parameter of exec()'s callback. guys, please help to do that. I have a question lambda does allow to write content in its local folder ? or if not allow then whats the way to do that thing ? I just share my code please guide me.



 // dependencies
var AWS = require('aws-sdk');
var s3 = new AWS.S3();
var { exec } = require('child_process');
var path = require('path')
var AWS_ACCESS_KEY = '';
var AWS_SECRET_ACCESS_KEY = '';
var fs = require('fs')

s3 = new AWS.S3({
 accessKeyId: AWS_ACCESS_KEY,
 secretAccessKey: AWS_SECRET_ACCESS_KEY
});

exports.handler = async function (event, context) {

 var bucket_name = "sycu-game";
 var bucketName = "sycu-test";

 //CREATE OVERLAY AND BG_VALUE PATH TO GET VALUE FROM S3
 const bgValue = (event.Records[0].bg_value).split('/');
 const overlayImage = (event.Records[0].overlay_image_url).split('/');


 var s3_bg_value = bgValue[3] + "/" + bgValue[4];
 var s3_overlay_image = overlayImage[4] + "/" + overlayImage[5] + "/" + overlayImage[6];
 const signedUrlExpireSeconds = 60 * 5;


 //RETREIVE BG_VALUE FROM S3 AND CREATE URL FOR FFMPEG INPUT VALUE
 var bg_value_url = s3.getSignedUrl('getObject', {
 Bucket: bucket_name,
 Key: s3_bg_value,
 Expires: signedUrlExpireSeconds
 });
 bg_value_url = bg_value_url.split("?");
 bg_value_url = bg_value_url[0];


 //RETREIVE OVERLAY IMAGE FROM S3 AND CREATE URL FOR FFMPEG INPUT VALUE 
 var overlay_image_url = s3.getSignedUrl('getObject', {
 Bucket: bucket_name,
 Key: s3_overlay_image,
 Expires: signedUrlExpireSeconds
 });
 overlay_image_url = overlay_image_url.split("?");
 overlay_image_url = overlay_image_url[0];


 //MANUAL ASSIGN VARIABLE FOR FFMPEG COMMAND 
 var command,
 ExtraTimerSec = event.Records[0].timer_seconds + 5,
 TimerSec = event.Records[0].timer_seconds + 1,
 BackgroundWidth = 1080,
 BackgroundHeight = 1920,
 videoPath = (__dirname + '/tmp/' + event.Records[0].name);
 console.log("path", videoPath)
 //TEMP DIRECTORY

 var videoPath = '/media/volume-d/generatedCountdownS3/tmp/' + event.Records[0].name
 var tmpFile = fs.createWriteStream(videoPath)
 //FFMPEG COMMAND 
 if (event.Records[0].bg_type == 2) {
 if (event.Records[0].is_rotate) {
 command = ' -stream_loop -1 -t ' + ExtraTimerSec + ' -i ' + bg_value_url + ' -i ' + overlay_image_url + ' -filter_complex "color=color=0x000000@0.0:s= ' + event.Records[0].resized_box_width + 'x' + event.Records[0].resized_box_height + ',drawtext=fontcolor=' + event.Records[0].time_text_color + ':fontsize=' + event.Records[0].time_text_size + ':x=' + event.Records[0].minute_x + ':y=' + event.Records[0].minute_y + ':text=\'%{eif\\:trunc(mod(((' + TimerSec + '-if(between(t, 0, 1),1,if(gte(t,' + TimerSec + '),' + TimerSec + ',t)))/60),60))\\:d\\:2}\',drawtext=fontcolor=' + event.Records[0].time_text_color + ':fontsize=' + event.Records[0].time_text_size + ':x=' + event.Records[0].second_x + ':y=' + event.Records[0].second_y + ':text=\'%{eif\\:trunc(mod(' + TimerSec + '-if(between(t, 0, 1),1,if(gte(t,' + TimerSec + '),' + TimerSec + ',t))\,60))\\:d\\:2}\'[txt]; [txt] rotate=' + event.Records[0].box_angle + '*PI/180:fillcolor=#00000000 [rotated];[0] scale=w=' + BackgroundWidth + ':h=' + BackgroundHeight + '[t];[1] scale=w=' + BackgroundWidth + ':h=' + BackgroundHeight + '[ot];[t][ot] overlay = :x=0 :y=0 [m1];[m1][rotated]overlay = :x=' + event.Records[0].flat_box_coordinate_x + ' :y=' + event.Records[0].flat_box_coordinate_x + ' [m2]" -map "[m2]" -pix_fmt yuv420p -t ' +
 ExtraTimerSec + ' -r 24 -c:a copy ' + videoPath + "";
 }
 else {
 command = ' -stream_loop -1 -t ' + ExtraTimerSec + ' -i ' + bg_value_url + ' -i ' + overlay_image_url + ' -filter_complex "color=color=0x000000@0.0:s= ' + event.Records[0].resized_box_width + 'x' + event.Records[0].resized_box_height + ',drawtext=fontcolor=' + event.Records[0].time_text_color + ':fontsize=' + event.Records[0].time_text_size + ':x=' + event.Records[0].minute_x + ':y=' + event.Records[0].minute_y + ':text=\'%{eif\\:trunc(mod(((' + TimerSec + '-if(between(t, 0, 1),1,if(gte(t,' + TimerSec + '),' + TimerSec + ',t)))/60),60))\\:d\\:2}\',drawtext=fontcolor=' + event.Records[0].time_text_color + ':fontsize=' + event.Records[0].time_text_size + ':x=' + event.Records[0].second_x + ':y=' + event.Records[0].second_y + ':text=\'%{eif\\:trunc(mod(' + TimerSec + '-if(between(t, 0, 1),1,if(gte(t,' + TimerSec + '),' + TimerSec + ',t))\,60))\\:d\\:2}\'[txt]; [txt] rotate=' + event.Records[0].box_angle + '*PI/180:fillcolor=#00000000 [rotated];[0] scale=w=' + BackgroundWidth + ':h=' + BackgroundHeight + '[t];[1] scale=w=' + BackgroundWidth + ':h=' + BackgroundHeight + '[ot];[t][ot] overlay = :x=0 :y=0 [m1];[m1][rotated]overlay = :x=' + event.Records[0].flat_box_coordinate_x + ' :y=' + event.Records[0].flat_box_coordinate_x + ' [m2]" -map "[m2]" -pix_fmt yuv420p -t ' +
 ExtraTimerSec + ' -r 24 -c:a copy ' + videoPath + "";
 }
 }
 var final_command = '/usr/bin/ffmpeg' + command;


 //COMMAND EXECUTE HERE

 await exec(final_command, function (err, stdout, stderr) {
 console.log("data is here")
 console.log('err:', err);
 console.log('stdout:', stdout);
 console.log('stderr:', stderr);
 const params = {
 Bucket: bucketName,
 Key: "countdown/output.mp4",
 Body: stdout,
 }
 s3.upload(params).promise().then(data => {
 console.log("data is here -->", data)
 });
 });
 var tmpFile = fs.createReadStream(videoPath)
 console.log('temp file data:', tmpFile.toString())
};



-
FFmpeg C++ decoding in a separate thread
12 juin 2019, par BrigapesI’m trying to decode a video with FFmpeg and convert it to an openGL texture and display it inside a cocos2dx engine. I’ve managed to do that and it displays the video as i wanted to, now the problem is performance wise. I get a Sprite update every frame(game is fixed 60fps, video is 30fps) so what i did was i decoded and converted frame interchangeably, didn’t work great, now i have it set up to have a separate thread where i decode in an infinite
while
loop withsleep()
just so it doesn’t hog the cpu/program.
What i currently have set up is 2 pbo framebuffers and abool
flag to tell my ffmpeg thread loop to decode another frame since i don’t know how to manually wait when to decode another frame. I’ve searched online for a soultion to this kind of problem but didn’t manage to get any answers.I’ve looked at this : Decoding video directly into a texture in separate thread but it didn’t solve my problem since it was just converting YUV to RGB inside opengl shaders which i haven’t done yet but currently not an issue.
Additional info that might be useful is that i don’t need to end thread until application exit and i’m open to using any video format, including lossless.
Ok so main decoding loop looks like this :
//.. this is inside of a constructor / init
//adding thread to array in order to save the thread
global::global_pending_futures.push_back(std::async(std::launch::async, [=] {
while (true) {
if (isPlaying) {
this->decodeLoop();
}
else {
std::this_thread::sleep_for(std::chrono::milliseconds(3));
}
}
}));Reason why i use bool to check if frame was used is because main decoding function takes about 5ms to finish in debug and then should wait about 11 ms for it to display the frame, so i can’t know when the frame was displayed and i also don’t know how long did decoding take.
Decode function :
void video::decodeLoop() { //this should loop in a separate thread
frameData* buff = nullptr;
if (buf1.needsRefill) {
/// buf1.bufferLock.lock();
buff = &buf1;
buf1.needsRefill = false;
firstBuff = true;
}
else if (buf2.needsRefill) {
///buf2.bufferLock.lock();
buff = &buf2;
buf2.needsRefill = false;
firstBuff = false;
}
if (buff == nullptr) {
std::this_thread::sleep_for(std::chrono::milliseconds(1));
return;//error? //wait?
}
//pack pixel buffer?
if (getNextFrame(buff)) {
getCurrentRBGConvertedFrame(buff);
}
else {
loopedTimes++;
if (loopedTimes >= repeatTimes) {
stop();
}
else {
restartVideoPlay(&buf1);//restart both
restartVideoPlay(&buf2);
if (getNextFrame(buff)) {
getCurrentRBGConvertedFrame(buff);
}
}
}
/// buff->bufferLock.unlock();
return;
}As you can tell i first check if buffer was used using bool needsRefill and then decode another frame.
frameData struct :
struct frameData {
frameData() {};
~frameData() {};
AVFrame* frame;
AVPacket* pkt;
unsigned char* pdata;
bool needsRefill = true;
std::string name = "";
std::mutex bufferLock;
///unsigned int crrFrame
GLuint pboid = 0;
};And this is called every frame :
void video::actualDraw() { //meant for cocos implementation
if (this->isVisible()) {
if (this->getOpacity() > 0) {
if (isPlaying) {
if (loopedTimes >= repeatTimes) { //ignore -1 because comparing unsgined to signed
this->stop();
}
}
if (isPlaying) {
this->setVisible(true);
if (!display) { //skip frame
///this->getNextFrame();
display = true;
}
else if (display) {
display = false;
auto buff = this->getData();
width = this->getWidth();
height = this->getHeight();
if (buff) {
if (buff->pdata) {
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, buff->pboid);
glBufferData(GL_PIXEL_UNPACK_BUFFER, 3 * (width*height), buff->pdata, GL_DYNAMIC_DRAW);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, 0);///buff->pdata); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
}
buff->needsRefill = true;
}
}
}
else { this->setVisible(false); }
}
}
}getData func to tell which frambuffer it uses
video::frameData* video::getData() {
if (firstBuff) {
if (buf1.needsRefill == false) {
///firstBuff = false;
return &buf1;///.pdata;
}
}
else { //if false
if (buf2.needsRefill == false) {
///firstBuff = true;
return &buf2;///.pdata;
}
}
return nullptr;
}I’m not sure what else to include i pasted whole code to pastebin.
video.cpp : https://pastebin.com/cWGT6APn
video.h https://pastebin.com/DswAXwXVTo summarize the problem :
How do i properly implement decoding in a separate thread / how do i optimize current code ?
Currently video is lagging when some other thread or main thread gets heavy and then it does not decode fast enough.