Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Contrast normalization of several videos with ffmpeg
4 octobre 2016, par Alan_AII have some video sequences that I need to concatenate, some of them have bad contrast (so dark) and some are just fine. What is the best method to automatically normalize contrast levels among of these videos automatically without manual tweaking? Preferably using the ffmpeg script
Thank you
-
FFMPEG Command to add text to a image
4 octobre 2016, par PabaI need to create a video with a set of images and I successfully did this with ffmpeg. now i need a way to add credits to the singer and video creator. This is part of the work involved in the video creation tool im implementing. Can someone tell me how to add text to an image with ffmpeg.
Thanks in advance.
-
FFMPEG - Merge mp4 files and audio file
4 octobre 2016, par Jon StevensI have an ffmpeg that merges 3 mp4 videos and then another command that adds audio to the output file from the first command. The commands are as follows:
ffmpeg -i vid-1.mp4 -i vid-2.mp4 -i vid-3.mp4 -filter_complex "[0:v][1:v][2:v]concat=n=3:v=1" -preset ultrafast -crf 1 output.mp4 ffmpeg -i output.mp4 -i audio.mp3 -preset ultrafast -crf 1 final.mp4
- vid-1.mp4 (does NOT have audio stream)
- vid-2.mp4 (does NOT have audio stream)
Is there anyway to do this in one command? I would like to also add the audio to the video that is getting created in the first command. Is this possible?
Console output of "ffmpeg -i vid-1.mp4 -i vid-2.mp4 -i vid-3.mp4 -i audio.mp3"
[jstevens@jr testing]$ ffmpeg -i vid-1.mp4 -i vid-2.mp4 -i vid-3.mp4 -i audio.mp3 ffmpeg version 3.0.2 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 6.1.1 (GCC) 20160510 (Red Hat 6.1.1-2) configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-frei0r --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect libavutil 55. 17.103 / 55. 17.103 libavcodec 57. 24.102 / 57. 24.102 libavformat 57. 25.100 / 57. 25.100 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 31.100 / 6. 31.100 libavresample 3. 0. 0 / 3. 0. 0 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'vid-1.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf56.25.101 Duration: 00:00:05.00, start: 0.000000, bitrate: 1085 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1081 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default) Metadata: handler_name : VideoHandler Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'vid-2.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf56.25.101 Duration: 00:00:05.00, start: 0.000000, bitrate: 1018 kb/s Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1014 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default) Metadata: handler_name : VideoHandler Input #2, mov,mp4,m4a,3gp,3g2,mj2, from 'vid-3.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf56.25.101 Duration: 00:00:05.00, start: 0.000000, bitrate: 823 kb/s Stream #2:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 819 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default) Metadata: handler_name : VideoHandler [mp3 @ 0x1ca30c0] Skipping 0 bytes of junk at 0. [mp3 @ 0x1ca30c0] Estimating duration from bitrate, this may be inaccurate Input #3, mp3, from 'audio.mp3': Duration: 00:00:19.57, start: 0.000000, bitrate: 64 kb/s Stream #3:0: Audio: mp3, 44100 Hz, mono, s16p, 64 kb/s At least one output file must be specified
-
Converting h263 to h264 in iOS
4 octobre 2016, par user1599477I am downloading a video with h263 codec and 3gp container on an iOS application. iOS cannot play h263 videos so the solution is to convert it to h264. Can I do that with AV Foundation? Or I have to use FFMPEG to do that?
Thanks for your help.
-
Strange "pause" in video after concatenation of two mp4 videos
3 octobre 2016, par user606521I am concatenating two mp4 videos. The problem is that first video (intro.mp4) lasts 5 seconds, second video (output.mp4) lasts 2 seconds and video created by concatenating them lasts 9 seconds (and should last 5+2 = 7 seconds). In final.mp4 video the last frame from first video (intro.mp4) i shown for additional 2 seconds before second video (output.mp4) is played. It looks like a lag when watching video. What I am doing wrong?
list.txt:
file 'data/intro.mp4' file 'output.mp4'
command:
./bin/ffmpeg -f concat -i list.txt -c copy final.mp4
output:
ffmpeg version 2.7.2 Copyright (c) 2000-2015 the FFmpeg developers built with llvm-gcc 4.2.1 (LLVM build 2336.11.00) configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-libgsm --enable-libvidstab --enable-libx265 --disable-doc --arch=x86_64 --enable-runtime-cpudetect libavutil 54. 27.100 / 54. 27.100 libavcodec 56. 41.100 / 56. 41.100 libavformat 56. 36.100 / 56. 36.100 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 16.101 / 5. 16.101 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 2.100 / 1. 2.100 libpostproc 53. 3.100 / 53. 3.100 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f8a6a80e600] Auto-inserting h264_mp4toannexb bitstream filter Input #0, concat, from 'list.txt': Duration: N/A, start: 0.000000, bitrate: 1296 kb/s Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x540, 1163 kb/s, 23.98 fps, 23.98 tbr, 11988 tbn, 47.95 tbc Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 133 kb/s [mp4 @ 0x7f8a6c006a00] Codec for stream 0 does not use global headers but container format requires global headers [mp4 @ 0x7f8a6c006a00] Codec for stream 1 does not use global headers but container format requires global headers Output #0, mp4, to 'final.mp4': Metadata: encoder : Lavf56.36.100 Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 960x540, q=2-31, 1163 kb/s, 23.98 fps, 23.98 tbr, 11988 tbn, 11988 tbc Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 133 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f8a6a80e600] Auto-inserting h264_mp4toannexb bitstream filter frame= 258 fps=0.0 q=-1.0 Lsize= 997kB time=00:00:09.84 bitrate= 829.5kbits/s video:897kB audio:93kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.634306%