[FFmpeg-user] Help with concat and overlay
Hello all, I am working on a command that concats two videos from my camera, and then overlays another video on top of the concatonated video. It is mostly working, but the timing isn't right. For sake of argument, let's say that MVI_0001.MOV is 5 min, and MVI_0002.MOV is 3 min (they are broken up by my camera, but I just want them together), and overlay.avi is ~8 minutes. I want to delay the overlay video 1.1 seconds to align the videos. But when I run this command, unless I'm missing something, the first 5 minutes are fine, but then the alignment of the overlay is off for the last three minutes (it's like it isn't delayed for the last 3 minutes). Does anyone see what is wrong with my command? ffmpeg -i MVI_0001.MOV -i MVI_0002.MOV -ss 1.1 -i overlay.avi -filter_complex "[0:0][0:1][1:0][1:1]concat=n=2:v=1:a=1 [v][a]; [v][2:0]overlay=format=rgb[vout]" -strict -2 -shortest -map [vout] -map [a] out.mp4 Josh ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Help with -video_size
Hi Moritz, Roger Hi Moritz > > > > > Can you be a bit more clear? Are you trying to record the full 1366x768 > > and resize it to 1024x768, or are you trying to capture only 1024x768 > > of your screen? > I wanted to resize to 1024x768. Not capture part of the screen. If you only want a segment of your desktop, you can let dshow capture > the complete 1366x768, and have ffmpeg crop the video to the part you > want to preserve. Insert (e.g.) "-vf crop=x=0:y=0:w=1024:h=768". Again, I don't want to crop it, however your suggestion reminded me of the scaling filter, I see there is -vf scale=1024:-1 The question I would have though is whether you believe filters create more work for ffmpeg or the computer as opposed to regular parameters such as -video_size? In other words, is a filter considered re-encoding where -video_size wouldn't be. Either way, I plan on testing with the filter. Hi Roger, > > > By default, it captures the "full screen" of the main desktop monitor > > [...] To configure it differently, run the provided "configuration > > setup utilities/shortcuts" or adjust registry settings before > > starting a run (advanced users only) [...] > > I think it might respect video_size as well but I'm not certain, and > definitely not sure if it i truncates versus scaled or what not, > anyway you could try it. Yes, I'm not sure and I wrote it LOL, guess > it's been awhile. I noticed the code hasn't been updated in awhile on the git page. Have you stopped development? I'm curious, was the initial intention of you writing this program, a response of ffmpeg not having GDIgrab or disliking the results at the time? If you disliked the results, would you say GDIgrab has improved? Would you recommend using GDIgrab? Is that something that ffmpeg devs are consistently developing? And if so, is this why you've stopped development of screen capture recorder? My concern I suppose is will screen-capture-recorder be unusable as ffmpeg develops. Let me make it clear there is no judgement here either way, I just want to know for my own future development as I like the results of screen-capture-recorder. Thanks!! Tim ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] Continue encoding even if one input stream as no more data for a short amount of time ?
Hi, For a project, I need to secure the continuity of a live stream output. The issue is that ffmpeg pause encoding when any input as no new data. He restart only when the source is reactivated, but the output stream is now broken for the final client here before the cut. So, simple question : is there a solution to force ffmpeg to continue encoding even if one stream input has no data for a short amount of time (< 5 seconds) ? Black screen, alternate stream, last frame repeated, weird bash pipes... Anything. I can use a buffer, of course. But the general latency increase each time, and I want to keep it under 10 seconds. My only actualy working solution is to have OpenBroadcasterSoftware, a desktop software, reading the stream and encoding it to the front rtmp server. Wich is insane. Gstreamer, VLC, MEncoder... hell, I even tested v4l. All of them also pause when source is down, even if they do overlay/compositing from multi sources. Technical details My source is a mpegts stream via udp, from another ffmpeg instance who convert rtmp to mpegts over udp. When the rtmp source is down, ffmpeg wait the restart (it work). Here, I have a script who launch a "standing by image" to the udp stream. And it switch back to the stream later if RTMP is restarted. The main ffmpeg restart encoding, and everything is good for a new client. But every client here before the cut have now a broken playback. Command lines (I removed a lot of fine tuning, so the second one can fail sometime, just relaunch it.) ffmpeg \ -re -i rtmp://server:1935/live/testlive \ -c copy -bsf:v h264_mp4toannexb -f mpegts udp://127.0.0.1:1 ffmpeg \ -fflags +genpts -stream_loop -1 \ -r 30 -i udp://127.0.0.1:1 \ -vcodec libx264 -preset veryfast -crf 22 \ -g 60 -c:a aac -b:a 128k -ar 44100 \ -f flv -rtmp_live live rtmp://192.168.61.108:1935/live/restream Buildonf (also tested with the current git, nothing different, so I stick to the stable version) ffmpeg -buildconf ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609 configuration: --prefix=/usr/local --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --bindir=/usr/local/bin --disable-doc --disable-static --enable-shared --enable-ffplay --extra-libs=-ldl --enable-version3 --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxcb --enable-pthreads --enable-gpl --enable-avresample --enable-postproc --enable-nonfree --disable-debug --enable-small --enable-openssl libavutil 55. 34.100 / 55. 34.100 libavcodec 57. 64.101 / 57. 64.101 libavformat57. 56.100 / 57. 56.100 libavdevice57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libavresample 3. 1. 0 / 3. 1. 0 libswscale 4. 2.100 / 4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc54. 1.100 / 54. 1.100 configuration: --prefix=/usr/local --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --bindir=/usr/local/bin --disable-doc --disable-static --enable-shared --enable-ffplay --extra-libs=-ldl --enable-version3 --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxcb --enable-pthreads --enable-gpl --enable-avresample --enable-postproc --enable-nonfree --disable-debug --enable-small --enable-openssl Thank you if you have an answer, i'm losing my mind to solve that specific issue, and it's the last element missing for my project. ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Help with -video_size
On 1/6/17, Moritz Barsnickwrote: > On Fri, Jan 06, 2017 at 00:14:31 -0800, Tim Hiles wrote: >> I've tried recording my screen set at 1366 x 768 and specified -video_size >> to 1024x768. The command did create a recording however it did not change >> the size. The output is below (further comments after the output). > > Can you be a bit more clear? Are you trying to record the full 1366x768 > and resize it to 1024x768, or are you trying to capture only 1024x768 > of your screen? > >> ffmpeg -rtbufsize 1000M -f dshow -i >> video="screen-capture-recorder":audio="Internal Mic (IDT High Definiti" >> -flags +global_header -vcodec libx264 -pix_fmt yuv420p -video_size >> 1024x768 -preset ultrafast -acodec aac -ac 1 -ar 22050 "Sessiontest2.mp4" > > Since -video_size is an input option, it won't work this way. If you > want to tell the input to use this size, you need to place it *before* > the respective "-i"; which you did in your second example: > >> ...which is switching -video_size parameter before the codec and apply it >> to my command this is what I get. >> >> ffmpeg -rtbufsize 1000M -f dshow -video_size 1024x768 -i >> video="screen-capture-recorder":audio="Internal Mic (IDT High Definiti" >> -flags +global_header -vcodec libx264 -pix_fmt yuv420p -video_size >> 1024x768 -preset ultrafast -acodec aac -ac 1 -ar 22050 "Sessiontest2.mp4" > > The second "-video_size" has no effect, as mentioned above. Yeah I suppose in the perfect world FFmpeg would at least *complain* about unused parameters, but it is as Maritz described. >> [dshow @ 00558fe0] Could not set video options >> video=screen-capture-recorder:audio=Internal Mic (IDT High Definiti: I/O >> error > > As the documentation says: "If the device does not support the > requested options, it will fail to open." > > I would guess that the "-video_size" option is not supported by > screen-capture-recorder. Reading about it does confirm this: > > https://github.com/rdp/screen-capture-recorder-to-video-windows-free > See the section "Configuration": > > By default, it captures the "full screen" of the main desktop monitor > [...] To configure it differently, run the provided "configuration > setup utilities/shortcuts" or adjust registry settings before > starting a run (advanced users only) [...] I think it might respect video_size as well but I'm not certain, and definitely not sure if it i truncates versus scaled or what not, anyway you could try it. Yes, I'm not sure and I wrote it LOL, guess it's been awhile. ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] Change Volume of a Track Without Affecting Other Tracks
I'm trying to basically take a main audio track (podcast), and add an intro and outro to it. However, the music is very loud, so I need to turn down the volume. However, when I use the volume filter on the intro/outro tracks, I notice that the main audio track is also lower than in the original audio. Here's the command I'm using right now: ffmpeg -i ccyl011-audio.mp3 -i ambient_travel_stinger.wav -i ambient_travel_stinger.wav -filter_complex "[0:a]adelay=4600,apad,aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo[audio];[1:a]volume=0.15:precision=fixed,apad,aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo[intro];[2:a]volume=0.15:precision=fixed,adelay=2354600,aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo[outro]; [audio][intro][outro]amerge=inputs=3,pan=stereo|c0
Re: [FFmpeg-user] Help with -video_size
On Fri, Jan 06, 2017 at 00:14:31 -0800, Tim Hiles wrote: > I've tried recording my screen set at 1366 x 768 and specified -video_size > to 1024x768. The command did create a recording however it did not change > the size. The output is below (further comments after the output). Can you be a bit more clear? Are you trying to record the full 1366x768 and resize it to 1024x768, or are you trying to capture only 1024x768 of your screen? > ffmpeg -rtbufsize 1000M -f dshow -i > video="screen-capture-recorder":audio="Internal Mic (IDT High Definiti" > -flags +global_header -vcodec libx264 -pix_fmt yuv420p -video_size 1024x768 > -preset ultrafast -acodec aac -ac 1 -ar 22050 "Sessiontest2.mp4" Since -video_size is an input option, it won't work this way. If you want to tell the input to use this size, you need to place it *before* the respective "-i"; which you did in your second example: > ...which is switching -video_size parameter before the codec and apply it > to my command this is what I get. > > ffmpeg -rtbufsize 1000M -f dshow -video_size 1024x768 -i > video="screen-capture-recorder":audio="Internal Mic (IDT High Definiti" > -flags +global_header -vcodec libx264 -pix_fmt yuv420p -video_size 1024x768 > -preset ultrafast -acodec aac -ac 1 -ar 22050 "Sessiontest2.mp4" The second "-video_size" has no effect, as mentioned above. > [dshow @ 00558fe0] Could not set video options > video=screen-capture-recorder:audio=Internal Mic (IDT High Definiti: I/O error As the documentation says: "If the device does not support the requested options, it will fail to open." I would guess that the "-video_size" option is not supported by screen-capture-recorder. Reading about it does confirm this: https://github.com/rdp/screen-capture-recorder-to-video-windows-free See the section "Configuration": By default, it captures the "full screen" of the main desktop monitor [...] To configure it differently, run the provided "configuration setup utilities/shortcuts" or adjust registry settings before starting a run (advanced users only) [...] If you only want a segment of your desktop, you can let dshow capture the complete 1366x768, and have ffmpeg crop the video to the part you want to preserve. Insert (e.g.) "-vf crop=x=0:y=0:w=1024:h=768". Cheers, hope this helps, Moritz ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Samsung HT-D330K codec issue
On Fri, Jan 06, 2017 at 03:44:11 +0100, James Darnley wrote: > > * -b:a 4M # restrict the video bitrate to 4 Mbit/s > > I would suggest -vb (or -b:v in the modern parlance) to set the video > bitrate. Sorry, I did mean -b:v of course. Thanks, Moritz ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Why do these blank spots appear in spectrograms of converted youtube videos?
On 1/6/17, Ethan Lewiswrote: > Hello > > I was converting a bunch of youtube videos into 16kHz wav files using ffmpeg > > I used the following commands > > youtube-dl -f best /path/to/youtube/video/ -f 'bestvideo,bestaudio' -o > '%(title)s.f%(format_id)s.%(ext)s' > > ffmpeg -i /path/to/download/m4a/audio -acodec pcm_s16le -ar 16000 -ac > test1.wav > > When I use these youtube videos > > https://www.youtube.com/watch?v=E1mGPeLqg2g > https://www.youtube.com/watch?v=XBFOP_pF7PY > > I see many blank spots in their spectrograms (see the ones uploaded here > https://drive.google.com/file/d/0BzNdoGke8tyRSGgwUUtSTkgxdEE/view?usp=sharing > ) > > Natural speech should not have such artefacts. > > I am confused why this is happening. Is it because of ffmpeg conversion of > m4a audio OR was it somehow fault of the original recording? Have you compared with original audio? prior to resampling with ffmpeg? ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] Help with -video_size
Hi all, I've tried recording my screen set at 1366 x 768 and specified -video_size to 1024x768. The command did create a recording however it did not change the size. The output is below (further comments after the output). ffmpeg -rtbufsize 1000M -f dshow -i video="screen-capture-recorder":audio="Interna l Mic (IDT High Definiti" -flags +global_header -vcodec libx264 -pix_fmt yuv420p -video_size 1024x768 -preset ultrafast -acodec aac -ac 1 -ar 22050 "Sessiontest2.mp4" ffmpeg version N-82966-g6993bb4 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 5.4.0 (GCC) configuration: --enable-gpl --enable-version3 --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable -bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-li bbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enabl e-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-li bopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --en able-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable -libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zl ib libavutil 55. 43.100 / 55. 43.100 libavcodec 57. 70.100 / 57. 70.100 libavformat57. 61.100 / 57. 61.100 libavdevice57. 2.100 / 57. 2.100 libavfilter 6. 68.100 / 6. 68.100 libswscale 4. 3.101 / 4. 3.101 libswresample 2. 4.100 / 2. 4.100 libpostproc54. 2.100 / 54. 2.100 leaving aero onGuessed Channel Layout for Input Stream #0.1 : stereo Input #0, dshow, from 'video=screen-capture-recorder:audio=Internal Mic (IDT High Definiti': Duration: N/A, start: 40602.935000, bitrate: N/A Stream #0:0: Video: rawvideo, bgr0, 1366x768, 30 fps, 30 tbr, 1k tbn, 1k tbc Stream #0:1: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s [libx264 @ 005c6400] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX [libx264 @ 005c6400] profile Constrained Baseline, level 3.2 [libx264 @ 005c6400] 264 - core 148 r2744 b97ae06 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.vid eolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_th reads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq =0 Output #0, mp4, to 'Sessiontest2.mp4': Metadata: encoder : Lavf57.61.100 Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1366x768, q=-1--1, 30 fps, 1k tbn, 30 tbc Metadata: encoder : Lavc57.70.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1 Stream #0:1: Audio: aac (LC) ([64][0][0][0] / 0x0040), 22050 Hz, mono, fltp, 69 kb/s Metadata: encoder : Lavc57.70.100 aac Stream mapping: Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264)) Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (native)) Press [q] to stop, [?] for help [swscaler @ 005e0fe0] Warning: data is not aligned! This can lead to a speedloss Past duration 0.937492 too large4348kB time=00:00:51.53 bitrate= 691.1kbits/s speed=0.993x frame=175139 fps= 30 q=-1.0 Lsize= 216992kB time=01:37:17.92 bitrate= 304.5kbits/s dup=15 drop=13 speed= 1x video:165641kB audio:47853kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.638695% [libx264 @ 005c6400] frame I:701 Avg QP:10.05 size:209412 [libx264 @ 005c6400] frame P:174438 Avg QP:13.22 size: 131 [libx264 @ 005c6400] mb I I16..4: 100.0% 0.0% 0.0% [libx264 @ 005c6400] mb P I16..4: 0.1% 0.0% 0.0% P16..4: 0.1% 0.0% 0.0% 0.0% 0.0%skip:99.9% [libx264 @ 005c6400] coded y,uvDC,uvAC intra: 34.1% 30.5% 29.8% inter: 0.0% 0.1% 0.0% [libx264 @ 005c6400] i16 v,h,dc,p: 45% 48% 4% 4% [libx264 @ 005c6400] i8c dc,h,v,p: 49% 36% 12% 3% [libx264 @ 005c6400] kb/s:232.43 [aac @ 005c8340] Qavg: 48946.633 Inspection of the output file is below: ffmpeg -i Sessiontest2.mp4 ffmpeg version N-82889-g54931fd Copyright (c) 2000-2016 the FFmpeg developers built with gcc 5.4.0 (GCC) configuration: --enable-gpl --enable-version3 --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable -bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-li bbs2b
[FFmpeg-user] Why do these blank spots appear in spectrograms of converted youtube videos?
Hello I was converting a bunch of youtube videos into 16kHz wav files using ffmpeg I used the following commands youtube-dl -f best /path/to/youtube/video/ -f 'bestvideo,bestaudio' -o '%(title)s.f%(format_id)s.%(ext)s' ffmpeg -i /path/to/download/m4a/audio -acodec pcm_s16le -ar 16000 -ac test1.wav When I use these youtube videos https://www.youtube.com/watch?v=E1mGPeLqg2g https://www.youtube.com/watch?v=XBFOP_pF7PY I see many blank spots in their spectrograms (see the ones uploaded here https://drive.google.com/file/d/0BzNdoGke8tyRSGgwUUtSTkgxdEE/view?usp=sharing ) Natural speech should not have such artefacts. I am confused why this is happening. Is it because of ffmpeg conversion of m4a audio OR was it somehow fault of the original recording? Thanks. ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".