Recherche avancée

Médias (0)

Mot : - Tags -/signalement

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (62)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

Sur d’autres sites (8190)

  • Can't convert .ts files that downloaded from .m3u8 file to mp4

    23 juin 2023, par smartnima

    I Have This Files :

    


    001.ts  014.ts  027.ts  040.ts  053.ts  066.ts  079.ts  092.ts  105.ts  118.ts  131.ts  144.ts  157.ts  170.ts  183.ts  196.ts  209.ts  222.ts  235.ts  248.ts  261.ts  274.ts  287.ts  300.ts  313.ts  326.ts
002.ts  015.ts  028.ts  041.ts  054.ts  067.ts  080.ts  093.ts  106.ts  119.ts  132.ts  145.ts  158.ts  171.ts  184.ts  197.ts  210.ts  223.ts  236.ts  249.ts  262.ts  275.ts  288.ts  301.ts  314.ts  327.ts
003.ts  016.ts  029.ts  042.ts  055.ts  068.ts  081.ts  094.ts  107.ts  120.ts  133.ts  146.ts  159.ts  172.ts  185.ts  198.ts  211.ts  224.ts  237.ts  250.ts  263.ts  276.ts  289.ts  302.ts  315.ts  328.ts
004.ts  017.ts  030.ts  043.ts  056.ts  069.ts  082.ts  095.ts  108.ts  121.ts  134.ts  147.ts  160.ts  173.ts  186.ts  199.ts  212.ts  225.ts  238.ts  251.ts  264.ts  277.ts  290.ts  303.ts  316.ts  329.ts
005.ts  018.ts  031.ts  044.ts  057.ts  070.ts  083.ts  096.ts  109.ts  122.ts  135.ts  148.ts  161.ts  174.ts  187.ts  200.ts  213.ts  226.ts  239.ts  252.ts  265.ts  278.ts  291.ts  304.ts  317.ts  330.ts
006.ts  019.ts  032.ts  045.ts  058.ts  071.ts  084.ts  097.ts  110.ts  123.ts  136.ts  149.ts  162.ts  175.ts  188.ts  201.ts  214.ts  227.ts  240.ts  253.ts  266.ts  279.ts  292.ts  305.ts  318.ts  331.ts
007.ts  020.ts  033.ts  046.ts  059.ts  072.ts  085.ts  098.ts  111.ts  124.ts  137.ts  150.ts  163.ts  176.ts  189.ts  202.ts  215.ts  228.ts  241.ts  254.ts  267.ts  280.ts  293.ts  306.ts  319.ts  332.ts
008.ts  021.ts  034.ts  047.ts  060.ts  073.ts  086.ts  099.ts  112.ts  125.ts  138.ts  151.ts  164.ts  177.ts  190.ts  203.ts  216.ts  229.ts  242.ts  255.ts  268.ts  281.ts  294.ts  307.ts  320.ts  333.ts
009.ts  022.ts  035.ts  048.ts  061.ts  074.ts  087.ts  100.ts  113.ts  126.ts  139.ts  152.ts  165.ts  178.ts  191.ts  204.ts  217.ts  230.ts  243.ts  256.ts  269.ts  282.ts  295.ts  308.ts  321.ts  334.ts
010.ts  023.ts  036.ts  049.ts  062.ts  075.ts  088.ts  101.ts  114.ts  127.ts  140.ts  153.ts  166.ts  179.ts  192.ts  205.ts  218.ts  231.ts  244.ts  257.ts  270.ts  283.ts  296.ts  309.ts  322.ts
011.ts  024.ts  037.ts  050.ts  063.ts  076.ts  089.ts  102.ts  115.ts  128.ts  141.ts  154.ts  167.ts  180.ts  193.ts  206.ts  219.ts  232.ts  245.ts  258.ts  271.ts  284.ts  297.ts  310.ts  323.ts
012.ts  025.ts  038.ts  051.ts  064.ts  077.ts  090.ts  103.ts  116.ts  129.ts  142.ts  155.ts  168.ts  181.ts  194.ts  207.ts  220.ts  233.ts  246.ts  259.ts  272.ts  285.ts  298.ts  311.ts  324.ts
013.ts  026.ts  039.ts  052.ts  065.ts  078.ts  091.ts  104.ts  117.ts  130.ts  143.ts  156.ts  169.ts  182.ts  195.ts  208.ts  221.ts  234.ts  247.ts  260.ts  273.ts  286.ts  299.ts  312.ts  325.ts


    


    That I Downloaded With This Python Program (m3u8 File Does Not Work !) :

    


    import requests
