Recherche avancée

Médias (1)

Mot : - Tags -/ogv

Autres articles (87)

Sur d’autres sites (16254)

  • checkasm/hevc_pel : Fix stack buffer overreads

    28 septembre 2021, par Andreas Rheinhardt
    checkasm/hevc_pel : Fix stack buffer overreads
    

    This patch increases several stack buffers in order to fix
    stack-buffer-overflows (e.g. in put_hevc_qpel_uni_hv_9 in
    line 814 of hevcdsp_template.c) detected with ASAN in the hevc_pel
    checkasm test.
    The buffers are increased by the minimal amount necessary
    in order not to mask potential future bugs.

    Reviewed-by : Martin Storsjö <martin@martin.st>
    Reviewed-by : "zhilizhao(赵志立)" <quinkblack@foxmail.com>
    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>

    • [DH] tests/checkasm/hevc_pel.c
  • FFmpeg uses too much memory when repeating split, select, overlay

    13 novembre 2020, par finefoot

    I'm running

    &#xA;

    ffmpeg -i input.mp4 -filter_complex_script script.txt output.mp4&#xA;

    &#xA;

    with the following minimal example script :

    &#xA;

    split[tmp],&#xA;select=&#x27;between(t,1,2)&#x27;,&#xA;select=&#x27;between(n,0,1)&#x27;,&#xA;[tmp]overlay=enable=&#x27;between(t,1,2)&#x27;:eof_action=repeat,&#xA;split[tmp],&#xA;select=&#x27;between(t,3,4)&#x27;,&#xA;select=&#x27;between(n,0,1)&#x27;,&#xA;[tmp]overlay=enable=&#x27;between(t,3,4)&#x27;:eof_action=repeat&#xA;

    &#xA;

    What I want to do is to take 1 frame at a certain position and repeat it for a certain duration, basically "pausing" the video, while overwriting to keep the same output length. In the example, I'm doing this twice : I'm using split[tmp] to get a second input stream to work on, select the time at position 00:01 with select=&#x27;between(t,1,2)&#x27;, select the first frame from that position with select=&#x27;between(n,0,1)&#x27; and finally overlay that frame over the input. This repeats for a second time at position 00:03. I have tested this and it does exactly what I'm looking for.

    &#xA;

    However, in my real script, I'm repeating this about 1000 times for different positions in the stream (and for shorter durations than 1 second) which results in running out of memory. What am I doing wrong ? What can I do to optimize ?

    &#xA;

  • Pipe numpy array to virtual video device

    16 mars 2021, par sre

    I want to pipe images to a virtual video device (e.g. /dev/video0), the images are created inside a loop with the desired frame rate.

    &#xA;

    In this minimal example i only two arrays which alternate in the cv2 window. Now i look for a good solution to pipe the arrays to the virtual device.

    &#xA;

    I saw that ffmpeg-python can run asynchronous with ffmpeg.run_async(), but so far i could not make anything work with this package.

    &#xA;

    example code without the ffmpeg stuff :

    &#xA;

    #!/usr/bin/env python3&#xA;&#xA;import cv2&#xA;import numpy as np&#xA;import time&#xA;&#xA;window_name = &#x27;virtual-camera&#x27;&#xA;cv2.namedWindow(window_name, cv2.WINDOW_GUI_EXPANDED)&#xA;&#xA;img1 = np.random.uniform(0, 255, (1080, 1440, 3)).astype(&#x27;uint8&#x27;)&#xA;img2 = np.random.uniform(0, 255, (1080, 1440, 3)).astype(&#x27;uint8&#x27;)&#xA;&#xA;for i in range(125):&#xA;    time.sleep(0.04)&#xA;    if i % 2:&#xA;        img = img1&#xA;    else:&#xA;        img = img2&#xA;    cv2.imshow(window_name, img)&#xA;    cv2.waitKey(1)&#xA;cv2.destroyAllWindows()&#xA;

    &#xA;