Я читаю прямую трансляцию с IP-камеры DKSEG, но результаты не очень хорошие ...
Вот командная строка, используемая для этого:
./ffmpeg -i "http://192.168.0.29/videostream.asf?user=admin&pwd=&resolution=64&rate=0" \
-vcodec libx264 -r 20 -s 320x240 -threads 2 -vprofile baseline -vpre zoom \
-strict experimental -acodec aac -ab 96000 -ar 48000 -ac 1 \
-f rtsp rtsp://54.232.999.999:1935/live/_definst_/c3
zoom.ffpreset:
coder=1
level=31
maxrate=1200000
bufsize=200000
wpredp=0
g=60
refs=1
subq=3
trellis=0
bf=0
rc_lookahead=0
Даже когда я сохраняю в файл mp4, результаты не очень хорошие, с некоторыми пробелами в видео. Какие-нибудь проблемы? предложения?
Вот результат выполнения (спасибо @lordneckbeard):
ffmpeg version 2.0.1 Copyright (c) 2000-2013 the FFmpeg developers
built on Aug 15 2013 10:56:46 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 --arch=x86_64 --enable-runtime-cpudetect
libavutil 52. 38.100 / 52. 38.100
libavcodec 55. 18.102 / 55. 18.102
libavformat 55. 12.100 / 55. 12.100
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 79.101 / 3. 79.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, asf, from 'http://192.168.0.29/videostream.asf?user=admin&pwd=&resolution=64&rate=0':
Duration: N/A, start: 0.000000, bitrate: 32 kb/s
Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p, 640x480, 25 tbr, 1k tbn, 1k tbc
Stream #0:1: Audio: adpcm_ima_wav ([17][0][0][0] / 0x0011), 8000 Hz, mono, s16p, 32 kb/s
Codec AVOption rc_lookahead (Number of frames to look ahead for alternate reference frame selection) specified for output file #0 (rtsp://54.232.999.999:1935/live/_definst_/c3) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
No pixel format specified, yuvj420p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x7fd73b82fa00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.1 Cache64
[libx264 @ 0x7fd73b82fa00] profile Constrained Baseline, level 3.1
[libx264 @ 0x7fd73b82fa00] 264 - core 133 - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=3 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=2 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=60 keyint_min=6 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1200 vbv_bufsize=200 crf_max=0.0 nal_hrd=none ip_ratio=1.40 aq=1:1.00
Output #0, rtsp, to 'rtsp://54.232.999.999:1935/live/_definst_/c3':
Metadata:
encoder : Lavf55.12.100
Stream #0:0: Video: h264 (libx264), yuvj420p, 320x240, q=-1--1, 90k tbn, 20 tbc
Stream #0:1: Audio: aac, 48000 Hz, mono, fltp, 96 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg -> libx264)
Stream #0:1 -> #0:1 (adpcm_ima_wav -> aac)
Press [q] to stop, [?] for help
Multiple frames in a packet from stream 1
frame= 986 fps= 43 q=28.0 size=N/A time=00:00:49.38 bitrate=N/A dup=811 drop=0
ffmpeg -i http://input -c:v libx264 -an output.mp4
(обратите внимание на локальный выходной файл для тестирования вместо RTMP).ffplay
или черезffmpeg
с SDL или XV (возможно , не х на OS X) устройства вывода.