import shutil
import os
import subprocess


def strip_end(text, suffix):
    if not text.endswith(suffix):
        return text
    return text[:len(text)-len(suffix)]


def download_file(url):
    cwd = os.getcwd()
    command = f"wget -O {cwd}/ts_files/{url.split('/')[-1]} {url}"
    subprocess.call(command, shell=True)


base_url = "https://stream.example.com/video/2021/example/720p_{}.ts"

if not os.path.exists('ts_files'):
    print('ts_file folder is not found, creating the folder.')
    os.makedirs('ts_files')

i = 1
while True:
    if len(str(i)) == 1:
        num = f"00{i}"
    elif len(str(i)) == 2:
        num = f"0{i}"
    else:
        num = str(i)
    url = base_url.replace("{}", num)
    r = requests.get(url, stream=True)
    print(f'downloading {i}')
    if r.status_code != 404:
        download_file(url)  # comment out this line to download ts files.
    else:
        print("404")
        break
    i = i+1

cwd = os.getcwd()  # Get the current working directory (cwd)
TS_DIR = 'ts_files'
with open('merged.ts', 'wb') as merged:
    for ts_file in os.listdir(f'{cwd}/{TS_DIR}'):
        with open(f'{cwd}/{TS_DIR}/{ts_file}', 'rb') as mergefile:
            shutil.copyfileobj(mergefile, merged)



    


    My Problem Is When I Want To Convert All This Files To One .ts File And Then An MP4 File With ffmpeg, I Get An Error :

    


    nima@funlife:~/ts_files$ cat ./*.ts > all.ts
nima@funlife:~/ts_files$ ffmpeg -i all.ts -acodec copy -vcodec copy all.mp4
ffmpeg version 5.0.1-3+b1 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11 (Debian 11.3.0-4)
  configuration: --prefix=/usr --extra-version=3+b1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libplacebo --enable-libx264 --enable-shared
  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
all.ts: Invalid data found when processing input


    


    .ts Files Content Is Like This :

    


     }��,.g���}��
             �����c����Ww�c���c���eo��m�����ŧ�  䱉
�b(+��D�FG�zPe��7�&#bz�1ɶ���                      C
�`,��>Ϲc4J��̀��T�I}�"��ކ�R�1��w͋�   "� <�#B`ƪ�̸�co
                                             �9���+��W�
P���N���w��T\5g��
\�E�N�E�v��͑4f��U�@]�ΩX�U�x�E��bwm=ְ�iA�����p���M�����\=�_�I3C�hL�h����0)�ο��*��`���eZ� �ؗ4To�0V��S,�+�>�8_]�W�lNJD�|7e�2s�1X)̃5�0h�������~8ߩg���?e��EK�>۷�L
             ��:6|������>\  �N�WW��,�w
bk��1?*��/��/�5��k����~��                 Lޕ}�a���2�{��l��$�d=����g�{a2��L�����
                         jҫַ��ʿ�"1`ZZ.he)�=�x��E_4:Vg�����H=���x1�����}��W::y�


    


    Are They Encrypted Or Something ?
I'm Trying To Do This Works With Debian 11.3.0-4, Python 3.10.5

    


    Edit : Thanks Johnny, I Saw This Post : How to concatenate two MP4 files using FFmpeg ?
I Tried But I Get An Error Again !

    


    nima@funlife:~/ts_files$ ffmpeg -f concat -i file.txt -c copy output.ts
ffmpeg version 5.0.1-3+b1 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11 (Debian 11.3.0-4)
  configuration: --prefix=/usr --extra-version=3+b1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libplacebo --enable-libx264 --enable-shared
  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
[concat @ 0x55932dbf2500] Impossible to open '001.ts'
file.txt: Invalid data found when processing input


    


    Same Error With ffmpeg -f concat -safe 0 -i file.txt -c copy output.ts

    


    file.txt is The List Of Files !

    


  • How to fix laggy ffmpeg screen and audio capture ?

    26 juillet 2022, par Wh0r00t

    I am using ffmpeg to capture the screen along with audio.

    


    The ffmpeg command that i tried is

    


    ffmpeg -y \
    -f x11grab \
    -framerate 60 \
    -s 1366x768 \
    -i :0.0 \
    -f alsa -i default -ac 2 \
    -r 30 \
    -c:v h264 -crf 0 -preset ultrafast -c:a vorbis -strict experimental  \
    "$HOME/Videos/$fname-$(date '+%y%m%d-%H%M-%S').mkv"


    


    The stdout of the ffmpeg https://pastebin.com/Qmi5TMKv

    


    ffmpeg version n5.0.1 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12.1.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
[x11grab @ 0x561faf77eb00] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, x11grab, from ':0.0':
  Duration: N/A, start: 1658814267.169414, bitrate: 2014248 kb/s
  Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1366x768, 2014248 kb/s, 60 fps, 1000k tbr, 1000k tbn
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, alsa, from 'default':
  Duration: N/A, start: 1658814267.230653, bitrate: 1536 kb/s
  Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> vorbis (native))
Press [q] to stop, [?] for help
[libx264 @ 0x561faf7d4300] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX XOP FMA3 BMI1
[libx264 @ 0x561faf7d4300] profile High 4:4:4 Predictive, level 3.2, 4:4:4, 8-bit
[libx264 @ 0x561faf7d4300] 264 - core 164 r3081 19856cc - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=0 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=0 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=cqp mbtree=0 qp=0
[alsa @ 0x561faf78a940] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
Output #0, matroska, to '/home/earth/Videos/-220726-1114-27.mkv':
  Metadata:
    encoder         : Lavf59.16.100
  Stream #0:0: Video: h264 (H264 / 0x34363248), yuv444p(tv, progressive), 1366x768, q=2-31, 30 fps, 1k tbn
    Metadata:
      encoder         : Lavc59.18.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
  Stream #0:1: Audio: vorbis (oV[0][0] / 0x566F), 48000 Hz, stereo, fltp
    Metadata:
      encoder         : Lavc59.18.100 vorbis
[vorbis @ 0x561faf7d5500] Queue input is backward in time0 bitrate=N/A speed=   0x
frame=  153 fps= 31 q=-1.0 Lsize=    2295kB time=00:00:05.06 bitrate=3709.5kbits/s dup=0 drop=150 speed=1.01x
video:2282kB audio:7kB subtitle:0kB other streams:0kB global headers:3kB muxing overhead: 0.281689%
[libx264 @ 0x561faf7d4300] frame I:1     Avg QP: 0.00  size:381729
[libx264 @ 0x561faf7d4300] frame P:152   Avg QP: 0.00  size: 12857
[libx264 @ 0x561faf7d4300] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 0x561faf7d4300] mb P  I16..4: 56.3%  0.0%  0.0%  P16..4:  0.1%  0.0%  0.0%  0.0%  0.0%    skip:43.6%
[libx264 @ 0x561faf7d4300] coded y,u,v intra: 1.6% 1.6% 1.6% inter: 0.2% 0.2% 0.2%
[libx264 @ 0x561faf7d4300] i16 v,h,dc,p: 99%  1%  0%  0%
[libx264 @ 0x561faf7d4300] kb/s:3664.27
Exiting normally, received signal 15.


    


    I am using the preset ultrafast because I read that it helps not to compress the video too much.
The output of the recorded test file using ffmpeg is as below.

    


     (+) Video --vid=1 (h264 1366x768 30.000fps)
 (+) Audio --aid=1 (vorbis 2ch 48000Hz)
AO: [pulse] 48000Hz stereo 2ch float
VO: [gpu] 1366x768 yuv444p
AV: 00:00:03 / 00:00:19 (17%) A-V:  0.000
[mkv] Discarding potentially broken or useless index.
AV: 00:00:14 / 00:00:19 (73%) A-V:  0.000

Exiting... (Quit)


    


    The recording works but there is a audio lag. If I record the same using simplescreenrecorder with the same settings like,

    


    audio backend - alsa

    


    source - default

    


    audio codec - vorbis

    


    video codec - h.264

    


    container - matroska

    


    preset - superfast

    


    The simplescreenrecorder log https://pastebin.com/83hMMRQF

    


    [PageRecord::StartPage] Starting page ...
[PageRecord::StartPage] Started page.
[PageRecord::StartOutput] Starting output ...
[PageRecord::StartOutput] Output file: /home/earth/Videos/simplescreenrecorder-2022-07-26_11.18.13.mkv
[Muxer::Init] Using format matroska (Matroska).
[Muxer::AddStream] Using codec libx264 (libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10).
[VideoEncoder::PrepareStream] Using pixel format nv12.
[libx264 @ 0x563436cbfd40] using SAR=1/1
[libx264 @ 0x563436cbfd40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX XOP FMA3 BMI1
[libx264 @ 0x563436cbfd40] profile High, level 3.2, 4:2:0, 8-bit
[libx264 @ 0x563436cbfd40] 264 - core 164 r3081 19856cc - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x3 me=dia subme=1 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=4 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=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 pb_ratio=1.30 aq=1:1.00
[Muxer::AddStream] Using codec libvorbis (libvorbis).
[BaseEncoder::EncoderThread] Encoder thread started.
[AudioEncoder::PrepareStream] Using sample format f32p.
[BaseEncoder::EncoderThread] Encoder thread started.
[Muxer::MuxerThread] Muxer thread started.
[PageRecord::StartOutput] Started output.
[Synchronizer::SynchronizerThread] Synchronizer thread started.
[PageRecord::StartInput] Starting input ...
[X11Input::Init] Using X11 shared memory.
[X11Input::Init] Detecting screen configuration ...
[X11Input::Init] Screen 0: x1 = 0, y1 = 0, x2 = 1366, y2 = 768
[X11Input::InputThread] Input thread started.
[ALSAInput::InputThread] Using sample format s16.
[PageRecord::StartInput] Started input.
[ALSAInput::InputThread] Input thread started.
[FastResampler::Resample] Resample ratio is 1.0000 (was 0.0000).
[PageRecord::StopOutput] Stopping output ...
[PageRecord::StopOutput] Stopped output.
[PageRecord::StopInput] Stopping input ...
[X11Input::~X11Input] Stopping input thread ...
[X11Input::InputThread] Input thread stopped.
[ALSAInput::~ALSAInput] Stopping input thread ...
[ALSAInput::InputThread] Input thread stopped.
[PageRecord::StopInput] Stopped input.


    


    It works perfectly without any lag whatsoever. The output of the recorded test file using simplescreenrecorder is as below.

    


     (+) Video --vid=1 (h264 1366x768)
 (+) Audio --aid=1 (vorbis 2ch 48000Hz)
AO: [pulse] 48000Hz stereo 2ch float
VO: [gpu] 1366x768 yuv420p
AV: 00:00:01 / 00:00:17 (7%) A-V:  0.000
[mkv] Discarding potentially broken or useless index.
AV: 00:00:08 / 00:00:17 (47%) A-V:  0.000

Exiting... (Quit)


    


    The only difference that I saw between these two recordings is VO: [gpu] 1366x768 yuv444p
VO: [gpu] 1366x768 yuv420p for ffmpeg and simplescreenrecorder receptively.
I do not know if this matters but is there something that I could tweak to make ffmpeg to capture the screen and audio without any lag.
Like answered here https://unix.stackexchange.com/questions/675436/ffmpeg-recording-slows-down-when-audio-inputs-are-added
I do open pavucontrol but its not much of a help.

    


    The reason that I going with ffmpeg is because I can kill the process using pid at a particular time using cronjobs.
These are my system information, in case if it helps

    


    System:
  Host: taco Kernel: 5.18.12-arch1-1 arch: x86_64 bits: 64 Desktop: dwm
    v: 6.2 Distro: Arch Linux
Machine:
  Type: Desktop Mobo: Acer model: A75F2-M v: P21-A1 serial: N/A BIOS: Acer
    v: P21-A1 date: 02/07/2014
CPU:
  Info: quad core model: AMD A8-5500B APU with Radeon HD Graphics bits: 64
    type: MT MCP cache: L2: 4 MiB
  Speed (MHz): avg: 1400 min/max: 1400/3200 cores: 1: 1400 2: 1400 3: 1400
    4: 1400
Graphics:
  Device-1: AMD Trinity [Radeon HD 7560D] driver: radeon v: kernel
  Display: server: X.Org v: 21.1.4 driver: X: loaded: modesetting
    gpu: radeon resolution: 1366x768~60Hz
  OpenGL: renderer: AMD ARUBA (DRM 2.50.0 / 5.18.12-arch1-1 LLVM 14.0.6)
    v: 4.3 Mesa 22.1.3
Audio:
  Device-1: AMD FCH Azalia driver: snd_hda_intel
  Sound Server-1: ALSA v: k5.18.12-arch1-1 running: yes
  Sound Server-2: PulseAudio v: 16.1 running: yes
  Sound Server-3: PipeWire v: 0.3.56 running: yes


    


    Any help is much appreciated.

    


  • Metadict in ffmpeg does not have rotate information

    14 juillet 2022, par Lucky Sunda

    My aim is to extract frames out of a video but many times the frames are inverted. This is happening because "VideoCapture" in cv2 does read the rotate flag data present in the video metadata. I am running it on mac and installed "ffmpeg" package (5.0.1) using brew package manager. This is my code to check rotation present in a video using ffmpeg.

    


    import ffmpeg 
import cv2   
import pprint 
pp = pprint.PrettyPrinter(depth=4)
def check_rotation(path_video_file):
    # this returns meta-data of the video file in form of a dictionary
    meta_dict = ffmpeg.probe(path_video_file)
    pp.pprint(meta_dict)

    # from the dictionary, meta_dict['streams'][0]['tags']['rotate'] is the key
    # we are looking for
    rotateCode = None
    if int(meta_dict['streams'][0]['tags']['rotate']) == 90:
        rotateCode = cv2.ROTATE_90_CLOCKWISE
    elif int(meta_dict['streams'][0]['tags']['rotate']) == 180:
        rotateCode = cv2.ROTATE_180
    elif int(meta_dict['streams'][0]['tags']['rotate']) == 270:
        rotateCode = cv2.ROTATE_90_COUNTERCLOCKWISE

    return rotateCode



    


    Here the meta_dict is supposed to have information about the rotation but it is not there.
printing out meta_dict gives :

    


    {'format': {'bit_rate': '18498544',
            'duration': '3.584000',
            'filename': 'video.mp4',
            'format_long_name': 'QuickTime / MOV',
            'format_name': 'mov,mp4,m4a,3gp,3g2,mj2',
            'nb_programs': 0,
            'nb_streams': 2,
            'probe_score': 100,
            'size': '8287348',
            'start_time': '0.000000',
            'tags': {'com.android.version': '11',
                     'compatible_brands': 'isommp42',
                     'creation_time': '2021-12-08T10:56:57.000000Z',
                     'major_brand': 'mp42',
                     'minor_version': '0'}},
 'streams': [{'avg_frame_rate': '990000/34997',
              'bit_rate': '18804651',
              'bits_per_raw_sample': '8',
              'chroma_location': 'left',
              'closed_captions': 0,
              'codec_long_name': 'H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10',
              'codec_name': 'h264',
              'codec_tag': '0x31637661',
              'codec_tag_string': 'avc1',
              'codec_type': 'video',
              'coded_height': 1080,
              'coded_width': 1920,
              'color_primaries': 'bt470bg',
              'color_range': 'pc',
              'color_space': 'bt470bg',
              'color_transfer': 'smpte170m',
              'display_aspect_ratio': '16:9',
              'disposition': {'attached_pic': 0,
                              'captions': 0,
                              'clean_effects': 0,
                              'comment': 0,
                              'default': 1,
                              'dependent': 0,
                              'descriptions': 0,
                              'dub': 0,
                              'forced': 0,
                              'hearing_impaired': 0,
                              'karaoke': 0,
                              'lyrics': 0,
                              'metadata': 0,
                              'original': 0,
                              'still_image': 0,
                              'timed_thumbnails': 0,
                              'visual_impaired': 0},
              'duration': '3.499700',
              'duration_ts': 314973,
              'extradata_size': 35,
              'field_order': 'progressive',
              'film_grain': 0,
              'has_b_frames': 0,
              'height': 1080,
              'id': '0x1',
              'index': 0,
              'is_avc': 'true',
              'level': 40,
              'nal_length_size': '4',
              'nb_frames': '99',
              'pix_fmt': 'yuvj420p',
              'profile': 'High',
              'r_frame_rate': '120/1',
              'refs': 1,
              'sample_aspect_ratio': '1:1',
              'side_data_list': [{...}],
              'start_pts': 3168,
              'start_time': '0.035200',
              'tags': {'creation_time': '2021-12-08T10:56:57.000000Z',
                       'handler_name': 'VideoHandle',
                       'language': 'eng',
                       'vendor_id': '[0][0][0][0]'},
              'time_base': '1/90000',
              'width': 1920},
             {'avg_frame_rate': '0/0',
              'bit_rate': '128986',
              'bits_per_sample': 0,
              'channel_layout': 'stereo',
              'channels': 2,
              'codec_long_name': 'AAC (Advanced Audio Coding)',
              'codec_name': 'aac',
              'codec_tag': '0x6134706d',
              'codec_tag_string': 'mp4a',
              'codec_type': 'audio',
              'disposition': {'attached_pic': 0,
                              'captions': 0,
                              'clean_effects': 0,
                              'comment': 0,
                              'default': 1,
                              'dependent': 0,
                              'descriptions': 0,
                              'dub': 0,
                              'forced': 0,
                              'hearing_impaired': 0,
                              'karaoke': 0,
                              'lyrics': 0,
                              'metadata': 0,
                              'original': 0,
                              'still_image': 0,
                              'timed_thumbnails': 0,
                              'visual_impaired': 0},
              'duration': '3.584000',
              'duration_ts': 172032,
              'extradata_size': 2,
              'id': '0x2',
              'index': 1,
              'nb_frames': '168',
              'profile': 'LC',
              'r_frame_rate': '0/0',
              'sample_fmt': 'fltp',
              'sample_rate': '48000',
              'start_pts': 0,
              'start_time': '0.000000',
              'tags': {'creation_time': '2021-12-08T10:56:57.000000Z',
                       'handler_name': 'SoundHandle',
                       'language': 'eng',
                       'vendor_id': '[0][0][0][0]'},
              'time_base': '1/48000'}]}


    


    Can someone please help me to find if rotation is present in a video ?