Приветствую
Продолжаю мучать перекодировку из mjpeg в libx264 с отдачей в rtsp
Запускаю ffmpeg с параметрами и смотрю на другой локальной машине в ffplay (или через rtsp-simple-server в vlc)
# ./ffmpeg -f v4l2 -input_format mjpeg -video_size 640x480 -i /dev/video0 -c:v libx264 -pix_fmt yuv422p -preset ultrafast -r 30 -b:v 500k -minrate:v 300k -maxrate:v 500k -bufsize 1000k -f rtsp -rtsp_transport udp rtsp://192.168.36.212:554/cam
ffmpeg version N-107213-gfed07ef Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.12) 20160609
  configuration: --prefix=/usr --enable-nonfree --enable-gpl --enable-version3 --enable-libx264 --enable-libv4l2 --disable-libxcb --disable-vaapi --disable-bzlib --disable-zlib --disable-postproc --disable-xlib
  libavutil      57. 27.100 / 57. 27.100
  libavcodec     59. 33.100 / 59. 33.100
  libavformat    59. 25.100 / 59. 25.100
  libavdevice    59.  6.100 / 59.  6.100
  libavfilter     8. 41.100 /  8. 41.100
  libswscale      6.  6.100 /  6.  6.100
  libswresample   4.  6.100 /  4.  6.100
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 260677.910302, bitrate: N/A
  Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc, bt470bg/unknown/unknown), 640x480, 30 fps, 30 tbr, 1000k tbn
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[swscaler @ 0x14b65c0] [swscaler @ 0x14bfb20] deprecated pixel format used, make sure you did set range correctly
................
[swscaler @ 0x14b65c0] [swscaler @ 0x1536f00] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0x14a0b40] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x14a0b40] profile High 4:2:2, level 3.0, 4:2:2 8-bit
[libx264 @ 0x14a0b40] 264 - core 148 r2643 5c65704 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.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=6 lookahead_threads=1 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_lookahead=0 rc=cbr mbtree=0 bitrate=500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=500 vbv_bufsize=1000 nal_hrd=none filler=0 ip_ratio=1.40 aq=0
Output #0, rtsp, to 'rtsp://192.168.36.212:554/cam':
  Metadata:
    encoder         : Lavf59.25.100
  Stream #0:0: Video: h264, yuv422p(tv, bt470bg/unknown/unknown, progressive), 640x480, q=2-31, 500 kb/s, 30 fps, 90k tbn
    Metadata:
      encoder         : Lavc59.33.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 500000/0/500000 buffer size: 1000000 vbv_delay: N/A
frame=  964 fps= 29 q=26.0 size=N/A time=00:00:31.86 bitrate=N/A dup=227 drop=0 speed=0.957x
Выхлоп ffplay
Input #0, rtsp, from 'rtsp://192.168.36.212:554/cam':    0B f=0/0   
  Metadata:
    title           : No Name
  Duration: N/A, start: 0.130000, bitrate: N/A
    Stream #0:0: Video: h264 (High 4:2:2), yuv422p(tv, bt470bg/unknown/unknown), 640x480, 30 fps, 30 tbr, 90k tbn, 60 tbc
 117.44 M-V: -0.030 fd=   5 aq=    0KB vq=   11KB sq=    0B f=1/1ВСЕ ИДЕАЛЬНО!!! сравнительно конечно
запускаю свой говнокод, дампы
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 260917.808496, bitrate: N/A
  Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc, bt470bg/unknown/unknown), 640x480, 30 fps, 30 tbr, 1000k tbn
[libx264 @ 0x14e82c0] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x14e82c0] profile High 4:2:2, level 3.0, 4:2:2 8-bit
[libx264 @ 0x14e82c0] 264 - core 148 r2643 5c65704 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.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=6 lookahead_threads=1 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_lookahead=0 rc=cbr mbtree=0 bitrate=500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=500 vbv_bufsize=1000 nal_hrd=none filler=0 ip_ratio=1.40 aq=0
Output #0, rtsp, to 'rtsp://192.168.36.212:554/cam':
  Stream #0:0: Video: h264, yuv422p, 640x480, q=2-31, 500 kb/s, 90k tbn
Выхлоп ffplay
Input #0, rtsp, from 'rtsp://192.168.36.212:554/cam':    0B f=0/0   
  Metadata:
    title           : No Name
  Duration: N/A, start: 0.406333, bitrate: N/A
    Stream #0:0: Video: h264 (High 4:2:2), yuv422p, 640x480, 30 fps, 30 tbr, 90k tbn, 60 tbc
   7.28 M-V:  7.655 fd= 147 aq=    0KB vq=    0KB sq=    0B f=727/727И с середины изображения сыпется вниз и тормоза...
Подскажите, если есть телепаты куда смотреть, замучался уже гадать.



