{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "fa5157fb",
   "metadata": {},
   "outputs": [],
   "source": [
    "from requests import get,post\n",
    "ip = \"http://192.168.0.66:5000\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "43974c05",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': 'ok'}"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "get(f\"{ip}/bash/health\").json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "842eee43",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'command': ['ls'],\n",
       " 'returncode': 0,\n",
       " 'stderr': '',\n",
       " 'stdout': 'app.py\\nblue\\nrequirements.txt\\n'}"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "post(f\"{ip}/bash/execute\",json={\"command\":['ls']}).json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "e304f10d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'command': 'docker exec zlmediakit ffmpeg -i /opt/media/bin/www/record/original-files/test.mp4 -vframes 1 -ss 00:00:01 -f image2 -y /opt/media/bin/www/record/covers/2.jpg.jpg',\n",
       " 'returncode': 0,\n",
       " 'stderr': \"ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers\\n  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)\\n  configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared\\n  libavutil      56. 31.100 / 56. 31.100\\n  libavcodec     58. 54.100 / 58. 54.100\\n  libavformat    58. 29.100 / 58. 29.100\\n  libavdevice    58.  8.100 / 58.  8.100\\n  libavfilter     7. 57.100 /  7. 57.100\\n  libavresample   4.  0.  0 /  4.  0.  0\\n  libswscale      5.  5.100 /  5.  5.100\\n  libswresample   3.  5.100 /  3.  5.100\\n  libpostproc    55.  5.100 / 55.  5.100\\nInput #0, mov,mp4,m4a,3gp,3g2,mj2, from '/opt/media/bin/www/record/original-files/test.mp4':\\n  Metadata:\\n    major_brand     : isom\\n    minor_version   : 512\\n    compatible_brands: isomiso2avc1mp41\\n    encoder         : Lavf58.20.100\\n  Duration: 00:01:09.77, start: 0.000000, bitrate: 963 kb/s\\n    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x592, 904 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)\\n    Metadata:\\n      handler_name    : Core Media Video\\n    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 51 kb/s (default)\\n    Metadata:\\n      handler_name    : Core Media Audio\\nStream mapping:\\n  Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))\\nPress [q] to stop, [?] for help\\n[swscaler @ 0x55d660af73c0] deprecated pixel format used, make sure you did set range correctly\\nOutput #0, image2, to '/opt/media/bin/www/record/covers/2.jpg.jpg':\\n  Metadata:\\n    major_brand     : isom\\n    minor_version   : 512\\n    compatible_brands: isomiso2avc1mp41\\n    encoder         : Lavf58.29.100\\n    Stream #0:0(und): Video: mjpeg, yuvj420p(pc), 1280x592, q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc (default)\\n    Metadata:\\n      handler_name    : Core Media Video\\n      encoder         : Lavc58.54.100 mjpeg\\n    Side data:\\n      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1\\nframe=    1 fps=0.0 q=8.3 Lsize=N/A time=00:00:00.03 bitrate=N/A speed=0.0609x    \\nvideo:51kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown\\n\",\n",
       " 'stdout': ''}"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "post(f\"{ip}/hls/capture\",json={\"source\":\"test.mp4\",\"image\":\"2.jpg\"}).json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "29970e8a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'data': {'command': 'docker exec zlmediakit ffmpeg -i /opt/media/bin/www/record/original-files/test.mp4 -vf \"scale=1920:1080:flags=lanczos\" -c:v libx264 -b:v 8000k -preset medium -profile:v high -level 4.0 -c:a aac -b:a 192k -ac 2 -f hls -hls_time 6 -hls_list_size 0 -hls_playlist_type vod -hls_segment_filename /opt/media/bin/www/record/hls/1080p/test08_%04d.ts -hls_base_url \"http://192.168.0.66:85/record/hls/1080p/\" -y /opt/media/bin/www/record/hls/menu/test08.m3u8',\n",
       "  'returncode': 0,\n",
       "  'stderr': \"ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers\\n  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)\\n  configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared\\n  libavutil      56. 31.100 / 56. 31.100\\n  libavcodec     58. 54.100 / 58. 54.100\\n  libavformat    58. 29.100 / 58. 29.100\\n  libavdevice    58.  8.100 / 58.  8.100\\n  libavfilter     7. 57.100 /  7. 57.100\\n  libavresample   4.  0.  0 /  4.  0.  0\\n  libswscale      5.  5.100 /  5.  5.100\\n  libswresample   3.  5.100 /  3.  5.100\\n  libpostproc    55.  5.100 / 55.  5.100\\nInput #0, mov,mp4,m4a,3gp,3g2,mj2, from '/opt/media/bin/www/record/original-files/test.mp4':\\n  Metadata:\\n    major_brand     : isom\\n    minor_version   : 512\\n    compatible_brands: isomiso2avc1mp41\\n    encoder         : Lavf58.20.100\\n  Duration: 00:01:09.77, start: 0.000000, bitrate: 963 kb/s\\n    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x592, 904 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)\\n    Metadata:\\n      handler_name    : Core Media Video\\n    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 51 kb/s (default)\\n    Metadata:\\n      handler_name    : Core Media Audio\\nStream mapping:\\n  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))\\n  Stream #0:1 -> #0:1 (aac (native) -> aac (native))\\nPress [q] to stop, [?] for help\\n[libx264 @ 0x55ace3c413c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX\\n[libx264 @ 0x55ace3c413c0] profile High, level 4.0\\n[libx264 @ 0x55ace3c413c0] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - 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=30 lookahead_threads=5 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=abr mbtree=1 bitrate=8000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00\\n[hls @ 0x55ace3c40980] Opening '/opt/media/bin/www/record/hls/1080p/test08_0000.ts' for writing\\nOutput #0, hls, to '/opt/media/bin/www/record/hls/menu/test08.m3u8':\\n  Metadata:\\n    major_brand     : isom\\n    minor_version   : 512\\n    compatible_brands: isomiso2avc1mp41\\n    encoder         : Lavf58.29.100\\n    Stream #0:0(und): Video: h264 (libx264), yuv420p, 1920x1080, q=-1--1, 8000 kb/s, 30 fps, 90k tbn, 30 tbc (default)\\n    Metadata:\\n      handler_name    : Core Media Video\\n      encoder         : Lavc58.54.100 libx264\\n    Side data:\\n      cpb: bitrate max/min/avg: 0/0/8000000 buffer size: 0 vbv_delay: -1\\n    Stream #0:1(und): Audio: aac (LC), 44100 Hz, stereo, fltp, 192 kb/s (default)\\n    Metadata:\\n      handler_name    : Core Media Audio\\n      encoder         : Lavc58.54.100 aac\\nframe=    8 fps=0.0 q=0.0 size=N/A time=00:00:00.69 bitrate=N/A speed=1.39x    \\nframe=   39 fps= 39 q=0.0 size=N/A time=00:00:01.76 bitrate=N/A speed=1.75x    \\nframe=   52 fps= 34 q=0.0 size=N/A time=00:00:02.18 bitrate=N/A speed=1.44x    \\nframe=   72 fps= 35 q=0.0 size=N/A time=00:00:02.85 bitrate=N/A speed=1.41x    \\nframe=   92 fps= 36 q=23.0 size=N/A time=00:00:03.52 bitrate=N/A speed=1.39x    \\nframe=  109 fps= 36 q=20.0 size=N/A time=00:00:04.08 bitrate=N/A speed=1.33x    \\nframe=  126 fps= 35 q=18.0 size=N/A time=00:00:04.64 bitrate=N/A speed= 1.3x    \\nframe=  140 fps= 34 q=16.0 size=N/A time=00:00:05.13 bitrate=N/A speed=1.26x    \\nframe=  149 fps= 32 q=15.0 size=N/A time=00:00:05.41 bitrate=N/A speed=1.18x    \\nframe=  159 fps= 31 q=14.0 size=N/A time=00:00:05.75 bitrate=N/A speed=1.12x    \\nframe=  171 fps= 30 q=13.0 size=N/A time=00:00:06.17 bitrate=N/A speed= 1.1x    \\nframe=  183 fps= 30 q=13.0 size=N/A time=00:00:06.54 bitrate=N/A speed=1.07x    \\nframe=  195 fps= 29 q=12.0 size=N/A time=00:00:06.96 bitrate=N/A speed=1.05x    \\nframe=  207 fps= 29 q=12.0 size=N/A time=00:00:07.36 bitrate=N/A speed=1.02x    \\nframe=  216 fps= 28 q=12.0 size=N/A time=00:00:07.63 bitrate=N/A speed=0.988x    \\nframe=  224 fps= 27 q=14.0 size=N/A time=00:00:07.91 bitrate=N/A speed=0.954x    \\nframe=  235 fps= 27 q=16.0 size=N/A time=00:00:08.28 bitrate=N/A speed=0.94x    \\nframe=  244 fps= 26 q=16.0 size=N/A time=00:00:08.59 bitrate=N/A speed=0.918x    \\nframe=  251 fps= 25 q=16.0 size=N/A time=00:00:08.82 bitrate=N/A speed=0.892x    \\nframe=  261 fps= 25 q=15.0 size=N/A time=00:00:09.14 bitrate=N/A speed=0.87x    \\nframe=  271 fps= 24 q=15.0 size=N/A time=00:00:09.49 bitrate=N/A speed=0.858x    \\nframe=  284 fps= 24 q=14.0 size=N/A time=00:00:09.91 bitrate=N/A speed=0.852x    \\nframe=  301 fps= 25 q=13.0 size=N/A time=00:00:10.49 bitrate=N/A speed=0.865x    \\nframe=  324 fps= 26 q=11.0 size=N/A time=00:00:11.26 bitrate=N/A speed=0.891x    \\nframe=  343 fps= 26 q=9.0 size=N/A time=00:00:11.88 bitrate=N/A speed=0.904x    \\nframe=  364 fps= 27 q=10.0 size=N/A time=00:00:12.56 bitrate=N/A speed=0.92x    \\n[hls @ 0x55ace3c40980] Opening '/opt/media/bin/www/record/hls/1080p/test08_0001.ts' for writing\\nframe=  385 fps= 27 q=10.0 size=N/A time=00:00:13.28 bitrate=N/A speed=0.937x    \\nframe=  399 fps= 27 q=11.0 size=N/A time=00:00:13.74 bitrate=N/A speed=0.935x    \\nframe=  411 fps= 27 q=11.0 size=N/A time=00:00:14.16 bitrate=N/A speed=0.931x    \\nframe=  428 fps= 27 q=10.0 size=N/A time=00:00:14.72 bitrate=N/A speed=0.937x    \\nframe=  441 fps= 27 q=10.0 size=N/A time=00:00:15.16 bitrate=N/A speed=0.935x    \\nframe=  455 fps= 27 q=11.0 size=N/A time=00:00:15.62 bitrate=N/A speed=0.934x    \\nframe=  471 fps= 27 q=10.0 size=N/A time=00:00:16.13 bitrate=N/A speed=0.937x    \\nframe=  483 fps= 27 q=10.0 size=N/A time=00:00:16.55 bitrate=N/A speed=0.933x    \\nframe=  500 fps= 27 q=9.0 size=N/A time=00:00:17.11 bitrate=N/A speed=0.938x    \\nframe=  518 fps= 28 q=8.0 size=N/A time=00:00:17.71 bitrate=N/A speed=0.943x    \\nframe=  534 fps= 28 q=7.0 size=N/A time=00:00:18.25 bitrate=N/A speed=0.946x    \\nframe=  547 fps= 28 q=7.0 size=N/A time=00:00:18.69 bitrate=N/A speed=0.944x    \\nframe=  557 fps= 27 q=7.0 size=N/A time=00:00:19.01 bitrate=N/A speed=0.935x    \\n[hls @ 0x55ace3c40980] Opening '/opt/media/bin/www/record/hls/1080p/test08_0002.ts' for writing\\nframe=  572 fps= 27 q=7.0 size=N/A time=00:00:19.52 bitrate=N/A speed=0.936x    \\nframe=  591 fps= 28 q=7.0 size=N/A time=00:00:20.15 bitrate=N/A speed=0.944x    \\nframe=  603 fps= 28 q=7.0 size=N/A time=00:00:20.57 bitrate=N/A speed=0.941x    \\nframe=  617 fps= 28 q=8.0 size=N/A time=00:00:21.01 bitrate=N/A speed=0.939x    \\nframe=  633 fps= 28 q=10.0 size=N/A time=00:00:21.57 bitrate=N/A speed=0.943x    \\nframe=  641 fps= 27 q=10.0 size=N/A time=00:00:21.82 bitrate=N/A speed=0.933x    \\nframe=  654 fps= 27 q=11.0 size=N/A time=00:00:22.24 bitrate=N/A speed=0.928x    \\nframe=  670 fps= 27 q=11.0 size=N/A time=00:00:22.77 bitrate=N/A speed=0.93x    \\nframe=  686 fps= 27 q=11.0 size=N/A time=00:00:23.28 bitrate=N/A speed=0.931x    \\nframe=  699 fps= 27 q=11.0 size=N/A time=00:00:23.75 bitrate=N/A speed=0.931x    \\n[hls @ 0x55ace3c40980] Opening '/opt/media/bin/www/record/hls/1080p/test08_0003.ts' for writing\\nframe=  720 fps= 28 q=12.0 size=N/A time=00:00:24.45 bitrate=N/A speed=0.94x    \\nframe=  735 fps= 28 q=11.0 size=N/A time=00:00:24.93 bitrate=N/A speed=0.94x    \\nframe=  754 fps= 28 q=11.0 size=N/A time=00:00:25.58 bitrate=N/A speed=0.945x    \\nframe=  774 fps= 28 q=10.0 size=N/A time=00:00:26.26 bitrate=N/A speed=0.952x    \\nframe=  795 fps= 28 q=10.0 size=N/A time=00:00:26.95 bitrate=N/A speed=0.96x    \\nframe=  817 fps= 29 q=9.0 size=N/A time=00:00:27.70 bitrate=N/A speed=0.969x    \\nframe=  841 fps= 29 q=8.0 size=N/A time=00:00:28.49 bitrate=N/A speed=0.979x    \\nframe=  864 fps= 29 q=7.0 size=N/A time=00:00:29.25 bitrate=N/A speed=0.988x    \\nframe=  886 fps= 29 q=6.0 size=N/A time=00:00:29.97 bitrate=N/A speed=0.996x    \\nframe=  912 fps= 30 q=5.0 size=N/A time=00:00:30.85 bitrate=N/A speed=1.01x    \\nframe=  934 fps= 30 q=7.0 size=N/A time=00:00:31.57 bitrate=N/A speed=1.01x    \\n[hls @ 0x55ace3c40980] Opening '/opt/media/bin/www/record/hls/1080p/test08_0004.ts' for writing\\nframe=  955 fps= 30 q=6.0 size=N/A time=00:00:32.29 bitrate=N/A speed=1.02x    \\nframe=  980 fps= 30 q=5.0 size=N/A time=00:00:33.11 bitrate=N/A speed=1.03x    \\nframe= 1001 fps= 31 q=5.0 size=N/A time=00:00:33.83 bitrate=N/A speed=1.04x    \\nframe= 1015 fps= 31 q=4.0 size=N/A time=00:00:34.27 bitrate=N/A speed=1.03x    \\nframe= 1035 fps= 31 q=4.0 size=N/A time=00:00:34.94 bitrate=N/A speed=1.04x    \\nframe= 1055 fps= 31 q=4.0 size=N/A time=00:00:35.59 bitrate=N/A speed=1.04x    \\nframe= 1074 fps= 31 q=5.0 size=N/A time=00:00:36.24 bitrate=N/A speed=1.05x    \\nframe= 1096 fps= 31 q=7.0 size=N/A time=00:00:36.98 bitrate=N/A speed=1.05x    \\nframe= 1105 fps= 31 q=8.0 size=N/A time=00:00:37.29 bitrate=N/A speed=1.04x    \\nframe= 1116 fps= 31 q=9.0 size=N/A time=00:00:37.66 bitrate=N/A speed=1.04x    \\nframe= 1121 fps= 30 q=10.0 size=N/A time=00:00:37.82 bitrate=N/A speed=1.03x    \\nframe= 1129 fps= 30 q=11.0 size=N/A time=00:00:38.08 bitrate=N/A speed=1.02x    \\nframe= 1143 fps= 30 q=12.0 size=N/A time=00:00:38.54 bitrate=N/A speed=1.02x    \\nframe= 1159 fps= 30 q=11.0 size=N/A time=00:00:39.07 bitrate=N/A speed=1.02x    \\nframe= 1177 fps= 30 q=12.0 size=N/A time=00:00:39.70 bitrate=N/A speed=1.02x    \\nframe= 1194 fps= 30 q=12.0 size=N/A time=00:00:40.24 bitrate=N/A speed=1.02x    \\n[hls @ 0x55ace3c40980] Opening '/opt/media/bin/www/record/hls/1080p/test08_0005.ts' for writing\\nframe= 1206 fps= 30 q=12.0 size=N/A time=00:00:40.65 bitrate=N/A speed=1.02x    \\nframe= 1223 fps= 30 q=11.0 size=N/A time=00:00:41.21 bitrate=N/A speed=1.02x    \\nframe= 1240 fps= 30 q=12.0 size=N/A time=00:00:41.79 bitrate=N/A speed=1.02x    \\nframe= 1250 fps= 30 q=12.0 size=N/A time=00:00:42.12 bitrate=N/A speed=1.02x    \\nframe= 1263 fps= 30 q=12.0 size=N/A time=00:00:42.56 bitrate=N/A speed=1.02x    \\n[hls @ 0x55ace3c40980] Opening '/opt/media/bin/www/record/hls/1080p/test08_0006.ts' for writing\\nframe= 1278 fps= 30 q=12.0 size=N/A time=00:00:43.04 bitrate=N/A speed=1.01x    \\nframe= 1300 fps= 30 q=12.0 size=N/A time=00:00:43.79 bitrate=N/A speed=1.02x    \\nframe= 1320 fps= 30 q=11.0 size=N/A time=00:00:44.44 bitrate=N/A speed=1.02x    \\nframe= 1335 fps= 30 q=12.0 size=N/A time=00:00:44.93 bitrate=N/A speed=1.02x    \\nframe= 1349 fps= 30 q=12.0 size=N/A time=00:00:45.41 bitrate=N/A speed=1.02x    \\nframe= 1363 fps= 30 q=12.0 size=N/A time=00:00:45.90 bitrate=N/A speed=1.02x    \\nframe= 1382 fps= 30 q=12.0 size=N/A time=00:00:46.53 bitrate=N/A speed=1.02x    \\nframe= 1401 fps= 30 q=12.0 size=N/A time=00:00:47.15 bitrate=N/A speed=1.02x    \\nframe= 1413 fps= 30 q=12.0 size=N/A time=00:00:47.55 bitrate=N/A speed=1.02x    \\nframe= 1434 fps= 30 q=12.0 size=N/A time=00:00:48.25 bitrate=N/A speed=1.03x    \\nframe= 1456 fps= 31 q=11.0 size=N/A time=00:00:48.99 bitrate=N/A speed=1.03x    \\nframe= 1480 fps= 31 q=11.0 size=N/A time=00:00:49.78 bitrate=N/A speed=1.03x    \\nframe= 1498 fps= 31 q=11.0 size=N/A time=00:00:50.38 bitrate=N/A speed=1.04x    \\nframe= 1518 fps= 31 q=11.0 size=N/A time=00:00:51.06 bitrate=N/A speed=1.04x    \\n[hls @ 0x55ace3c40980] Opening '/opt/media/bin/www/record/hls/1080p/test08_0007.ts' for writing\\nframe= 1543 fps= 31 q=10.0 size=N/A time=00:00:51.89 bitrate=N/A speed=1.04x    \\nframe= 1571 fps= 31 q=10.0 size=N/A time=00:00:52.82 bitrate=N/A speed=1.05x    \\nframe= 1594 fps= 31 q=9.0 size=N/A time=00:00:53.59 bitrate=N/A speed=1.06x    \\nframe= 1617 fps= 32 q=9.0 size=N/A time=00:00:54.35 bitrate=N/A speed=1.06x    \\nframe= 1636 fps= 32 q=9.0 size=N/A time=00:00:54.98 bitrate=N/A speed=1.06x    \\nframe= 1656 fps= 32 q=9.0 size=N/A time=00:00:55.65 bitrate=N/A speed=1.07x    \\nframe= 1679 fps= 32 q=9.0 size=N/A time=00:00:56.42 bitrate=N/A speed=1.07x    \\n[hls @ 0x55ace3c40980] Opening '/opt/media/bin/www/record/hls/1080p/test08_0008.ts' for writing\\nframe= 1701 fps= 32 q=9.0 size=N/A time=00:00:57.14 bitrate=N/A speed=1.07x    \\nframe= 1712 fps= 32 q=9.0 size=N/A time=00:00:57.53 bitrate=N/A speed=1.07x    \\nframe= 1733 fps= 32 q=9.0 size=N/A time=00:00:58.18 bitrate=N/A speed=1.07x    \\nframe= 1755 fps= 32 q=8.0 size=N/A time=00:00:58.95 bitrate=N/A speed=1.08x    \\nframe= 1777 fps= 32 q=8.0 size=N/A time=00:00:59.69 bitrate=N/A speed=1.08x    \\nframe= 1795 fps= 32 q=8.0 size=N/A time=00:01:00.30 bitrate=N/A speed=1.08x    \\nframe= 1814 fps= 32 q=8.0 size=N/A time=00:01:00.92 bitrate=N/A speed=1.08x    \\nframe= 1836 fps= 32 q=7.0 size=N/A time=00:01:01.64 bitrate=N/A speed=1.09x    \\nframe= 1859 fps= 32 q=7.0 size=N/A time=00:01:02.43 bitrate=N/A speed=1.09x    \\nframe= 1881 fps= 33 q=7.0 size=N/A time=00:01:03.15 bitrate=N/A speed=1.09x    \\nframe= 1907 fps= 33 q=7.0 size=N/A time=00:01:04.01 bitrate=N/A speed= 1.1x    \\nframe= 1923 fps= 33 q=7.0 size=N/A time=00:01:04.55 bitrate=N/A speed= 1.1x    \\n[hls @ 0x55ace3c40980] Opening '/opt/media/bin/www/record/hls/1080p/test08_0009.ts' for writing\\nframe= 1944 fps= 33 q=7.0 size=N/A time=00:01:05.22 bitrate=N/A speed= 1.1x    \\nframe= 1965 fps= 33 q=7.0 size=N/A time=00:01:05.96 bitrate=N/A speed= 1.1x    \\nframe= 1987 fps= 33 q=7.0 size=N/A time=00:01:06.66 bitrate=N/A speed=1.11x    \\n[hls @ 0x55ace3c40980] Opening '/opt/media/bin/www/record/hls/1080p/test08_0010.ts' for writing\\nframe= 1997 fps= 33 q=8.0 size=N/A time=00:01:07.01 bitrate=N/A speed= 1.1x    \\nframe= 2010 fps= 33 q=9.0 size=N/A time=00:01:07.45 bitrate=N/A speed= 1.1x    \\nframe= 2021 fps= 33 q=9.0 size=N/A time=00:01:07.82 bitrate=N/A speed= 1.1x    \\nframe= 2035 fps= 33 q=9.0 size=N/A time=00:01:08.28 bitrate=N/A speed=1.09x    \\nframe= 2043 fps= 32 q=9.0 size=N/A time=00:01:08.54 bitrate=N/A speed=1.09x    \\nframe= 2060 fps= 32 q=9.0 size=N/A time=00:01:09.10 bitrate=N/A speed=1.09x    \\nframe= 2075 fps= 32 q=9.0 size=N/A time=00:01:09.63 bitrate=N/A speed=1.09x    \\nframe= 2093 fps= 32 q=-1.0 Lsize=N/A time=00:01:09.72 bitrate=N/A speed=1.06x    \\nvideo:66051kB audio:1155kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown\\n[libx264 @ 0x55ace3c413c0] frame I:12    Avg QP: 2.05  size:159444\\n[libx264 @ 0x55ace3c413c0] frame P:742   Avg QP: 3.48  size: 59457\\n[libx264 @ 0x55ace3c413c0] frame B:1339  Avg QP: 5.34  size: 16135\\n[libx264 @ 0x55ace3c413c0] consecutive B-frames: 11.8%  7.5%  3.9% 76.8%\\n[libx264 @ 0x55ace3c413c0] mb I  I16..4: 73.9% 13.0% 13.1%\\n[libx264 @ 0x55ace3c413c0] mb P  I16..4:  8.1%  2.8%  2.7%  P16..4:  7.7%  2.2%  1.9%  0.0%  0.0%    skip:74.6%\\n[libx264 @ 0x55ace3c413c0] mb B  I16..4:  0.4%  0.2%  0.3%  B16..8:  6.3%  1.6%  0.8%  direct: 3.0%  skip:87.4%  L0:42.5% L1:47.2% BI:10.2%\\n[libx264 @ 0x55ace3c413c0] final ratefactor: 3.71\\n[libx264 @ 0x55ace3c413c0] 8x8 transform intra:20.3% inter:35.0%\\n[libx264 @ 0x55ace3c413c0] coded y,uvDC,uvAC intra: 36.7% 52.5% 51.1% inter: 4.5% 8.5% 7.0%\\n[libx264 @ 0x55ace3c413c0] i16 v,h,dc,p: 79% 18%  2%  1%\\n[libx264 @ 0x55ace3c413c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 37% 19% 25%  2%  4%  4%  3%  3%  2%\\n[libx264 @ 0x55ace3c413c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 38% 26% 13%  3%  5%  5%  4%  4%  3%\\n[libx264 @ 0x55ace3c413c0] i8c dc,h,v,p: 42% 24% 31%  3%\\n[libx264 @ 0x55ace3c413c0] Weighted P-Frames: Y:1.3% UV:1.3%\\n[libx264 @ 0x55ace3c413c0] ref P L0: 82.7%  5.6%  8.0%  3.7%  0.0%\\n[libx264 @ 0x55ace3c413c0] ref B L0: 91.5%  6.9%  1.6%\\n[libx264 @ 0x55ace3c413c0] ref B L1: 98.6%  1.4%\\n[libx264 @ 0x55ace3c413c0] kb/s:7755.61\\n[aac @ 0x55ace3cb17c0] Qavg: 65300.133\\n\",\n",
       "  'stdout': ''},\n",
       " 'msg': 'ok',\n",
       " 'success': True}"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "ename": "",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m在当前单元格或上一个单元格中执行代码时 Kernel 崩溃。\n",
      "\u001b[1;31m请查看单元格中的代码，以确定故障的可能原因。\n",
      "\u001b[1;31m单击<a href='https://aka.ms/vscodeJupyterKernelCrash'>此处</a>了解详细信息。\n",
      "\u001b[1;31m有关更多详细信息，请查看 Jupyter <a href='command:jupyter.viewOutput'>log</a>。"
     ]
    }
   ],
   "source": [
    "post(f\"{ip}/hls/2m3u8\",json={\"source\":\"test.mp4\",\"stream\":\"test08\"}).json()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
