在带有录音功能的ffmpeg h264视频中失真的视频

时间:2018-03-13 18:06:43

标签: ffmpeg

我正在使用ffmpeg不断录制来自ip camera的音频视频。当我进入图片时,我得到一个扭曲的视频。如果背景仍然是,视频看起来很正常,但是当我进入图片时,我发现自己只是在背景保持完好时被扭曲。如果有人经历过这个问题,我将非常感谢你的帮助。这是我正在使用的命令:

ffmpeg -i rtsp://admin:admin@192.168.1.9/mpeg4 -map 0 -c:v libx264 -c:a aac -pix_fmt yuv420p -f segment -segment_time 60 -segment_wrap 10 -reset_timestamps 1 %d.mp4

这是一个ffmpeg命令输出:

ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers

built with Apple LLVM version 9.0.0 (clang-900.0.39.2)

 configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4.1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma --enable-nonfree

libavutil      55. 78.100 / 55. 78.100

libavcodec     57.107.100 / 57.107.100

libavformat    57. 83.100 / 57. 83.100

libavdevice    57. 10.100 / 57. 10.100

libavfilter     6.107.100 /  6.107.100

libavresample   3.  7.  0 /  3.  7.  0

libswscale      4.  8.100 /  4.  8.100

libswresample   2.  9.100 /  2.  9.100

libpostproc    54.  7.100 / 54.  7.100

输入流#0.1的猜测通道布局:单声道

Input #0, rtsp, from 'rtsp://admin:admin@192.168.1.9/mpeg4':

元数据:

title           : My MPEG4 Session

comment         : My MPEG4 info

持续时间:N / A,开始:0.000000,比特率:N / A

Stream #0:0: Video: mpeg4 (Simple Profile), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 30 tbr, 90k tbn, 30k tbc

Stream #0:1: Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s

流映射:

Stream #0:0 -> #0:0 (mpeg4 (native) -> h264 (libx264))

Stream #0:1 -> #0:1 (pcm_mulaw (native) -> aac (native))

Press [q] to stop, [?] for help

[aac @ 0x7fc303000600] Too many bits 8832.000000 > 6144 per frame requested, clamping to max

[libx264 @ 0x7fc301846800] using SAR=1/1

[libx264 @ 0x7fc301846800] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX

[libx264 @ 0x7fc301846800] profile High, level 3.0

[libx264 @ 0x7fc301846800] 264 - core 148 r2795 aaa9aa8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 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=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00

[segment @ 0x7fc301844400] Opening '0.mp4' for writing

输出#0,段,到'%d.mp4':

元数据:

title           : My MPEG4 Session

comment         : My MPEG4 info

encoder         : Lavf57.83.100

Stream #0:0: Video: h264 (libx264), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 30 fps, 15360 tbn, 30 tbc

Metadata:

  encoder         : Lavc57.107.100 libx264

Side data:

  cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1

Stream #0:1: Audio: aac (LC), 8000 Hz, mono, fltp, 48 kb/s

Metadata:

  encoder         : Lavc57.107.100 aac

frame=   57 fps=0.0 q=29.0 size=N/A time=00:00:02.04 bitrate=N/A dup=22 drop=0 sframe=   73 fps= 68 q=29.0 size=N/A time=00:00:02.56 bitrate=N/A dup=22 drop=0 s

frame=   89 fps= 54 q=29.0 size=N/A time=00:00:03.07 bitrate=N/A dup=22 drop=0 sframe=  106 fps= 48 q=29.0 size=N/A time=00:00:03.58 bitrate=N/A dup=22 drop=0 s

frame=  122 fps= 45 q=29.0 size=N/A time=00:00:04.09 bitrate=N/A dup=22 drop=0 sframe=  137 fps= 42 q=29.0 size=N/A time=00:00:04.48 bitrate=N/A dup=22 drop=0 s

frame=  151 fps= 40 q=29.0 size=N/A time=00:00:04.97 bitrate=N/A dup=22 drop=0 s

frame=  156 fps= 37 q=-1.0 Lsize=N/A time=00:00:05.48 bitrate=N/A dup=22 drop=0 speed= 1.3x  

更新:它在vlc播放器中运行良好。我正在添加指向已停用视频的链接:https://drive.google.com/file/d/1QCc7XUbePBI3v1h0sNQgU0guHA2AwgRT/view?usp=sharing

0 个答案:

没有答案