
Recherche avancée
Autres articles (62)
-
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 -
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
Sur d’autres sites (6744)
-
FFmpeg Zoom and Rotate Causes Image Cropping Instead of Allowing It to Go Beyond Frame Edges [closed]
6 octobre 2024, par XVersiI am trying to create a zoom-in video with a gentle rotation effect using FFmpeg. My goal is to zoom in on the center of the image while allowing parts of the image to "go beyond" the frame boundaries during the zoom and rotation. However, what I see is that FFmpeg seems to crop the image to fit within the output frame, and instead of keeping the full image intact, it fills the rest of the frame with black sections, effectively trimming parts of my image.


Here is the code I'm using in Go to generate the video using FFmpeg :


func createZoomInVideoWithRotation(ffmpegPath, imagePath, outputPath string) error {
cmd := exec.Command(ffmpegPath, "-i", imagePath, "-vf", `[0:v]scale=9000x5000,zoompan=z='min(zoom+0.002,1.5)':x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)':d=125,rotate='PI/800*t',trim=duration=20[v1];[v1]scale=1080:1920[v]`, "-c:v", "libx264", "-crf", "18", "-preset", "slow", outputPath)
err := cmd.Run()
if err != nil {
 return fmt.Errorf("error executing ffmpeg command: %w", err)
}

fmt.Println("Zoom-in and rotation video created successfully!")
return nil
}

func main() {
 ffmpegPath := `C:\Users\username\Downloads\ffmpeg-7.0.2-essentials_build\ffmpeg-7.0.2-essentials_build\bin\ffmpeg.exe`
 imagePath := `C:\Users\username\video_proj\image.jpg` 
 outputPath := `C:\Users\username\video_proj\output_zoom_rotate.mp4`



err := createZoomInVideoWithRotation(ffmpegPath, imagePath, outputPath)
if err != nil {
 fmt.Println("Error creating zoom and rotate video:", err)
}
}



Removing the final scale=1080:1920 : I removed the scale part at the end of the filter chain to prevent FFmpeg from resizing the video to a fixed size, hoping that this would allow the image to remain at its original size without being cropped to fit the frame.


The image would zoom in on its center and rotate, and during this process, parts of the image would be allowed to move beyond the boundaries of the video output frame.
There would be no cropping or resizing of the image, meaning the full original image would be intact even if it extends beyond the video frame.
Essentially, I wanted the image to "overflow" outside of the set dimensions during the rotation, without being forced to fit within the output frame and without adding black borders that indicate missing parts of the image.


-
Video buffering/streaming with node-fluent-ffmpeg
24 février 2018, par SaliesI want to turn AC3-audio videos playable on browsers. For this, I decided to use fluent-ffmpeg to real-time convert the videos and stream them. It works as livestreaming/piping pretty well, but you can’t even go back in the videos.
app.get('/video', function (req, res) {
var path = 'show.mkv';
ffmpeg(path)
.outputOptions(arr)
.on('end', function () {
console.log('file has been converted succesfully');
})
.on('error', function (err) {
console.log('an error happened: ' + err.message);
})
.pipe(res);
});So I need to build a sort of buffer for the conversion, this is, to let the user go back and forth in the video. I’ve found some code that does exactly what I need, although it doesn’t convert :
app.get('/video', function(req, res) {
const path = 'assets/sample.mp4'
const stat = fs.statSync(path)
const fileSize = stat.size
const range = req.headers.range
if (range) {
const parts = range.replace(/bytes=/, "").split("-")
const start = parseInt(parts[0], 10)
const end = parts[1]
? parseInt(parts[1], 10)
: fileSize-1
const chunksize = (end-start)+1
const file = fs.createReadStream(path, {start, end})
const head = {
'Content-Range': `bytes ${start}-${end}/${fileSize}`,
'Accept-Ranges': 'bytes',
'Content-Length': chunksize,
'Content-Type': 'video/mp4',
}
res.writeHead(206, head)
file.pipe(res)
} else {
const head = {
'Content-Length': fileSize,
'Content-Type': 'video/mp4',
}
res.writeHead(200, head)
fs.createReadStream(path).pipe(res)
}
})(from https://github.com/daspinola/video-stream-sample)
I’ve been trying to make fluent-ffmpeg work with buffering, with no success, and I pretty much have no clue on what to do. If buffering isn’t possible, is there an similar alternative excpect for pre-converting the videos ? Thanks already.
-
FFMPEG merge two files cause the video to freeze at the end of the first part
17 janvier 2015, par AnasI am using FFMPEG to cut and merge video file, these are my commands :
//split the video to three partsffmpeg -i "input.mkv" -ss 00:00:00 -to 00:04:00 -c copy -map 0 -y out0.mkv
ffmpeg -i "input.mkv" -ss 00:05:00 -to 00:22:00 -c copy -map 0 -y out1.mkv
ffmpeg -i "input.mkv" -ss 00:23:00 -c copy -map 0 -y out2.mkv//merge these parts in one video again
ffmpeg -f concat -i mylist.txt -c copy -y output.mkv
//mylist.txt contains :
file out0.mkv
file out1.mkv
file out2.mkvAnd everything works fine, except that the new merged video freeze for 5 seconds at the end of the first merged part, in the above example at sec 04:00 the screen pauses for 5 seconds and then the video continue.
Do you know why this is happening ? is there a work around please help.