Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
How to change video speed by ffmpeg ?
17 mai 2019, par Pooja JadavI'm using ffmpeg for video filter.
But, When I changed video speed, that time I got issue
Audio is longer than video :
ffmpeg -i INPUT.mp4 -filter:v setpts=0.5*PTS -shortest -y -preset ultrafast OUTPUT.mp4
I want to set audio's length same as video's length.
- shortest = to extend audio streams to the same length as the video stream
In my case,
shortest
is not working. Video file and audio file, both are different and then after merging in a video file. Video's last frame stop and audio is continued working. -
copy processed mp3 files from one directory to another directory in php
17 mai 2019, par flashI am working on a php code as shown below which is converting mp4 files into mp3 using ffmpeg. After conversion, everything goes into outgoing_folder.
<?php const DS = '/'; $src_dir = 'incoming_folder'; /* Place where mp4 file is present */ $destination = 'outgoing_folder'; /* Place where mp3 files come after conversion from mp4 */ $mp3_processed = 'podcast_mp3_processed'; /* Place where I also want mp3 files */ foreach ($mp4_files as $f) { $parts = pathinfo($f); switch ($parts['extension']) { case 'mp4' : $filePath = $src_dir . DS . $f; system('ffmpeg -i ' . $filePath . ' -map 0:2 -ac 1 ' . $destination . DS . $parts['filename'] . '.mp3', $result); /** Place where mp3 file goes after conversion from mp4 **/ if ($result) { // Do something with result if you want // log for example } break; case 'mp3' : // copy($f, $destination. DS . $parts['filename']. '.' . $parts['extension']); copy($f, $destination . DS . $parts['filename'] . '.mp3'); copy('outgoing_folder', 'podcast_mp3_processed'); /* Line #A */ break; } } ?>
Problem Statement:
I am wondering what changes I need to make in the php code above so that when all mp4 files have been converted to mp3 then it should also go to podcast_mp3_processed folder.
At this moment it is going outgoing_folder but I also want it to go to podcast_mp3_processed folder. I tried with the code at Line#A but it doesn't seem to work.
-
How to pass output of ffmpeg child process to next reader of the stream ?
17 mai 2019, par Chrisl446This function receives a duplex stream that I want to manipulate then send out to the next function that reads from it (not shown for simplicity). I tried using duplexify for this but it kept throwing me an EPIPE error because stdout was closing before stdin.
const path = ffmpeg; const args = [ '-y','-i pipe:0','-vframes 1','-ss 00:00:00','-vf scale=250:-1','-f singlejpeg pipe:1' ]; //Recieves Duplex Stream that ffmpeg process uses via pipe:0 function ffmpegExecute(path, args) { const ffmpeg = spawn(path, args, { shell: true }) //WANT TO READ FROM FFMPEGS OUTPUT HERE //AND CONTINUING PIPING IT ALONG TO NEXT READER OF STREAM }
-
ffmpeg - Creating slideshow from different image types
17 mai 2019, par Alexandru AntochiI'm trying to create a slideshow with 50 images, but I get these errors on some of them. All of the images have
.jpg
extension, but the ones failing were.png
and I changed the extensionffmpeg.exe -r 1/5 -i %02d.jpg -vf "scale=-1:720,pad=1280:ih:(ow-iw)/2" -y -an out.mp4
The images open in any image viewer but it seems that ffmpeg fails to read them if they have the
.jpeg
extension. Any way to keep the original image extension and add it to the slideshow? -
How to have avbin.dll in a local directory (not C :\Windows\System) (for pyglet 1.2.4)
16 mai 2019, par DootUsing pyglet 1.2.4, I am using avbin.dll to allow me to play audio and all sources say it needs to go into C:\Windows\System. This works, but I would like to put in in a local folder, so that when it is downloaded, the user does not need to explicitly put it there.
How can I make it so that I specify the directory of avbin.dll/have in the same folder as the code?
Here, avbin.dll is in the folder with the code, but I can't find how they did it. https://github.com/surajsinghbisht054/Python-Media-Player/tree/master/Python%20Media%20Player%20Version%200.0.1/Tools I tried going through it but I didn't find anything
I tried
pyglet.options["search_local_libs"]
but it was already set to true.
I also added it to the path variable, but this didn't change anything.
The intention was to be able to play audio files.
Additionally: Using pyglet 1.4, I tried using
ffmpeg
andffmpeg-pyglet
, which works great, except thatpyglet.app.run()
is required to stop the first part of the track playing on repeat, but its mainloop interferes with tkinter's and I can't seem to get either working in threads, which is why I reverted back to 1.2.4.