
Recherche avancée
Médias (1)
-
SWFUpload Process
6 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
Autres articles (67)
-
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 (...) -
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 (...) -
Création définitive du canal
12 mars 2010, parLorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
A la validation, vous recevez un email vous invitant donc à créer votre canal.
Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...)
Sur d’autres sites (8167)
-
FFmpegFrameGrabber and FFmpegFrameRecorder Audio Issue
20 août 2015, par Sheheryar ChaganiI am compress an existing camera recorded video using FFmpegframerecorder and ffmpegFrameGrabber.
The issue is that its audio is not occurring after compression.
Please note that I am using googlecode.javacv along with javacpp and armeabi in lib folder.
Below is the code which I have used.
public void compressVideo(String filePath)
FrameGrabber grabber = new FFmpegFrameGrabber(filePath);
grabber.start();
fileoutput = filePath.replace("trimmed", "compressed");
// recorder.setAudioCodec(grabber.get);
FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(fileoutput, 480,
480, grabber.getAudioChannels());
recorder.setFrameRate(grabber.getFrameRate());
recorder.setSampleRate(grabber.getSampleRate());
recorder.setSampleFormat(grabber.getSampleFormat());
recorder.setFormat(grabber.getFormat());
// recorder.setPixelFormat(grabber.getPixelFormat());
recorder.start();
Frame frame;
int count = 0;
while ((frame = grabber.grabFrame()) != null) {
if (frame.image != null) {
publishProgress(count);
count++;
IplImage rotateImage = rotate(frame.image, 90);
IplImage cropImage = resizeImage(rotateImage, 480, 480, true);
frame.image = cropImage;
recorder.record(frame);
if (rotateImage != null)
opencv_core.cvReleaseImage(rotateImage);
if (cropImage != null)
opencv_core.cvReleaseImage(cropImage);
} else {
recorder.record(frame);
}
}
recorder.stop();
grabber.stop();
recorder.release();
grabber.release();
}
IplImage resizeImage(IplImage origImg, int newWidth, int newHeight,
boolean keepAspectRatio) {
IplImage outImg;
int origWidth = 0;
int origHeight = 0;
if (origImg != null) {
origWidth = origImg.width();
origHeight = origImg.height();
}
if (newWidth <= 0 || newHeight <= 0 || origImg == null
|| origWidth <= 0 || origHeight <= 0) {
// cerr << "ERROR: Bad desired image size of " << newWidth
// << "x" << newHeight << " in resizeImage().\n";
return null;
}
if (keepAspectRatio) {
// Resize the image without changing its aspect ratio,
// by cropping off the edges and enlarging the middle section.
CvRect r;
// input aspect ratio
float origAspect = (origWidth / (float) origHeight);
// output aspect ratio
float newAspect = (newWidth / (float) newHeight);
// crop width to be origHeight * newAspect
if (origAspect > newAspect) {
int tw = (origHeight * newWidth) / newHeight;
// System.out.println((origWidth - tw) / 2+" "+)
r = opencv_core.cvRect((origWidth - tw) / 2, 0, tw, origHeight);
} else { // crop height to be origWidth / newAspect
int th = (origWidth * newHeight) / newWidth;
r = opencv_core.cvRect(0, (origHeight - th) / 2, origWidth, th);
}
IplImage croppedImg = cropImage(origImg, r);
// Call this function again, with the new aspect ratio image.
// Will do a scaled image resize with the correct aspect ratio.
outImg = resizeImage(croppedImg, newWidth, newHeight, false);
opencv_core.cvReleaseImage(croppedImg);
} else {
// Scale the image to the new dimensions,
// even if the aspect ratio will be changed.
outImg = opencv_core.cvCreateImage(
opencv_core.cvSize(newWidth, newHeight), origImg.depth(),
origImg.nChannels());
if (newWidth > origImg.width() && newHeight > origImg.height()) {
// Make the image larger
opencv_core.cvResetImageROI((IplImage) origImg);
// CV_INTER_LINEAR: good at enlarging.
// CV_INTER_CUBIC: good at enlarging.
cvResize(origImg, outImg, CV_INTER_LINEAR);
} else {
// Make the image smaller
opencv_core.cvResetImageROI((IplImage) origImg);
// CV_INTER_AREA: good at shrinking (decimation) only.
cvResize(origImg, outImg, CV_INTER_AREA);
}
}
return outImg;
}
// Returns a new image that is a cropped version (rectangular cut-out)
// of the original image.
IplImage cropImage(IplImage img, CvRect region) {
IplImage imageCropped;
opencv_core.CvSize size = new CvSize();
if (img.width() <= 0 || img.height() <= 0 || region.width() <= 0
|| region.height() <= 0) {
// cerr << "ERROR in cropImage(): invalid dimensions." << endl;
return null;
}
if (img.depth() != opencv_core.IPL_DEPTH_8U) {
// cerr << "ERROR in cropImage(): image depth is not 8." << endl;
return null;
}
// Set the desired region of interest.
opencv_core.cvSetImageROI((IplImage) img, region);
// Copy region of interest into a new iplImage and return it.
size.width(region.width());
size.height(region.height());
imageCropped = opencv_core.cvCreateImage(size,
opencv_core.IPL_DEPTH_8U, img.nChannels());
opencv_core.cvCopy(img, imageCropped); // Copy just the region.
return imageCropped;
}
public IplImage rotate(IplImage image, double angle) {
IplImage copy = opencv_core.cvCloneImage(image);
IplImage rotatedImage = opencv_core.cvCreateImage(
opencv_core.cvGetSize(copy), copy.depth(), copy.nChannels());
CvMat mapMatrix = opencv_core.cvCreateMat(2, 3, opencv_core.CV_32FC1);
// Define Mid Point
CvPoint2D32f centerPoint = new CvPoint2D32f();
centerPoint.x(copy.width() / 2);
centerPoint.y(copy.height() / 2);
// Get Rotational Matrix
opencv_imgproc.cv2DRotationMatrix(centerPoint, angle, 1.0, mapMatrix);
// Rotate the Image
opencv_imgproc.cvWarpAffine(copy, rotatedImage, mapMatrix,
opencv_imgproc.CV_INTER_CUBIC
+ opencv_imgproc.CV_WARP_FILL_OUTLIERS,
opencv_core.cvScalarAll(170));
opencv_core.cvReleaseImage(copy);
opencv_core.cvReleaseMat(mapMatrix);
return rotatedImage;
}I am rotating the video frame and then resizing the frame image.
The code was working fine 3 days ago but not suddenly it started messing up.
-
How to Convert 16:9 Video to 9:16 Ratio While Ensuring Speaker Presence in Frame ?
28 avril 2024, par shreeshaI am tried so many time to figure out the problem in detecting the face and also it's not so smooth enough to like other tools out there.


So basically I am using python and Yolo in this project but I want the person who is talking and who the ROI (region of interest) is.


Here is the code :


from ultralytics import YOLO
from ultralytics.engine.results import Results
from moviepy.editor import VideoFileClip, concatenate_videoclips
from moviepy.video.fx.crop import crop

# Load the YOLOv8 model
model = YOLO("yolov8n.pt")

# Load the input video
clip = VideoFileClip("short_test.mp4")

tacked_clips = []

for frame_no, frame in enumerate(clip.iter_frames()):
 # Process the frame
 results: list[Results] = model(frame)

 # Get the bounding box of the main object
 if results[0].boxes:
 objects = results[0].boxes
 main_obj = max(
 objects, key=lambda x: x.conf
 ) # Assuming the first detected object is the main one

 x1, y1, x2, y2 = [int(val) for val in main_obj.xyxy[0].tolist()]

 # Calculate the crop region based on the object's position and the target aspect ratio
 w, h = clip.size
 new_w = int(h * 9 / 16)
 new_h = h

 x_center = x2 - x1
 y_center = y2 - y1

 # Adjust x_center and y_center if they would cause the crop region to exceed the bounds
 if x_center + (new_w / 2) > w:
 x_center -= x_center + (new_w / 2) - w
 elif x_center - (new_w / 2) < 0:
 x_center += abs(x_center - (new_w / 2))

 if y_center + (new_h / 2) > h:
 y_center -= y_center + (new_h / 2) - h
 elif y_center - (new_h / 2) < 0:
 y_center += abs(y_center - (new_h / 2))

 # Create a subclip for the current frame
 start_time = frame_no / clip.fps
 end_time = (frame_no + 1) / clip.fps
 subclip = clip.subclip(start_time, end_time)

 # Apply cropping using MoviePy
 cropped_clip = crop(
 subclip, x_center=x_center, y_center=y_center, width=new_w, height=new_h
 )

 tacked_clips.append(cropped_clip)

reframed_clip = concatenate_videoclips(tacked_clips, method="compose")
reframed_clip.write_videofile("output_video.mp4")



So basically I want to fix the face detection with ROI detection where it can detect the face and make that face and the body on to the frame and making sure that the speaker who is speaking is brought to the frame


-
Batch .SRT Rip Using FFMPEG
12 mai 2020, par jaacI have this command using ffmpeg



root@ubuntu-4cpu-8gb-sg-sin1:/home/jaac/torrents/rtorrent/dots# ffmpeg -i Title.NF.WEB-DL.DDP2.0.x264-Ao.mkv -map 0:7 indo16.srt




That will rip 1 sub (Indonesia region)



How to rip it in batch ? I have 17 files in dots folder



Thanks