ffmpeg

How do I limit resources for ffmpeg, called from a python-script, running in a docker container?

…衆ロ難τιáo~ 提交于 2021-01-28 11:44:48
问题 I deployed a service, that periodically does video encoding on my server; And every time it does, all other services slow down significantly. The encoding is hidden under multiple layers of abstraction. Limiting any of those layers would be fine. (e.g. limiting the docker-container would work just as well as limiting the ffmpeg-sub process.) My Stack: VPS (ubuntu:zesty) docker-compose docker-container (ubuntu:zesty) python ffmpeg (via subprocess.check_call() in python) What I want to limit:

Using hex colors with ffmpeg's showwaves

99封情书 提交于 2021-01-28 10:42:07
问题 I've been trying to create a video with ffmpeg's showwaves filter and have cobbled together the below command which I sort of understand. I'm wondering if it is possible to set the color of the wav form using hex colors. (i.e. #F3ECDA instead of "blue") Also, feel free to tell me if there's any unneeded garbage in the command as is. Thanks. ffmpeg -i audio.mp3 -loop 1 -i picture.jpg -filter_complex \ "[0:a]showwaves=s=960x202:mode=cline:colors=blue[fg]; \ [1:v]scale=960:-1,crop=iw:540[bg]; \

Is it possible to have a progress bar without a loop?

本秂侑毒 提交于 2021-01-28 10:10:13
问题 I am using FFmpeg to do some video editing. I would like to have a progress bar but there is not a loop in my code. I've tried tqdm and putting my code in a loop with a range of 1 but that will only display the progress bar at 100%. Maybe there is another way to accomplish this? This is the code I'm using: import subprocess inmovie=mymovie.mp4 speed=str(4.0) outmovie=newmovie.mp4 print('Converting file.......') subprocess.call('ffmpeg -i '+inmovie+' -filter:v "setpts= '+speed+' *PTS" '

Use FFMPEG to export audios with gaps filled

偶尔善良 提交于 2021-01-28 10:01:02
问题 I have a MKV file with gaps in the audio. That is, there are gaps in the MKV audio track timestamps. According to "ffmpeg", the AC3 audio length is 802 seconds, but when exporting the audio to WAV, the resulting file length is 801'53 seconds. That is, the "exported" audio is shorter. Triaging the issue with ffmpeg -i INPUT.mkv -af ashowinfo -map 0:2 -y -frames:a XXXX -f alaw /dev/null I can confirm that the length difference is consistent with gaps in the timestamps of the original audio

How to create a video from frames named using timestamp with ffmpeg

a 夏天 提交于 2021-01-28 08:22:11
问题 I have a folder filled with frames that have the timestamp in the name in the folowing format im_%H_%M_%S_%MS.png im_08_05_09_007324.png im_08_05_09_532857.png im_08_05_10_059340.png im_08_05_10_575862.png im_08_05_11_118361.png im_08_05_11_596814.png im_08_05_12_148340.png im_08_05_12_665838.png I try to use -pattern_type glob in windows but it does not work. ffmpeg.exe -framerate 10 -pattern_type glob -i im_*.png -c:v libx264 -r 30 -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -pix_fmt yuv420p

FFMpeg command to convert from avi to mp4 in php script

浪尽此生 提交于 2021-01-28 08:05:31
问题 ffmpeg command to convert from avi file to mp4 file below does create mp4 file, but the quality of it is not all right at all. Fist, the sizes of the files are different, the mp4 is much smaller and about 1/10 of the avi file. Second, the playing time of the newly created mp4 is short lasting about 0.1 seconds where the avi file lasts about 60 seconds. Can anyone please help me out for the ffmpeg command to create mp4 file from avi under the directory like below? for i in /xxxxxxx/xxxxxxx/*

Is it possible to encrypt mpeg-dash clear content in ffmpeg?

大城市里の小女人 提交于 2021-01-28 07:20:49
问题 Is it possible to encrypt mpeg-dash clear content in ffmpeg? or do we need to additional code to handle the encryption? From ffmpeg dashenc.c code it appears that dash code does not encrypt the content. Can we reuse the mp4 muxer for encrypting and dash for segmenting? 回答1: You can use ffmpeg and openssl to create an AES encrypted HLS stream if this meets your needs - the ffmpeg documentation (http://ffmpeg.org/ffmpeg-all.html#Options-34) includes this example script: #!/bin/sh BASE_URL=${1:-

ffmpeg.exe freezes

随声附和 提交于 2021-01-28 07:11:40
问题 I'm using Asp.Net C# Framework 4 and currently developing a video conversion application. I'm also using ffmpeg to convert from all uploaded formats to flv. I'm first converting uploaded file to mpg and after to flv due to problems I encountered while trying conversion directly to flv from mp4 sometimes. But ffmpeg freezes as soon as it's done with conversion process to mpg file. When I run task manager and check the processes list, it just stands there using no CPU resource. When I end the

Ffmpeg returning error code 1 in AWS Lamda function

浪尽此生 提交于 2021-01-28 06:53:15
问题 I'm running a lambda function which takes an mp4 video, and adds a watermark of a png image over the top of it in the bottom right hand corner (with a 10px margin). It then outputs that image to a temporary location. It keeps failing with Error code 1 , but that isn't very helpful. I'm using a binary version of ffmpeg that is specified in the main directory of the code. I know that ffmpeg is set up correctly due to using it in another lambda function in this way, which works. But adding an

How to specify the noise floor in FFmpeg's acompressor filter

末鹿安然 提交于 2021-01-28 06:33:18
问题 I've always used Audacity's Dynamic Range Compressor if I wanted to crank up the volume of an audio file. Today I was looking at whether I could do the same with FFmpeg's acompressor filter. I've found "how to user "compressor" with ffmpeg" and Gyan's answer, which was really helpful, but not satisfying enough. Right now I'm actually trying to mimic Audacity's procedure. If I understand the acompressor correctly, then I can't apply the makeup gain in one pass. So I need to do a volumedetect