ffmpeg

How to trim video by multiple frame numbers then concatenate using FFMPEG

只愿长相守 提交于 2021-01-29 07:14:14
问题 Using following code, I'm able to trim video by time: ffmpeg -i input.mp4 -filter_complex \ "[0:v]trim=60:65,setpts=PTS-STARTPTS[v0]; \ [0:a]atrim=60:65,asetpts=PTS-STARTPTS[a0]; \ [0:v]trim=120:125,setpts=PTS-STARTPTS[v1]; [0:a]atrim=120:125,asetpts=PTS-STARTPTS[a1]; \ [v0][a0][v1][a1]concat=n=2:v=1:a=1[out]" \ -map "[out]" output.mp4 Above code trim video from 60-65 sec & 120-125sec then concatenate in output.mp4 file. Need to know how to trim video by using frame number and concatenate. Is

Need help to change working ffmpeg command to overlay instead of concatenate two audio files at specific position

余生长醉 提交于 2021-01-29 06:51:01
问题 By asking another question here, I got working code ffmpeg -i input.mp3 -i second.mp3 -filter_complex "[0:a]atrim=end=10,asetpts=N/SR/TB[begin];[0:a]atrim=start=10,asetpts=N/SR/TB[end];[begin][1:a][end]concat=n=3:v=0:a=1[a]" -map "[a]" output The code inserts second.mp3 into the input.mp3 at 10 seconds. But now I need to overlay second.mp3 into the input.mp3 starting at 10seconds. In other words I need playing input.mp3 and after 10 seconds I need start playing second.mp3 simultaneously. The

Mac build ffmpeg for Android

我怕爱的太早我们不能终老 提交于 2021-01-29 05:58:11
问题 I want to compile ffmpeg on my Mac. The ndk version is r19c and the FFmpeg version is 4.1.3. The build script is copied from this article. But there are some problems when compiling, as follows: Thanks!!! 回答1: Starting with NDK r19 everything you need can be found in the <NDK>/toolchains/llvm/prebuilt/<host> directory. Stripped down example for arm64-v8a targeting API 28: export ANDROID_NDK_ROOT=/path/to/android-ndk-r19c export PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/darwin-x86_64/bin

Dump subtitle from AVSubtitle in the file

扶醉桌前 提交于 2021-01-29 05:15:59
问题 In FFMPEG sofftware, AVPicture is used to store image data using data pointer and linesizes.It means all subtitles are stored in the form of picture inside ffmpeg. Now I have DVB subtitle and I want to dump picture of subtitles stored in AVPicture in a buffer. I know these images subtitles can be dump using for, fopen and sprintf. But do not know how to dump Subtitle.I have to dump subtitles in .ppm file format. Can anyone help me to dump picture of subtitles in buffer from AVSubtitle . 回答1:

Wired Out of memory: Java heap space error with ffmpeg library

穿精又带淫゛_ 提交于 2021-01-29 05:11:01
问题 Well this is the error I get: Out of memory: Java heap space. Please assign more memory to Gradle in the project's gradle.properties file. For example, the following line, in the gradle.properties file, sets the maximum Java heap size to 1,024 MB: <em>org.gradle.jvmargs=-Xmx1024m</em> and it is because of: implementation 'nl.bravobit:android-ffmpeg:1.1.7' when I remove that the error gets gone.Well the error is saying increase the heap size to 1024MB and I did increase it to 10GB it's not

Wired Out of memory: Java heap space error with ffmpeg library

拥有回忆 提交于 2021-01-29 05:08:52
问题 Well this is the error I get: Out of memory: Java heap space. Please assign more memory to Gradle in the project's gradle.properties file. For example, the following line, in the gradle.properties file, sets the maximum Java heap size to 1,024 MB: <em>org.gradle.jvmargs=-Xmx1024m</em> and it is because of: implementation 'nl.bravobit:android-ffmpeg:1.1.7' when I remove that the error gets gone.Well the error is saying increase the heap size to 1024MB and I did increase it to 10GB it's not

what does -crf mean in ffmpeg resize video file command?

人盡茶涼 提交于 2021-01-29 05:02:21
问题 Could someone explain what -crf means in the following command: ffmpeg -i input.mp4 -c:v libx264 -crf 65 -b:v 1M -c:a aac output.mp4 What does -crf stand for? 回答1: CRF (Constant Rate Factor) is the default quality setting for the x264 and x265 encoders. You can set the values between 0 and 51 , where : lower values would result in better quality, at the expense of higher file sizes. Higher values mean more compression, but at some point, you will notice the quality degradation. You can also

Add black video to video with sound

烂漫一生 提交于 2021-01-29 03:39:52
问题 I'm trying to insert 13 seconds of black video at the start of a video that has sound using ffmpeg like so: ffmpeg -f lavfi -i "color=c=black:s=720x406:r=25:sar=1/1" -i input.mp4 -filter_complex \ "[0:v] trim=end=13,setpts=PTS-STARTPTS [blackstart]; \ [blackstart] [1:v] concat=n=2:v=1:a=0[out]" \ -map "[out]" -c:a copy output.mp4 However the sound is not being maintained. What am I doing incorrectly? -c:a copy does not seem to work should I be using a [1:a] somewhere? garrett-retina:~ garrett

Simple FFMpeg player for Android

纵然是瞬间 提交于 2021-01-29 03:32:42
问题 I have a problem with the output of AVFrame (AVPicture) into the ANativeWindow. I wrote simpe test code: void *Player::readThread(void * reserved) { ALOGD("Read thread started!"); VideoState *state = (VideoState *) reserved; int err = 0; int ret; int i; AVFormatContext *formatContext = NULL; AVCodecContext *codecContext = NULL; AVCodecParameters *codecParams = NULL; AVCodecID codecID = AV_CODEC_ID_NONE; AVCodec *decoder = NULL; AVFrame *frame = NULL; AVFrame *frameRGBA = NULL; AVPacket packet

ffmpeg and dvb subtitles scaling

你离开我真会死。 提交于 2021-01-29 03:17:36
问题 I try to hardcode the dvb subtitle in the video. I managed to hardcode it but it is still misplaced. The reason for this is that the subtitle is on SD resolution 720x576 while the video is 1920x1080. So when I use overlay the subtitle is is misplaced and on the left corner. this is my command: ffmpeg -canvas_size 1280x720 -y -probesize 5000000 -analyzeduration 5000000 -i http://192.168.2.9:8001 -filter_complex "[0:s]scale=1280:720[sub],[0:v]scale=1280:720,yadif=1[vid];[vid][sub]overlay[all]"