Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Splicing one audio stream into multiple video streams ?
13 décembre 2013, par KevinSo here is my scenario. I am getting about 8 video only MP4s with different aspect ratios with no audio and I have an aac audio stream I want to add/splice to each of the video MP4. Is there I can add this audio stream to all 8 video streams and create an output for each of the videos in one command.
I have this command which works for one video and audio stream:
ffmpeg -i sample_512x288.mp4 -i AAC_128k_audio_track.aac -map 0 -map1 -codec copy -bsf aac_adtstoasc -someoutput
Is this possible?
-
ffmpeg uses all images in a folder even with a -start_number argument
13 décembre 2013, par kingdsI'm having trouble compiling a set of jpeg files in a directory into an mp4 file. The command I'm using is:
./ffmpeg -y -r 20 -i %03d-capture.jpg -pix_fmt yuv420p -c:v libx264 -start_number 10000 video.mp4
The folder contains around 20,000 images, and I want a video that starts on the 10,000th image. However, with this command ffmpeg creates a video using all the images in the directory. Is there any reason it would be ignoring the start_number argument?
edit: Figured it out. The -start_number argument needs to come before the -i argument for the input file. Seems a little silly.
-
killing infinite ffmpeg command from app
13 décembre 2013, par bhupinderI am using
ffmpeg.exe -f dshow -i audio=virtual-audio-capturer -q 4 -y -tune zerolatency outfile.mp3
to grap sound from speakers. this command runs infinitely. I have to use
Process->kill();
command to stop execution of this command in my app.
I Want to know is it safe to kill it the way I am killing or any another way you guys suggest.
any help appreciated
thanks
-
How to solve this situation about ffmpeg with Android NDK
13 décembre 2013, par Terry-LiuI used Android NDK to Compile ffmpeg ,when I run config.sh,so many erros happened,how to solve it.
Terry-L@Terry-L-HP /cygdrive/e/Android/android-ndk-r8d/samples/FFmpeg/jni/ffmpeg $ ./config.sh Unknown option "". See ./configure --help for available options. ./config.sh: line 6: --target-os=linux: command not found ./config.sh: line 7: --arch=arm: command not found ./config.sh: line 8: --enable-version3: command not found ./config.sh: line 9: --enable-gpl: command not found ./config.sh: line 10: --enable-nonfree: command not found ./config.sh: line 11: --disable-stripping: command not found ./config.sh: line 12: --disable-ffmpeg: command not found ./config.sh: line 13: --disable-ffplay: command not found ./config.sh: line 14: --disable-ffserver: command not found ./config.sh: line 15: --disable-ffprobe: command not found ./config.sh: line 16: --disable-encoders: command not found ./config.sh: line 17: --disable-muxers: command not found ./config.sh: line 18: --disable-devices: command not found ./config.sh: line 19: --disable-protocols: command not found ./config.sh: line 20: --enable-protocol=file: command not found ./config.sh: line 21: --enable-avfilter: command not found ./config.sh: line 22: --disable-network: command not found ./config.sh: line 23: --disable-mpegaudio-hp: command not found ./config.sh: line 24: --disable-avdevice: command not found ./config.sh: line 25: --enable-cross-compile: command not found ./config.sh: line 26: --cc=/cygdrive/e/Android/android-ndk-r8d/toolchains/arm-li nux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-gcc: No such file or directory ./config.sh: line 27: --cross-prefix=/cygdrive/e/Android/android-ndk-r8d/toolcha ins/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-: No su ch file or directory ./config.sh: line 28: --nm=/cygdrive/e/Android/android-ndk-r8d/toolchains/arm-li nux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-nm: No such file or directory ./config.sh: line 29: --extra-cflags=-fPIC -DANDROID: command not found ./config.sh: line 30: --disable-asm: command not found ./config.sh: line 31: --enable-neon: command not found ./config.sh: line 32: --enable-armv5te: command not found ./config.sh: line 33: --extra-ldflags=-Wl,-T,/cygdrive/e/Android/android-ndk-r8d
/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/arm-linux-androideabi/lib /ldscripts/armelf_linux_eabi.x -Wl,-rpath-link=/cygdrive/e/Android/android-ndk-r 8d/platforms/android-14/arch-arm/usr/lib -L/cygdrive/e/Android/android-ndk-r8d/p latforms/android-14/arch-arm/usr/lib -nostdlib /cygdrive/e/Android/android-ndk-r 8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/lib/gcc/arm-linux-andro ideabi/4.6/crtbegin.o /cygdrive/e/Android/android-ndk-r8d/toolchains/arm-linux-a ndroideabi-4.6/prebuilt/windows/lib/gcc/arm-linux-androideabi/4.6/crtend.o -lc - lm -ldl: No such file or directory
-
Is packet duration guaranteed to be uniform for entire stream ?
13 décembre 2013, par karl_I use packet duration to translate from frame index to pts and back, and I'd like to be sure that this is a reliable method of doing so.
Alternatively, is there a better way to translate pts to a frame index and vice versa?
A snippet showing my usage:
bool seekFrame(int64_t frame) { if(frame > container.frameCount) frame = container.frameCount; // Seek to a frame behind the desired frame because nextFrame() will also increment the frame index int64_t seek = pts_cache[frame-1]; // pts_cache is an array of all frame pts values // get the nearest prior keyframe int preceedingKeyframe = av_index_search_timestamp(container.video_st, seek, AVSEEK_FLAG_BACKWARD); // here's where I'm worried that packetDuration isn't a reliable method of translating frame index to // pts value int64_t nearestKeyframePts = preceedingKeyframe * container.packetDuration; avcodec_flush_buffers(container.pCodecCtx); int ret = av_seek_frame(container.pFormatCtx, container.videoStreamIndex, nearestKeyframePts, AVSEEK_FLAG_ANY); if(ret < 0) return false; container.lastPts = nearestKeyframePts; AVFrame *pFrame = NULL; while(nextFrame(pFrame, NULL) && container.lastPts < seek) { ; } container.currentFrame = frame-1; av_free(pFrame); return true; }