[FFmpeg-user] taking audio and video inputs from different devices

Ricardo Kleemann ricardo at americasnet.com
Mon Jul 27 01:19:45 CEST 2015


Hi Carl,

> On Jul 26, 2015, at 9:57 AM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> 
> Ricardo Kleemann <ricardo <at> americasnet.com> writes:
> 
>>> Does it work if you only record audio?
>>> 
>> 
>> I’m not sure where the crazy start time comes from, 
>> but yes, the audio works fine if done separately.
> 
> Does -vsync 0 help?

I’ve tried different combinations of async and vsync, also using the map for both streams.

> 
> Did you explain which hardware device this is?
> 
I’m using the BlackMagic Design UltraStudio Mini Recorder. That’s the second device in my command line. It’s connected via HDMI to a camcorder. But the camcorder only outputs video on the hdmi, so I need to mix in the audio from the default audio input.

Anyway, what I have found so far is that any combination that does not have -async 1 in it, causes the video to fast forward all the way to the end very quickly, but does reproduce the audio. Otherwise with other combinations the audio is not discernible

I’m still getting some strange start offsets from the audio stream, but 0.000 start from the video. Is there a way to force both to start at zero?

ffmpeg -f avfoundation -i "none:1" -f decklink -i 'UltraStudio Mini Recorder at 9' -map 0:0 -map 1:1 -ac 2 -vcodec libx264 -preset veryfast -vf scale=640:360 -vsync 0 -async 1 out7.mp4
ffmpeg version N-73104-g7604358 Copyright (c) 2000-2015 the FFmpeg developers
  built with Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
  configuration: --prefix=/usr/local --enable-gpl --enable-nonfree --enable-ffplay --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-decklink --extra-cflags=-I/Users/ptl/blackmagicsdk/Mac/include --extra-ldflags=-L/Users/ptl/blackmagicsdk/Mac/include
  libavutil      54. 27.100 / 54. 27.100
  libavcodec     56. 44.100 / 56. 44.100
  libavformat    56. 38.100 / 56. 38.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 17.100 /  5. 17.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, avfoundation, from 'none:1':
  Duration: N/A, start: 95179.385737, bitrate: 2822 kb/s
    Stream #0:0: Audio: pcm_f32le, 44100 Hz, stereo, flt, 2822 kb/s
[decklink @ 0x7fb65401fa00] Found Decklink mode 1920 x 1080 with rate 29.97
[decklink @ 0x7fb65401fa00] Frame received (#1) - No input signal detected - Frames dropped 1
Guessed Channel Layout for  Input Stream #1.0 : stereo
Input #1, decklink, from 'UltraStudio Mini Recorder at 9':
  Duration: N/A, start: 0.000000, bitrate: 1536 kb/s
    Stream #1:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
    Stream #1:1: Video: rawvideo (UYVY / 0x59565955), uyvy422, 1920x1080, -5 kb/s, 29.97 tbr, 1000k tbn, 29.97 tbc
File 'out7.mp4' already exists. Overwrite ? [y/N] [decklink @ 0x7fb65401fa00] Frame received (#2) - Input returned - Frames dropped 2
y
-async is forwarded to lavfi similarly to -af aresample=async=1:min_hard_comp=0.100000:first_pts=0.
No pixel format specified, yuv422p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x7fb654034400] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x7fb654034400] profile High 4:2:2, level 3.0, 4:2:2 8-bit
[libx264 @ 0x7fb654034400] 264 - core 144 r2533 c8a773e - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'out7.mp4':
  Metadata:
    encoder         : Lavf56.38.100
    Stream #0:0: Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, s16, 128 kb/s
    Metadata:
      encoder         : Lavc56.44.100 libfdk_aac
    Stream #0:1: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv422p, 640x360, q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc56.44.100 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_f32le (native) -> aac (libfdk_aac))
  Stream #1:1 -> #0:1 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[decklink @ 0x7fb65401fa00] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
frame=   51 fps=0.0 q=29.0 size=     162kB time=00:00:01.36 bitrate= 970.0kbits/[avfoundation @ 0x7fb655809400] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
frame=   66 fps= 65 q=29.0 size=     259kB time=00:00:01.81 bitrate=1169.3kbits/frame=   81 fps= 53 q=29.0 size=     357kB time=00:00:02.32 bitrate=1258.6kbits/frame=   96 fps= 48 q=29.0 size=     443kB time=00:00:02.80 bitrate=1292.0kbits/


> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user



More information about the ffmpeg-user mailing list