ffmpeg

Can you insert text from a file in real time with ffmpeg streaming?

雨燕双飞 提交于 2021-02-05 07:49:07
问题 I have this code i use to stream a file and place the name of the show of the video at a certain time of the video ( name_of_show ) at the top of the screen, and the bottom of the screen it take the name of the show from video_title.txt and places it on the bottom of the screen. What I want to do is find a way at a interval say 1 or 2 minutes, pull whatever text is currently in video_title.txt and place it in the video for a few seconds. I would update video_title.txt from another python

How do I capture all keyframes and scale down to 320px wide?

三世轮回 提交于 2021-02-05 06:50:13
问题 I'm trying to use ffmpeg to output all key-frames from a video file and scale them down to 320px wide while maintaining aspect ratio. I know I could do this with two separate commands but I am trying to find a way to do it tidily in one. I've already succeeded in each of the steps individually using the following commands. Output the keyframes: .\ffmpeg -i input.mp4 -q:v 2 -vf select="eq(pict_type\,PICT_TYPE_I)" -vsync 0 thumb%07d.png Scale images: .\ffmpeg -i input.mp4 -vf scale=320:-1 thumb

How to make .avi, .mp4 file with jpeg frames?

痴心易碎 提交于 2021-02-05 06:43:11
问题 I'm working with IP camera, and I have got Jpeg frames and audio data (PCM) from camera. Now, I want to create video file (both audio and video) under .avi or .mp4 format from above data. I searched and I knew that ffmpeg library can do it. But I don't know how to using ffmpeg to do this. Can you suggest me some sample code or the function of ffmpeg to do it? 回答1: If your objective is to write a c++ app to do this for you please disregard this answer, I'll just leave it here for future

PHP Exec (ffmpeg) fails on IIS every other request

£可爱£侵袭症+ 提交于 2021-02-04 21:51:22
问题 <?PHP exec("ffmpeg.exe -i something.mp4 -ss 1 -t 1 -r 1 -s 320x240 -y something.jpg"); ?> Calling this script results in a server error 500 every other request . PHP 7.01, IIS 10. I have already ruled out that the problem might be related to the specific ffmpeg paramters of my call. The execution is < than 1 second, so it can't be a PHP or IIS script execution timeout. No matter how much time passes between one "call" to the script and the next, the odd numbered calls result in error 500, the

PHP Exec (ffmpeg) fails on IIS every other request

天涯浪子 提交于 2021-02-04 21:50:22
问题 <?PHP exec("ffmpeg.exe -i something.mp4 -ss 1 -t 1 -r 1 -s 320x240 -y something.jpg"); ?> Calling this script results in a server error 500 every other request . PHP 7.01, IIS 10. I have already ruled out that the problem might be related to the specific ffmpeg paramters of my call. The execution is < than 1 second, so it can't be a PHP or IIS script execution timeout. No matter how much time passes between one "call" to the script and the next, the odd numbered calls result in error 500, the

How to add multiple audio files at specific times, on a silence audio file using ffmpeg?

丶灬走出姿态 提交于 2021-02-04 21:33:57
问题 I need to overlay audio files at specific times, on an existing silence.mp3. Something like that: [----[...audio1...]----------[...audio2...]---------------] I've tried the following but it doesn't work: ffmpeg -y -i silence.mp3 -itsoffset 4 -i audio1.mp3 -itsoffset 30 -i audio2.mp3 -c:a copy final.mp3 Any help would be appriciated. Thank you. 回答1: There are several methods. adelay, amix Use the adelay and amix filters: ffmpeg -i audio1.mp3 -i audio2.mp3 -filter_complex "[0]adelay=4s:all=1[0a

How to add multiple audio files at specific times, on a silence audio file using ffmpeg?

流过昼夜 提交于 2021-02-04 21:33:34
问题 I need to overlay audio files at specific times, on an existing silence.mp3. Something like that: [----[...audio1...]----------[...audio2...]---------------] I've tried the following but it doesn't work: ffmpeg -y -i silence.mp3 -itsoffset 4 -i audio1.mp3 -itsoffset 30 -i audio2.mp3 -c:a copy final.mp3 Any help would be appriciated. Thank you. 回答1: There are several methods. adelay, amix Use the adelay and amix filters: ffmpeg -i audio1.mp3 -i audio2.mp3 -filter_complex "[0]adelay=4s:all=1[0a

How to Convert PNG Transparent Background to JPG White Background?

核能气质少年 提交于 2021-02-04 21:18:09
问题 I'm converting a PNG to JPG. The transparent background turns black by default. I need it to be white. What is the FFmpeg command to set the alpha channel to a color? I think it has something to do with the alphamerge and alphaextract Filters. ffmpeg -i image.png -qscale:v 2 image.jpg This replaces white with transparency when converting to png: -vf chromakey=white 回答1: You can use the geq filter. ffmpeg -i in.png -vf format=yuva444p,geq='if(lte(alpha(X,Y),16),255,p(X,Y))':'if(lte(alpha(X,Y)

How can I tell if a video file is corrupted? FFmpeg?

烂漫一生 提交于 2021-02-04 19:40:28
问题 I am trying to find out if a video file is corrupted or not. I am using FFmpeg to transcode a video file. However, when it gets to a file that not playable and is damaged, it stops running. I want to know if there is a way to output the FFmpeg command into a text file and then be able to tell which file is corrupted from the text file. When I run FFmpeg on one of the corrupted vide, I find this information. built with gcc 9.1.1 (GCC) 20190807 configuration: --enable-gpl --enable-version3 -

FFMPEG Crop with side by side merge

我只是一个虾纸丫 提交于 2021-02-04 15:59:05
问题 I am trying to create a shell/ffmpeg script that can show multiple files after they have been processed using different filters in a side by side / tiled way. An example of desired output would be: https://www.youtube.com/watch?v=DoPuhMRYem4. In order to create the desired output I need to crop off the right half of video1 and the left half of video2 and then join them back with [video1+video2] side by side. I have played around with a bunch of different ways of joining them, this does OK: