Hello all, can FFmpeg or FFplay be used for playing a video (without audio) and exactly simultaneously record an audio file? I mean for making sound effects for the video. If this isn't possible, is there any other free software that can do it? Thanks Michael
On 16-01-2020 01:52 pm, Michael Koch wrote:
Hello all,
can FFmpeg or FFplay be used for playing a video (without audio) and exactly simultaneously record an audio file? I mean for making sound effects for the video. If this isn't possible, is there any other free software that can do it?
Basic syntax would be, ffmpeg -re -i videofile -f audiodevice -i audiourl -map 1:a audioout.wav -map 0:v -f sdl2 - (At a minimum, you'll need a ffmpeg build with SDL2 enabled; if your package includes ffplay, it'll have it) Gyan
Hello Gyan,
can FFmpeg or FFplay be used for playing a video (without audio) and exactly simultaneously record an audio file? I mean for making sound effects for the video. If this isn't possible, is there any other free software that can do it?
Basic syntax would be,
ffmpeg -re -i videofile -f audiodevice -i audiourl -map 1:a audioout.wav -map 0:v -f sdl2 -
My first test, this works fine: ffmpeg -re -i test.mp4 -f sdl2 - Question: Is there any documentation for -f sdl2 ? My second test: ffmpeg -re -i test.mp4 -f dshow -channels 2 -i audio="Mikrofon (Realtek High Definiti" -y -map 1:a audio.wav -map 0:v -f sdl2 - This command line has two problems: 1. The video doesn't play continuously, it's stop-and-go. May be my notebook has not enough computing power? Any ideas how to avoid this problem? 2. FFmpeg doesn't stop when the end of the video has been reached. The audio file gets longer than the video. I did already try to add the -shortest option, but it didn't solve the problem. Here is the console output: C:\Users\mKoch\Desktop>c://ffmpeg/ffmpeg -re -i test.mp4 -f dshow -channels 2 -i audio="Mikrofon (Realtek High Definiti" -y -map 1:a audio.wav -map 0:v -f sdl2 - ffmpeg version git-2020-01-15-0dc0837 Copyright (c) 2000-2020 the FFmpeg develop ers built with gcc 9.2.1 (GCC) 20200111 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfi g --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libb luray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enab le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --e nable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable -libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 - -enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enab le-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --en able-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcode c --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 - -enable-avisynth --enable-libopenmpt --enable-amf libavutil 56. 38.100 / 56. 38.100 libavcodec 58. 65.103 / 58. 65.103 libavformat 58. 35.102 / 58. 35.102 libavdevice 58. 9.103 / 58. 9.103 libavfilter 7. 71.100 / 7. 71.100 libswscale 5. 6.100 / 5. 6.100 libswresample 3. 6.100 / 3. 6.100 libpostproc 55. 6.100 / 55. 6.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf58.25.100 Duration: 00:00:06.57, start: 0.000000, bitrate: 12218 kb/s Stream #0:0(eng): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p , 1920x1080 [SAR 1:1 DAR 16:9], 12216 kb/s, 30 fps, 30 tbr, 15360 tbn, 30 tbc (d efault) Metadata: handler_name : VideoHandler timecode : 07:34:52:21 Stream #0:1(eng): Data: none (tmcd / 0x64636D74), 0 kb/s Metadata: handler_name : TimeCodeHandler timecode : 07:34:52:21 Guessed Channel Layout for Input Stream #1.0 : stereo Input #1, dshow, from 'audio=Mikrofon (Realtek High Definiti': Duration: N/A, start: 31251.109000, bitrate: 1411 kb/s Stream #1:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s Stream mapping: Stream #1:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native)) Stream #0:0 -> #1:0 (mpeg4 (native) -> rawvideo (native)) Press [q] to stop, [?] for help Output #0, wav, to 'audio.wav': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 ISFT : Lavf58.35.102 Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16 , 1411 kb/s Metadata: encoder : Lavc58.65.103 pcm_s16le Output #1, sdl,sdl2, to 'pipe:': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf58.35.102 Stream #1:0(eng): Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080 [S AR 1:1 DAR 16:9], q=2-31, 746496 kb/s, 30 fps, 30 tbn, 30 tbc (default) Metadata: handler_name : VideoHandler timecode : 07:34:52:21 encoder : Lavc58.65.103 rawvideo frame= 1 fps=0.0 q=-0.0 size= 172kB time=00:00:01.01 bitrate=1396.5kbits/ frame= 17 fps= 17 q=-0.0 size= 256kB time=00:00:01.51 bitrate=1387.0kbits/ frame= 32 fps= 21 q=-0.0 size= 256kB time=00:00:01.51 bitrate=1387.0kbits/ frame= 47 fps= 23 q=-0.0 size= 256kB time=00:00:02.53 bitrate= 828.3kbits/ frame= 62 fps= 24 q=-0.0 size= 256kB time=00:00:02.53 bitrate= 828.3kbits/ frame= 77 fps= 25 q=-0.0 size= 512kB time=00:00:03.55 bitrate=1180.5kbits/ frame= 93 fps= 26 q=-0.0 size= 512kB time=00:00:04.05 bitrate=1035.6kbits/ frame= 108 fps= 27 q=-0.0 size= 512kB time=00:00:04.05 bitrate=1035.6kbits/ frame= 123 fps= 27 q=-0.0 size= 768kB time=00:00:04.55 bitrate=1382.1kbits/ frame= 138 fps= 27 q=-0.0 size= 768kB time=00:00:05.06 bitrate=1242.6kbits/ frame= 153 fps= 28 q=-0.0 size= 768kB time=00:00:05.56 bitrate=1130.7kbits/ frame= 168 fps= 28 q=-0.0 size= 1024kB time=00:00:06.06 bitrate=1383.8kbits/ frame= 184 fps= 28 q=-0.0 size= 1024kB time=00:00:06.58 bitrate=1274.3kbits/ frame= 197 fps= 28 q=-0.0 size= 1024kB time=00:00:07.09 bitrate=1182.5kbits/ frame= 197 fps= 26 q=-0.0 size= 1280kB time=00:00:07.60 bitrate=1379.0kbits/ frame= 197 fps= 24 q=-0.0 size= 1280kB time=00:00:08.13 bitrate=1289.4kbits/ frame= 197 fps= 23 q=-0.0 size= 1280kB time=00:00:08.63 bitrate=1214.6kbits/ frame= 197 fps= 22 q=-0.0 size= 1536kB time=00:00:09.13 bitrate=1377.9kbits/ frame= 197 fps= 21 q=-0.0 size= 1536kB time=00:00:09.63 bitrate=1306.1kbits/ frame= 197 fps= 20 q=-0.0 size= 1536kB time=00:00:10.13 bitrate=1241.8kbits/ frame= 197 fps= 19 q=-0.0 size= 1792kB time=00:00:10.63 bitrate=1381.0kbits/ frame= 197 fps= 18 q=-0.0 size= 1792kB time=00:00:11.13 bitrate=1318.6kbits/ frame= 197 fps= 17 q=-0.0 size= 1792kB time=00:00:11.63 bitrate=1261.9kbits/ frame= 197 fps= 16 q=-0.0 size= 2048kB time=00:00:12.13 bitrate=1382.7kbits/ frame= 197 fps= 16 q=-0.0 size= 2048kB time=00:00:12.63 bitrate=1328.0kbits/ frame= 197 fps= 15 q=-0.0 size= 2048kB time=00:00:13.13 bitrate=1277.6kbits/ frame= 197 fps= 15 q=-0.0 size= 2304kB time=00:00:13.63 bitrate=1384.6kbits/ frame= 197 fps= 14 q=-0.0 size= 2304kB time=00:00:14.13 bitrate=1335.6kbits/ frame= 197 fps= 14 q=-0.0 size= 2304kB time=00:00:14.63 bitrate=1289.9kbits/ frame= 197 fps= 13 q=-0.0 size= 2560kB time=00:00:15.13 bitrate=1386.0kbits/ frame= 197 fps= 13 q=-0.0 size= 2560kB time=00:00:15.63 bitrate=1341.5kbits/ frame= 197 fps= 12 q=-0.0 size= 2560kB time=00:00:16.13 bitrate=1299.9kbits/ frame= 197 fps= 12 q=-0.0 size= 2816kB time=00:00:16.63 bitrate=1387.0kbits/ frame= 197 fps= 12 q=-0.0 size= 2816kB time=00:00:17.13 bitrate=1346.6kbits/ frame= 197 fps= 11 q=-0.0 size= 2816kB time=00:00:17.63 bitrate=1308.3kbits/ frame= 197 fps= 11 q=-0.0 size= 3072kB time=00:00:18.13 bitrate=1387.8kbits/ frame= 197 fps= 11 q=-0.0 size= 3072kB time=00:00:18.63 bitrate=1350.7kbits/ frame= 197 fps= 10 q=-0.0 size= 3072kB time=00:00:19.13 bitrate=1315.4kbits/ frame= 197 fps= 10 q=-0.0 size= 3328kB time=00:00:19.63 bitrate=1388.6kbits/ frame= 197 fps=9.8 q=-0.0 size= 3328kB time=00:00:20.13 bitrate=1354.2kbits/ frame= 197 fps=9.6 q=-0.0 size= 3328kB time=00:00:20.63 bitrate=1321.3kbits/ frame= 197 fps=9.3 q=-0.0 size= 3584kB time=00:00:21.13 bitrate=1389.4kbits/ frame= 197 fps=9.1 q=-0.0 size= 3584kB time=00:00:21.63 bitrate=1357.4kbits/ frame= 197 fps=8.9 q=-0.0 size= 3584kB time=00:00:22.13 bitrate=1326.5kbits/ frame= 197 fps=8.7 q=-0.0 size= 3840kB time=00:00:22.63 bitrate=1389.9kbits/ frame= 197 fps=8.5 q=-0.0 size= 3840kB time=00:00:23.13 bitrate=1359.8kbits/ frame= 197 fps=8.3 q=-0.0 Lsize= 4048kB time=00:00:23.63 bitrate=1403.2kbits /s speed= 1x video:598388kB audio:4048kB subtitle:0kB other streams:0kB global headers:0kB mu xing overhead: unknown Exiting normally, received signal 2.
On 16-01-2020 10:21 pm, Michael Koch wrote:
Hello Gyan,
can FFmpeg or FFplay be used for playing a video (without audio) and exactly simultaneously record an audio file? I mean for making sound effects for the video. If this isn't possible, is there any other free software that can do it?
Basic syntax would be,
ffmpeg -re -i videofile -f audiodevice -i audiourl -map 1:a audioout.wav -map 0:v -f sdl2 -
My first test, this works fine:
ffmpeg -re -i test.mp4 -f sdl2 -
Question: Is there any documentation for -f sdl2 ?
My second test: ffmpeg -re -i test.mp4 -f dshow -channels 2 -i audio="Mikrofon (Realtek High Definiti" -y -map 1:a audio.wav -map 0:v -f sdl2 -
This command line has two problems: 1. The video doesn't play continuously, it's stop-and-go. May be my notebook has not enough computing power? Any ideas how to avoid this problem? 2. FFmpeg doesn't stop when the end of the video has been reached. The audio file gets longer than the video. I did already try to add the -shortest option, but it didn't solve the problem.
1) Ok, let's pipe it to ffplay then. 2) The audio and playback video are independent outputs. So, ffmpeg will have to be manually stopped. ffmpeg -an -i test.mp4 -f dshow -channels 2 -i audio="Mikrofon (Realtek High Definiti" -y -map 1:a audio.wav -map 0:v -c copy -f mpegts - | ffplay -f mpegts - Gyan
Here is the console output:
C:\Users\mKoch\Desktop>c://ffmpeg/ffmpeg -re -i test.mp4 -f dshow -channels 2 -i audio="Mikrofon (Realtek High Definiti" -y -map 1:a audio.wav -map 0:v -f sdl2 - ffmpeg version git-2020-01-15-0dc0837 Copyright (c) 2000-2020 the FFmpeg develop ers built with gcc 9.2.1 (GCC) 20200111 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfi g --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libb luray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enab le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --e nable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable -libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 - -enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enab le-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --en able-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcode c --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 - -enable-avisynth --enable-libopenmpt --enable-amf libavutil 56. 38.100 / 56. 38.100 libavcodec 58. 65.103 / 58. 65.103 libavformat 58. 35.102 / 58. 35.102 libavdevice 58. 9.103 / 58. 9.103 libavfilter 7. 71.100 / 7. 71.100 libswscale 5. 6.100 / 5. 6.100 libswresample 3. 6.100 / 3. 6.100 libpostproc 55. 6.100 / 55. 6.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf58.25.100 Duration: 00:00:06.57, start: 0.000000, bitrate: 12218 kb/s Stream #0:0(eng): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p , 1920x1080 [SAR 1:1 DAR 16:9], 12216 kb/s, 30 fps, 30 tbr, 15360 tbn, 30 tbc (d efault) Metadata: handler_name : VideoHandler timecode : 07:34:52:21 Stream #0:1(eng): Data: none (tmcd / 0x64636D74), 0 kb/s Metadata: handler_name : TimeCodeHandler timecode : 07:34:52:21 Guessed Channel Layout for Input Stream #1.0 : stereo Input #1, dshow, from 'audio=Mikrofon (Realtek High Definiti': Duration: N/A, start: 31251.109000, bitrate: 1411 kb/s Stream #1:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s Stream mapping: Stream #1:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native)) Stream #0:0 -> #1:0 (mpeg4 (native) -> rawvideo (native)) Press [q] to stop, [?] for help Output #0, wav, to 'audio.wav': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 ISFT : Lavf58.35.102 Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16 , 1411 kb/s Metadata: encoder : Lavc58.65.103 pcm_s16le Output #1, sdl,sdl2, to 'pipe:': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf58.35.102 Stream #1:0(eng): Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080 [S AR 1:1 DAR 16:9], q=2-31, 746496 kb/s, 30 fps, 30 tbn, 30 tbc (default) Metadata: handler_name : VideoHandler timecode : 07:34:52:21 encoder : Lavc58.65.103 rawvideo frame= 1 fps=0.0 q=-0.0 size= 172kB time=00:00:01.01 bitrate=1396.5kbits/ frame= 17 fps= 17 q=-0.0 size= 256kB time=00:00:01.51 bitrate=1387.0kbits/ frame= 32 fps= 21 q=-0.0 size= 256kB time=00:00:01.51 bitrate=1387.0kbits/ frame= 47 fps= 23 q=-0.0 size= 256kB time=00:00:02.53 bitrate= 828.3kbits/ frame= 62 fps= 24 q=-0.0 size= 256kB time=00:00:02.53 bitrate= 828.3kbits/ frame= 77 fps= 25 q=-0.0 size= 512kB time=00:00:03.55 bitrate=1180.5kbits/ frame= 93 fps= 26 q=-0.0 size= 512kB time=00:00:04.05 bitrate=1035.6kbits/ frame= 108 fps= 27 q=-0.0 size= 512kB time=00:00:04.05 bitrate=1035.6kbits/ frame= 123 fps= 27 q=-0.0 size= 768kB time=00:00:04.55 bitrate=1382.1kbits/ frame= 138 fps= 27 q=-0.0 size= 768kB time=00:00:05.06 bitrate=1242.6kbits/ frame= 153 fps= 28 q=-0.0 size= 768kB time=00:00:05.56 bitrate=1130.7kbits/ frame= 168 fps= 28 q=-0.0 size= 1024kB time=00:00:06.06 bitrate=1383.8kbits/ frame= 184 fps= 28 q=-0.0 size= 1024kB time=00:00:06.58 bitrate=1274.3kbits/ frame= 197 fps= 28 q=-0.0 size= 1024kB time=00:00:07.09 bitrate=1182.5kbits/ frame= 197 fps= 26 q=-0.0 size= 1280kB time=00:00:07.60 bitrate=1379.0kbits/ frame= 197 fps= 24 q=-0.0 size= 1280kB time=00:00:08.13 bitrate=1289.4kbits/ frame= 197 fps= 23 q=-0.0 size= 1280kB time=00:00:08.63 bitrate=1214.6kbits/ frame= 197 fps= 22 q=-0.0 size= 1536kB time=00:00:09.13 bitrate=1377.9kbits/ frame= 197 fps= 21 q=-0.0 size= 1536kB time=00:00:09.63 bitrate=1306.1kbits/ frame= 197 fps= 20 q=-0.0 size= 1536kB time=00:00:10.13 bitrate=1241.8kbits/ frame= 197 fps= 19 q=-0.0 size= 1792kB time=00:00:10.63 bitrate=1381.0kbits/ frame= 197 fps= 18 q=-0.0 size= 1792kB time=00:00:11.13 bitrate=1318.6kbits/ frame= 197 fps= 17 q=-0.0 size= 1792kB time=00:00:11.63 bitrate=1261.9kbits/ frame= 197 fps= 16 q=-0.0 size= 2048kB time=00:00:12.13 bitrate=1382.7kbits/ frame= 197 fps= 16 q=-0.0 size= 2048kB time=00:00:12.63 bitrate=1328.0kbits/ frame= 197 fps= 15 q=-0.0 size= 2048kB time=00:00:13.13 bitrate=1277.6kbits/ frame= 197 fps= 15 q=-0.0 size= 2304kB time=00:00:13.63 bitrate=1384.6kbits/ frame= 197 fps= 14 q=-0.0 size= 2304kB time=00:00:14.13 bitrate=1335.6kbits/ frame= 197 fps= 14 q=-0.0 size= 2304kB time=00:00:14.63 bitrate=1289.9kbits/ frame= 197 fps= 13 q=-0.0 size= 2560kB time=00:00:15.13 bitrate=1386.0kbits/ frame= 197 fps= 13 q=-0.0 size= 2560kB time=00:00:15.63 bitrate=1341.5kbits/ frame= 197 fps= 12 q=-0.0 size= 2560kB time=00:00:16.13 bitrate=1299.9kbits/ frame= 197 fps= 12 q=-0.0 size= 2816kB time=00:00:16.63 bitrate=1387.0kbits/ frame= 197 fps= 12 q=-0.0 size= 2816kB time=00:00:17.13 bitrate=1346.6kbits/ frame= 197 fps= 11 q=-0.0 size= 2816kB time=00:00:17.63 bitrate=1308.3kbits/ frame= 197 fps= 11 q=-0.0 size= 3072kB time=00:00:18.13 bitrate=1387.8kbits/ frame= 197 fps= 11 q=-0.0 size= 3072kB time=00:00:18.63 bitrate=1350.7kbits/ frame= 197 fps= 10 q=-0.0 size= 3072kB time=00:00:19.13 bitrate=1315.4kbits/ frame= 197 fps= 10 q=-0.0 size= 3328kB time=00:00:19.63 bitrate=1388.6kbits/ frame= 197 fps=9.8 q=-0.0 size= 3328kB time=00:00:20.13 bitrate=1354.2kbits/ frame= 197 fps=9.6 q=-0.0 size= 3328kB time=00:00:20.63 bitrate=1321.3kbits/ frame= 197 fps=9.3 q=-0.0 size= 3584kB time=00:00:21.13 bitrate=1389.4kbits/ frame= 197 fps=9.1 q=-0.0 size= 3584kB time=00:00:21.63 bitrate=1357.4kbits/ frame= 197 fps=8.9 q=-0.0 size= 3584kB time=00:00:22.13 bitrate=1326.5kbits/ frame= 197 fps=8.7 q=-0.0 size= 3840kB time=00:00:22.63 bitrate=1389.9kbits/ frame= 197 fps=8.5 q=-0.0 size= 3840kB time=00:00:23.13 bitrate=1359.8kbits/ frame= 197 fps=8.3 q=-0.0 Lsize= 4048kB time=00:00:23.63 bitrate=1403.2kbits /s speed= 1x video:598388kB audio:4048kB subtitle:0kB other streams:0kB global headers:0kB mu xing overhead: unknown Exiting normally, received signal 2.
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
My second test: ffmpeg -re -i test.mp4 -f dshow -channels 2 -i audio="Mikrofon (Realtek High Definiti" -y -map 1:a audio.wav -map 0:v -f sdl2 -
This command line has two problems: 1. The video doesn't play continuously, it's stop-and-go. May be my notebook has not enough computing power? Any ideas how to avoid this problem? 2. FFmpeg doesn't stop when the end of the video has been reached. The audio file gets longer than the video. I did already try to add the -shortest option, but it didn't solve the problem.
1) Ok, let's pipe it to ffplay then.
2) The audio and playback video are independent outputs. So, ffmpeg will have to be manually stopped.
ffmpeg -an -i test.mp4 -f dshow -channels 2 -i audio="Mikrofon (Realtek High Definiti" -y -map 1:a audio.wav -map 0:v -c copy -f mpegts - | ffplay -f mpegts -
I did try the above example (with some changes) but it has another problem: FFplay can't be stopped when the video has ended, and it uses the full screen. Which means I can't see the console window and can't close it. FFmpeg can only be stopped by the task manager. I found a better solution for the stop-and-go problem with sdl2. Adding -audio_buffer_size 100 solves the problem: ffmpeg -re -i test.mp4 -f dshow -audio_buffer_size 100 -channels 2 -i audio="Mikrofon (Realtek High Definiti" -y -map 1:a audio.wav -map 0:v -f sdl2 - Michael
On 19-01-2020 12:51 am, Michael Koch wrote:
My second test: ffmpeg -re -i test.mp4 -f dshow -channels 2 -i audio="Mikrofon (Realtek High Definiti" -y -map 1:a audio.wav -map 0:v -f sdl2 -
This command line has two problems: 1. The video doesn't play continuously, it's stop-and-go. May be my notebook has not enough computing power? Any ideas how to avoid this problem? 2. FFmpeg doesn't stop when the end of the video has been reached. The audio file gets longer than the video. I did already try to add the -shortest option, but it didn't solve the problem.
1) Ok, let's pipe it to ffplay then.
2) The audio and playback video are independent outputs. So, ffmpeg will have to be manually stopped.
ffmpeg -an -i test.mp4 -f dshow -channels 2 -i audio="Mikrofon (Realtek High Definiti" -y -map 1:a audio.wav -map 0:v -c copy -f mpegts - | ffplay -f mpegts -
I did try the above example (with some changes) but it has another problem: FFplay can't be stopped when the video has ended, and it uses the full screen. Which means I can't see the console window and can't close it. FFmpeg can only be stopped by the task manager.
Looks like your video resolution is equal to or greater than your display. Add `-vf scale=iw/2:-1` to resize it. Add -autoexit to quit ffplay when it detects EOF.
I found a better solution for the stop-and-go problem with sdl2. Adding -audio_buffer_size 100 solves the problem:
ffmpeg -re -i test.mp4 -f dshow -audio_buffer_size 100 -channels 2 -i audio="Mikrofon (Realtek High Definiti" -y -map 1:a audio.wav -map 0:v -f sdl2 -
Looks better for your needs, but this is dshow specific. Won't be applicable to other live audio sources. Gyan
Hello Gyan,
I did try the above example (with some changes) but it has another problem: FFplay can't be stopped when the video has ended, and it uses the full screen. Which means I can't see the console window and can't close it. FFmpeg can only be stopped by the task manager.
Looks like your video resolution is equal to or greater than your display. Add `-vf scale=iw/2:-1` to resize it.
ok, this works fine and now I can see the console window and close it when the video has ended.
Add -autoexit to quit ffplay when it detects EOF.
This didn't work in my test. The FFplay window remains open and shows the last frame, until I manually close the FFmpeg console window. Pressing "q" or "esc" to close the FFplay window does only work if the video is still running, but not if the video has already ended. I've written a summary into my book in chapter 3.16 (but chapter numbering may change in future): http://www.astro-electronic.de/FFmpeg_Book.pdf Thanks for your help, Michael
On 1/19/20, Michael Koch <astroelectronic@t-online.de> wrote:
Hello Gyan,
I did try the above example (with some changes) but it has another problem: FFplay can't be stopped when the video has ended, and it uses the full screen. Which means I can't see the console window and can't close it. FFmpeg can only be stopped by the task manager.
Looks like your video resolution is equal to or greater than your display. Add `-vf scale=iw/2:-1` to resize it.
ok, this works fine and now I can see the console window and close it when the video has ended.
Add -autoexit to quit ffplay when it detects EOF.
This didn't work in my test. The FFplay window remains open and shows the last frame, until I manually close the FFmpeg console window. Pressing "q" or "esc" to close the FFplay window does only work if the video is still running, but not if the video has already ended.
I've written a summary into my book in chapter 3.16 (but chapter numbering may change in future): http://www.astro-electronic.de/FFmpeg_Book.pdf
Book contains obsolete info about v360 filter, please fix it.
Thanks for your help, Michael
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
Am 19.01.2020 um 13:54 schrieb Paul B Mahol:
On 1/19/20, Michael Koch <astroelectronic@t-online.de> wrote:
Hello Gyan,
I did try the above example (with some changes) but it has another problem: FFplay can't be stopped when the video has ended, and it uses the full screen. Which means I can't see the console window and can't close it. FFmpeg can only be stopped by the task manager. Looks like your video resolution is equal to or greater than your display. Add `-vf scale=iw/2:-1` to resize it. ok, this works fine and now I can see the console window and close it when the video has ended.
Add -autoexit to quit ffplay when it detects EOF. This didn't work in my test. The FFplay window remains open and shows the last frame, until I manually close the FFmpeg console window. Pressing "q" or "esc" to close the FFplay window does only work if the video is still running, but not if the video has already ended.
I've written a summary into my book in chapter 3.16 (but chapter numbering may change in future): http://www.astro-electronic.de/FFmpeg_Book.pdf Book contains obsolete info about v360 filter, please fix it.
you mean the new fisheye output? I saw it, but I'm still waiting for new build on Zeranoe so that I can test it. Michael
I've written a summary into my book in chapter 3.16 (but chapter numbering may change in future): http://www.astro-electronic.de/FFmpeg_Book.pdf Book contains obsolete info about v360 filter, please fix it.
Done. Many new examples for the v360 filter added to chapters 2.48 to 2.55 http://www.astro-electronic.de/FFmpeg_Book.pdf Michael
participants (3)
-
Gyan -
Michael Koch -
Paul B Mahol