Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (38)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (5486)

  • C# on linux : FFmpeg (FFMediaToolkit) MediaOutput..Video.AddFrame(FrameToImageData(ImageData)) causes program to exit with code 139

    19 mai 2021, par Jan Černý

    In my C# program I have instance of MediaOutput from FFMediaToolkit. It is initialized like this :

    


    MediaOutput buffer = MediaBuilder.CreateContainer(videoPath).WithVideo(new VideoEncoderSettings(width: width,
                height: height, framerate: frameRate,
                codec: VideoCodec.H264)
            ).Create();


    


    When I want to add frame to buffer I use this code :

    


    private static ImageData FrameToImageData(Bitmap bitmap) {
    Rectangle rect = new Rectangle(System.Drawing.Point.Empty, bitmap.Size);
    BitmapData bitLock = bitmap.LockBits(rect, ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
    ImageData bitmapImageData = ImageData.FromPointer(bitLock.Scan0, ImagePixelFormat.Bgr24, bitmap.Size);
    bitmap.UnlockBits(bitLock);
    return bitmapImageData;
}

public void AddFrame(Bitmap frame) {
    buffer.Video.AddFrame(FrameToImageData(frame));
}


    


    But when code reaches buffer.Video.AddFrame(); it exits with code 139 without throwing any exception.

    


    I have two test files and only one is causing it. One is .png file 100x100 and it works fine. The other is .png file 1000x1000 and it makes program exit as soon as it reaches this method.

    


    What exit code 139 means in C# ?
    
How can I diagnose this problem when it is not throwing any exceptions ?
    
How can I fix it ?

    


    Thank you for help. If you need any more information, leave a comment and I will add it soon as possible.

    


    Edit1 :
    
This is my instel drivers :

    


    john@arch-thinkpad ~> yay -Qs intel
local/intel-gmmlib 21.1.1-1
    Intel Graphics Memory Management Library
local/intel-media-driver 21.1.3-1
    Intel Media Driver for VAAPI — Broadwell+ iGPUs
local/intel-media-sdk 21.1.3-1
    API to access hardware-accelerated video on Intel Gen graphics hardware platforms
local/intel-mkl 2020.4.304-1
    Intel Math Kernel Library
local/intel-ucode 20210216-1
    Microcode update files for Intel CPUs
local/intellij-idea-ultimate-edition 2021.1.1-1
    An intelligent IDE for Java, Groovy and other programming languages with advanced refactoring features intensely focused on developer productivity.
local/libmfx 21.1.3-1
    Intel Media SDK dispatcher library
local/libva-intel-driver 2.4.1-1
    VA-API implementation for Intel G45 and HD Graphics family
local/onednn 2.2.2-1
    oneAPI Deep Neural Network Library (oneDNN)
local/tbb 2020.3-1
    High level abstract threading library
local/xf86-video-intel 1:2.99.917+916+g31486f40-1 (xorg-drivers)
    X.org Intel i810/i830/i915/945G/G965+ video drivers


    


    EDIT2 :

    


    [17091.524781] Slimulator[20962]: segfault at 7fd84003a011 ip 00007fd8400cd348 sp 00007ffddd9d7fb8 error 4 in libswscale.so.5.9.100[7fd840062000+75000]
[17091.524791] Code: 45 85 c0 0f 8e 58 01 00 00 41 8d 40 ff 49 89 cc 48 89 d5 48 89 f9 48 89 44 24 f8 44 89 c0 31 f6 48 89 44 24 e0 0f 1f 44 00 00 <0f> b6 41 01 44 0f b6 41 02 48 83 c1 06 44 8b 7c 24 d4 8b 54 24 d8
[17091.524829] audit: type=1701 audit(1621440058.690:188): auid=1000 uid=1000 gid=1000 ses=1 pid=20962 comm="Slimulator" exe="/home/john/Projects/Slimulator/bin/Debug/net5.0/Slimulator" sig=11 res=1
[17091.546116] audit: type=1334 audit(1621440058.713:189): prog-id=61 op=LOAD
[17091.546209] audit: type=1334 audit(1621440058.713:190): prog-id=62 op=LOAD
[17091.546262] audit: type=1334 audit(1621440058.713:191): prog-id=63 op=LOAD
[17091.547395] audit: type=1130 audit(1621440058.713:192): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@6-20996-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17094.458151] audit: type=1131 audit(1621440061.623:193): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@6-20996-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17094.542823] audit: type=1334 audit(1621440061.710:194): prog-id=63 op=UNLOAD
[17094.542832] audit: type=1334 audit(1621440061.710:195): prog-id=62 op=UNLOAD
[17094.542836] audit: type=1334 audit(1621440061.710:196): prog-id=61 op=UNLOAD
[17295.099124] Slimulator[21147]: segfault at 7f555b1de011 ip 00007f555b271348 sp 00007fff48239f48 error 4 in libswscale.so.5.9.100[7f555b206000+75000]
[17295.099132] Code: 45 85 c0 0f 8e 58 01 00 00 41 8d 40 ff 49 89 cc 48 89 d5 48 89 f9 48 89 44 24 f8 44 89 c0 31 f6 48 89 44 24 e0 0f 1f 44 00 00 <0f> b6 41 01 44 0f b6 41 02 48 83 c1 06 44 8b 7c 24 d4 8b 54 24 d8
[17295.099197] audit: type=1701 audit(1621440262.267:197): auid=1000 uid=1000 gid=1000 ses=1 pid=21147 comm="Slimulator" exe="/home/john/Projects/Slimulator/bin/Debug/net5.0/Slimulator" sig=11 res=1
[17295.108536] audit: type=1334 audit(1621440262.277:198): prog-id=64 op=LOAD
[17295.108679] audit: type=1334 audit(1621440262.277:199): prog-id=65 op=LOAD
[17295.108752] audit: type=1334 audit(1621440262.277:200): prog-id=66 op=LOAD
[17295.109589] audit: type=1130 audit(1621440262.277:201): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@7-21181-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17297.322989] audit: type=1131 audit(1621440264.487:202): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@7-21181-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17297.401409] audit: type=1334 audit(1621440264.571:203): prog-id=66 op=UNLOAD
[17297.401421] audit: type=1334 audit(1621440264.571:204): prog-id=65 op=UNLOAD
[17297.401426] audit: type=1334 audit(1621440264.571:205): prog-id=64 op=UNLOAD
[17353.331142] Slimulator[21281]: segfault at 7f35f1fd3011 ip 00007f35f2066348 sp 00007ffe7d1288e8 error 4 in libswscale.so.5.9.100[7f35f1ffb000+75000]
[17353.331160] Code: 45 85 c0 0f 8e 58 01 00 00 41 8d 40 ff 49 89 cc 48 89 d5 48 89 f9 48 89 44 24 f8 44 89 c0 31 f6 48 89 44 24 e0 0f 1f 44 00 00 <0f> b6 41 01 44 0f b6 41 02 48 83 c1 06 44 8b 7c 24 d4 8b 54 24 d8
[17353.331214] audit: type=1701 audit(1621440320.498:206): auid=1000 uid=1000 gid=1000 ses=1 pid=21281 comm="Slimulator" exe="/home/john/Projects/Slimulator/bin/Debug/net5.0/Slimulator" sig=11 res=1
[17353.344382] audit: type=1334 audit(1621440320.511:207): prog-id=67 op=LOAD
[17353.344518] audit: type=1334 audit(1621440320.511:208): prog-id=68 op=LOAD
[17353.344566] audit: type=1334 audit(1621440320.511:209): prog-id=69 op=LOAD
[17353.345651] audit: type=1130 audit(1621440320.511:210): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@8-21378-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17356.180885] audit: type=1131 audit(1621440323.345:211): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@8-21378-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17356.261051] audit: type=1334 audit(1621440323.428:212): prog-id=69 op=UNLOAD
[17356.261055] audit: type=1334 audit(1621440323.428:213): prog-id=68 op=UNLOAD
[17356.261057] audit: type=1334 audit(1621440323.428:214): prog-id=67 op=UNLOAD
[17379.499165] Slimulator[21454]: segfault at 7f68418a1011 ip 00007f6841934348 sp 00007ffea9f22eb8 error 4 in libswscale.so.5.9.100[7f68418c9000+75000]
[17379.499174] Code: 45 85 c0 0f 8e 58 01 00 00 41 8d 40 ff 49 89 cc 48 89 d5 48 89 f9 48 89 44 24 f8 44 89 c0 31 f6 48 89 44 24 e0 0f 1f 44 00 00 <0f> b6 41 01 44 0f b6 41 02 48 83 c1 06 44 8b 7c 24 d4 8b 54 24 d8
[17379.499245] audit: type=1701 audit(1621440346.665:215): auid=1000 uid=1000 gid=1000 ses=1 pid=21454 comm="Slimulator" exe="/home/john/Projects/Slimulator/bin/Debug/net5.0/Slimulator" sig=11 res=1
[17379.509368] audit: type=1334 audit(1621440346.675:216): prog-id=70 op=LOAD
[17379.509448] audit: type=1334 audit(1621440346.675:217): prog-id=71 op=LOAD
[17379.509481] audit: type=1334 audit(1621440346.675:218): prog-id=72 op=LOAD
[17379.510098] audit: type=1130 audit(1621440346.675:219): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@9-21492-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17381.661151] audit: type=1131 audit(1621440348.828:220): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@9-21492-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17381.740919] audit: type=1334 audit(1621440348.908:221): prog-id=72 op=UNLOAD
[17381.740924] audit: type=1334 audit(1621440348.908:222): prog-id=71 op=UNLOAD
[17381.740926] audit: type=1334 audit(1621440348.908:223): prog-id=70 op=UNLOAD
[17389.743524] Slimulator[21565]: segfault at 7f95075a4011 ip 00007f9507637348 sp 00007ffccfab3f18 error 4 in libswscale.so.5.9.100[7f95075cc000+75000]
[17389.743535] Code: 45 85 c0 0f 8e 58 01 00 00 41 8d 40 ff 49 89 cc 48 89 d5 48 89 f9 48 89 44 24 f8 44 89 c0 31 f6 48 89 44 24 e0 0f 1f 44 00 00 <0f> b6 41 01 44 0f b6 41 02 48 83 c1 06 44 8b 7c 24 d4 8b 54 24 d8
[17389.743613] audit: type=1701 audit(1621440356.908:224): auid=1000 uid=1000 gid=1000 ses=1 pid=21565 comm="Slimulator" exe="/home/john/Projects/Slimulator/bin/Debug/net5.0/Slimulator" sig=11 res=1
[17389.753604] audit: type=1334 audit(1621440356.918:225): prog-id=73 op=LOAD
[17389.753783] audit: type=1334 audit(1621440356.918:226): prog-id=74 op=LOAD
[17389.753847] audit: type=1334 audit(1621440356.918:227): prog-id=75 op=LOAD
[17389.755847] audit: type=1130 audit(1621440356.921:228): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@10-21600-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17392.121917] audit: type=1131 audit(1621440359.288:229): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@10-21600-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17392.204160] audit: type=1334 audit(1621440359.371:230): prog-id=75 op=UNLOAD
[17392.204167] audit: type=1334 audit(1621440359.371:231): prog-id=74 op=UNLOAD
[17392.204169] audit: type=1334 audit(1621440359.371:232): prog-id=73 op=UNLOAD
[17409.596374] Slimulator[21674]: segfault at 7fddab4c5011 ip 00007fddab558348 sp 00007ffe55e75e28 error 4 in libswscale.so.5.9.100[7fddab4ed000+75000]
[17409.596383] Code: 45 85 c0 0f 8e 58 01 00 00 41 8d 40 ff 49 89 cc 48 89 d5 48 89 f9 48 89 44 24 f8 44 89 c0 31 f6 48 89 44 24 e0 0f 1f 44 00 00 <0f> b6 41 01 44 0f b6 41 02 48 83 c1 06 44 8b 7c 24 d4 8b 54 24 d8
[17409.596441] audit: type=1701 audit(1621440376.762:233): auid=1000 uid=1000 gid=1000 ses=1 pid=21674 comm="Slimulator" exe="/home/john/Projects/Slimulator/bin/Debug/net5.0/Slimulator" sig=11 res=1
[17409.606014] audit: type=1334 audit(1621440376.772:234): prog-id=76 op=LOAD
[17409.606096] audit: type=1334 audit(1621440376.772:235): prog-id=77 op=LOAD
[17409.606139] audit: type=1334 audit(1621440376.772:236): prog-id=78 op=LOAD
[17409.606845] audit: type=1130 audit(1621440376.772:237): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@11-21706-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17411.977651] audit: type=1131 audit(1621440379.145:238): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@11-21706-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17412.074091] audit: type=1334 audit(1621440379.242:239): prog-id=78 op=UNLOAD
[17412.074098] audit: type=1334 audit(1621440379.242:240): prog-id=77 op=UNLOAD
[17412.074101] audit: type=1334 audit(1621440379.242:241): prog-id=76 op=UNLOAD
[17431.213606] Slimulator[21785]: segfault at 7f218cdca011 ip 00007f218ce5d348 sp 00007ffffd122a98 error 4 in libswscale.so.5.9.100[7f218cdf2000+75000]
[17431.213616] Code: 45 85 c0 0f 8e 58 01 00 00 41 8d 40 ff 49 89 cc 48 89 d5 48 89 f9 48 89 44 24 f8 44 89 c0 31 f6 48 89 44 24 e0 0f 1f 44 00 00 <0f> b6 41 01 44 0f b6 41 02 48 83 c1 06 44 8b 7c 24 d4 8b 54 24 d8
[17431.213648] audit: type=1701 audit(1621440398.378:242): auid=1000 uid=1000 gid=1000 ses=1 pid=21785 comm="Slimulator" exe="/home/john/Projects/Slimulator/bin/Debug/net5.0/Slimulator" sig=11 res=1
[17431.223086] audit: type=1334 audit(1621440398.388:243): prog-id=79 op=LOAD
[17431.223210] audit: type=1334 audit(1621440398.388:244): prog-id=80 op=LOAD
[17431.223272] audit: type=1334 audit(1621440398.388:245): prog-id=81 op=LOAD
[17431.224003] audit: type=1130 audit(1621440398.392:246): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@12-21817-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17433.560362] audit: type=1131 audit(1621440400.725:247): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@12-21817-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17433.620924] audit: type=1334 audit(1621440400.788:248): prog-id=81 op=UNLOAD
[17433.620929] audit: type=1334 audit(1621440400.788:249): prog-id=80 op=UNLOAD
[17433.620931] audit: type=1334 audit(1621440400.788:250): prog-id=79 op=UNLOAD
[17636.068527] audit: type=1701 audit(1621440603.236:251): auid=1000 uid=1000 gid=1000 ses=1 pid=22189 comm="Slimulator" exe="/home/john/Projects/Slimulator/bin/Debug/net5.0/Slimulator" sig=6 res=1
[17636.075124] audit: type=1334 audit(1621440603.243:252): prog-id=82 op=LOAD
[17636.075299] audit: type=1334 audit(1621440603.243:253): prog-id=83 op=LOAD
[17636.075334] audit: type=1334 audit(1621440603.243:254): prog-id=84 op=LOAD
[17636.075947] audit: type=1130 audit(1621440603.246:255): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@13-22213-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17636.859400] audit: type=1131 audit(1621440604.030:256): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@13-22213-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17636.952582] audit: type=1334 audit(1621440604.123:257): prog-id=84 op=UNLOAD
[17636.952586] audit: type=1334 audit(1621440604.123:258): prog-id=83 op=UNLOAD
[17636.952587] audit: type=1334 audit(1621440604.123:259): prog-id=82 op=UNLOAD
[17683.442450] Slimulator[22349]: segfault at 7fce7b840011 ip 00007fce7b8d3348 sp 00007ffdf12fde88 error 4 in libswscale.so.5.9.100[7fce7b868000+75000]
[17683.442461] Code: 45 85 c0 0f 8e 58 01 00 00 41 8d 40 ff 49 89 cc 48 89 d5 48 89 f9 48 89 44 24 f8 44 89 c0 31 f6 48 89 44 24 e0 0f 1f 44 00 00 <0f> b6 41 01 44 0f b6 41 02 48 83 c1 06 44 8b 7c 24 d4 8b 54 24 d8
[17683.442489] audit: type=1701 audit(1621440650.613:260): auid=1000 uid=1000 gid=1000 ses=1 pid=22349 comm="Slimulator" exe="/home/john/Projects/Slimulator/bin/Debug/net5.0/Slimulator" sig=11 res=1
[17683.451485] audit: type=1334 audit(1621440650.620:261): prog-id=85 op=LOAD
[17683.451530] audit: type=1334 audit(1621440650.620:262): prog-id=86 op=LOAD
[17683.451561] audit: type=1334 audit(1621440650.620:263): prog-id=87 op=LOAD
[17683.452200] audit: type=1130 audit(1621440650.620:264): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@14-22400-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17685.702716] audit: type=1131 audit(1621440652.873:265): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@14-22400-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17685.789205] audit: type=1334 audit(1621440652.960:266): prog-id=87 op=UNLOAD
[17685.789209] audit: type=1334 audit(1621440652.960:267): prog-id=86 op=UNLOAD
[17685.789211] audit: type=1334 audit(1621440652.960:268): prog-id=85 op=UNLOAD
[17741.587367] audit: type=1701 audit(1621440708.757:269): auid=1000 uid=1000 gid=1000 ses=1 pid=22506 comm="Slimulator" exe="/home/john/Projects/Slimulator/bin/Debug/net5.0/Slimulator" sig=6 res=1
[17741.597924] audit: type=1334 audit(1621440708.767:270): prog-id=88 op=LOAD
[17741.597991] audit: type=1334 audit(1621440708.767:271): prog-id=89 op=LOAD
[17741.598017] audit: type=1334 audit(1621440708.767:272): prog-id=90 op=LOAD
[17741.598635] audit: type=1130 audit(1621440708.770:273): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@15-22533-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17743.536566] audit: type=1131 audit(1621440710.707:274): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@15-22533-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17743.645445] audit: type=1334 audit(1621440710.817:275): prog-id=90 op=UNLOAD
[17743.645456] audit: type=1334 audit(1621440710.817:276): prog-id=89 op=UNLOAD
[17743.645460] audit: type=1334 audit(1621440710.817:277): prog-id=88 op=UNLOAD
[17826.501073] Slimulator[22630]: segfault at 7efff17b2011 ip 00007efff1845348 sp 00007ffe58353908 error 4 in libswscale.so.5.9.100[7efff17da000+75000]
[17826.501081] Code: 45 85 c0 0f 8e 58 01 00 00 41 8d 40 ff 49 89 cc 48 89 d5 48 89 f9 48 89 44 24 f8 44 89 c0 31 f6 48 89 44 24 e0 0f 1f 44 00 00 <0f> b6 41 01 44 0f b6 41 02 48 83 c1 06 44 8b 7c 24 d4 8b 54 24 d8
[17826.501144] audit: type=1701 audit(1621440793.671:278): auid=1000 uid=1000 gid=1000 ses=1 pid=22630 comm="Slimulator" exe="/home/john/Projects/Slimulator/bin/Debug/net5.0/Slimulator" sig=11 res=1
[17826.508176] audit: type=1334 audit(1621440793.681:279): prog-id=91 op=LOAD
[17826.508254] audit: type=1334 audit(1621440793.681:280): prog-id=92 op=LOAD
[17826.508285] audit: type=1334 audit(1621440793.681:281): prog-id=93 op=LOAD
[17826.508907] audit: type=1130 audit(1621440793.681:282): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@16-22667-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17828.821665] audit: type=1131 audit(1621440795.994:283): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@16-22667-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[17828.911512] audit: type=1334 audit(1621440796.084:284): prog-id=93 op=UNLOAD
[17828.911523] audit: type=1334 audit(1621440796.084:285): prog-id=92 op=UNLOAD
[17828.911528] audit: type=1334 audit(1621440796.084:286): prog-id=91 op=UNLOAD
[18255.197203] Slimulator[23128]: segfault at 7f44e8746011 ip 00007f44e87d9348 sp 00007ffdfc25d318 error 4 in libswscale.so.5.9.100[7f44e876e000+75000]
[18255.197213] Code: 45 85 c0 0f 8e 58 01 00 00 41 8d 40 ff 49 89 cc 48 89 d5 48 89 f9 48 89 44 24 f8 44 89 c0 31 f6 48 89 44 24 e0 0f 1f 44 00 00 <0f> b6 41 01 44 0f b6 41 02 48 83 c1 06 44 8b 7c 24 d4 8b 54 24 d8
[18255.197237] audit: type=1701 audit(1621441222.370:287): auid=1000 uid=1000 gid=1000 ses=1 pid=23128 comm="Slimulator" exe="/home/john/Projects/Slimulator/bin/Debug/net5.0/Slimulator" sig=11 res=1
[18255.205057] audit: type=1334 audit(1621441222.376:288): prog-id=94 op=LOAD
[18255.205138] audit: type=1334 audit(1621441222.376:289): prog-id=95 op=LOAD
[18255.205165] audit: type=1334 audit(1621441222.376:290): prog-id=96 op=LOAD
[18255.206164] audit: type=1130 audit(1621441222.380:291): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@17-23164-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[18257.792719] audit: type=1131 audit(1621441224.967:292): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@17-23164-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[18257.862155] audit: type=1334 audit(1621441225.037:293): prog-id=96 op=UNLOAD
[18257.862159] audit: type=1334 audit(1621441225.037:294): prog-id=95 op=UNLOAD
[18257.862161] audit: type=1334 audit(1621441225.037:295): prog-id=94 op=UNLOAD
[18312.879423] audit: type=1334 audit(1621441280.053:296): prog-id=97 op=LOAD
[18312.879566] audit: type=1334 audit(1621441280.053:297): prog-id=98 op=LOAD
[18312.879634] audit: type=1334 audit(1621441280.053:298): prog-id=99 op=LOAD
[18312.918107] audit: type=1130 audit(1621441280.090:299): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hostnamed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[18342.984220] audit: type=1131 audit(1621441310.157:300): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hostnamed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[18343.084948] audit: type=1334 audit(1621441310.260:301): prog-id=99 op=UNLOAD
[18343.084955] audit: type=1334 audit(1621441310.260:302): prog-id=98 op=UNLOAD
[18343.084959] audit: type=1334 audit(1621441310.260:303): prog-id=97 op=UNLOAD
[18527.198876] Slimulator[23504]: segfault at 7fd59543e011 ip 00007fd5954d1348 sp 00007ffcc5d59e78 error 4 in libswscale.so.5.9.100[7fd595466000+75000]
[18527.198885] Code: 45 85 c0 0f 8e 58 01 00 00 41 8d 40 ff 49 89 cc 48 89 d5 48 89 f9 48 89 44 24 f8 44 89 c0 31 f6 48 89 44 24 e0 0f 1f 44 00 00 <0f> b6 41 01 44 0f b6 41 02 48 83 c1 06 44 8b 7c 24 d4 8b 54 24 d8
[18527.198911] audit: type=1701 audit(1621441494.371:304): auid=1000 uid=1000 gid=1000 ses=1 pid=23504 comm="Slimulator" exe="/home/john/Projects/Slimulator/bin/Debug/net5.0/Slimulator" sig=11 res=1
[18527.207861] audit: type=1334 audit(1621441494.381:305): prog-id=100 op=LOAD
[18527.207959] audit: type=1334 audit(1621441494.381:306): prog-id=101 op=LOAD
[18527.207996] audit: type=1334 audit(1621441494.381:307): prog-id=102 op=LOAD
[18527.208682] audit: type=1130 audit(1621441494.381:308): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@18-23538-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[18530.192509] audit: type=1131 audit(1621441497.364:309): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@18-23538-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[18530.274214] audit: type=1334 audit(1621441497.448:310): prog-id=102 op=UNLOAD
[18530.274221] audit: type=1334 audit(1621441497.448:311): prog-id=101 op=UNLOAD
[18530.274224] audit: type=1334 audit(1621441497.448:312): prog-id=100 op=UNLOAD
[18788.989941] i915 0000:00:02.0: [drm] *ERROR* Atomic update failure on pipe B (start=1126979 end=1126980) time 153 us, min 1073, max 1079, scanline start 1072, end 1082
[18793.024933] audit: type=1334 audit(1621441760.199:313): prog-id=103 op=LOAD
[18793.025042] audit: type=1334 audit(1621441760.199:314): prog-id=104 op=LOAD
[18793.025082] audit: type=1334 audit(1621441760.199:315): prog-id=105 op=LOAD
[18793.061481] audit: type=1130 audit(1621441760.235:316): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hostnamed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[18823.124309] audit: type=1131 audit(1621441790.299:317): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hostnamed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[18823.193828] audit: type=1334 audit(1621441790.369:318): prog-id=105 op=UNLOAD
[18823.193847] audit: type=1334 audit(1621441790.369:319): prog-id=104 op=UNLOAD
[18823.193856] audit: type=1334 audit(1621441790.369:320): prog-id=103 op=UNLOAD
[19615.817516] Slimulator[24574]: segfault at 7fb94cbbd011 ip 00007fb94cc50348 sp 00007fffefd935c8 error 4 in libswscale.so.5.9.100[7fb94cbe5000+75000]
[19615.817524] Code: 45 85 c0 0f 8e 58 01 00 00 41 8d 40 ff 49 89 cc 48 89 d5 48 89 f9 48 89 44 24 f8 44 89 c0 31 f6 48 89 44 24 e0 0f 1f 44 00 00 <0f> b6 41 01 44 0f b6 41 02 48 83 c1 06 44 8b 7c 24 d4 8b 54 24 d8
[19615.817544] audit: type=1701 audit(1621442582.996:321): auid=1000 uid=1000 gid=1000 ses=1 pid=24574 comm="Slimulator" exe="/home/john/Projects/Slimulator/bin/Debug/net5.0/Slimulator" sig=11 res=1
[19615.825508] audit: type=1334 audit(1621442583.002:322): prog-id=106 op=LOAD
[19615.825620] audit: type=1334 audit(1621442583.002:323): prog-id=107 op=LOAD
[19615.825652] audit: type=1334 audit(1621442583.002:324): prog-id=108 op=LOAD
[19615.826425] audit: type=1130 audit(1621442583.006:325): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@19-24609-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[19617.863304] audit: type=1131 audit(1621442585.043:326): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@19-24609-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[19617.939124] audit: type=1334 audit(1621442585.119:327): prog-id=108 op=UNLOAD
[19617.939129] audit: type=1334 audit(1621442585.119:328): prog-id=107 op=UNLOAD
[19617.939132] audit: type=1334 audit(1621442585.119:329): prog-id=106 op=UNLOAD
[20633.629288] Slimulator[25687]: segfault at 7fed842b8011 ip 00007fed8434b348 sp 00007ffcbf0f45d8 error 4 in libswscale.so.5.9.100[7fed842e0000+75000]
[20633.629298] Code: 45 85 c0 0f 8e 58 01 00 00 41 8d 40 ff 49 89 cc 48 89 d5 48 89 f9 48 89 44 24 f8 44 89 c0 31 f6 48 89 44 24 e0 0f 1f 44 00 00 <0f> b6 41 01 44 0f b6 41 02 48 83 c1 06 44 8b 7c 24 d4 8b 54 24 d8
[20633.629328] audit: type=1701 audit(1621443600.811:330): auid=1000 uid=1000 gid=1000 ses=1 pid=25687 comm="Slimulator" exe="/home/john/Projects/Slimulator/bin/Debug/net5.0/Slimulator" sig=11 res=1
[20633.640886] audit: type=1334 audit(1621443600.824:331): prog-id=109 op=LOAD
[20633.640985] audit: type=1334 audit(1621443600.824:332): prog-id=110 op=LOAD
[20633.641017] audit: type=1334 audit(1621443600.824:333): prog-id=111 op=LOAD
[20633.641934] audit: type=1130 audit(1621443600.824:334): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@20-25722-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[20636.303870] audit: type=1131 audit(1621443603.488:335): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@20-25722-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[20636.410990] audit: type=1334 audit(1621443603.594:336): prog-id=111 op=UNLOAD
[20636.411006] audit: type=1334 audit(1621443603.594:337): prog-id=110 op=UNLOAD
[20636.411014] audit: type=1334 audit(1621443603.594:338): prog-id=109 op=UNLOAD


    


  • How to set crontab in order to run multiple python and a shell scripts ?

    5 janvier 2021, par Alexander Mitsou

    I need to start three python3 scripts and a shell script using crontab. These scripts should run at the same time without any delay. Each script runs exactly for one minute. For instance I have scheduled crontab to run these scripts every 5 minutes.

    


    My problem is that, if I attempt to run each script individually from terminal it executes with no further errors, but using crontab nothing happens.

    


    DISCLAIMER : If I set up the Python3 scripts individually in crontab, they work fine !

    


    Here's my crontab set up :

    


    */5 * * * * cd /home/user/Desktop/ && /usr/bin/python3 script1.py >> report1.log

*/5 * * * * cd /home/user/Desktop/ && /usr/bin/python3 script2.py >> report2.log

*/5 * * * * cd /home/user/Desktop/ && /usr/bin/python3 script3.py >> report3.log

*/5 * * * * cd /home/user/Desktop/ && /usr/bin/sh script4.sh >> report4.log 


    


    In addition I need to mention that the shell script contains this command (FFMPEG) :

    


    #!/bin/bash

parent_dir=`dirname \`pwd\`` 
folder_name="/Data/Webcam" 
new_path=$parent_dir$folder_name  


if [ -d "$new_path" ]; then
    echo "video_audio folder exists..."
else
    echo "Creating video_audio folder in the current directory..."
    mkdir -p -- "$new_path"
    sudo chmod 777 "$new_path"
    echo "Folder created"
    echo
fi

now=$(date +%F) 
now="$( echo -e "$now" | tr  '-' '_'  )"
sub_dir=$new_path'/'$now 

if [ -d "$sub_dir" ]; then
    echo "Date Sub-directory exists..."
    echo
else
    echo "Error: ${sub_dir} not found..."
    echo "Creating date sub-directory..."
    mkdir -p -- "$sub_dir"
    sudo chmod 777 "$sub_dir"
    echo "Date sub-directory created..."
    echo
fi

fname=$(date +%H_%M_%S)".avi"
video_dir=$sub_dir'/'$fname
ffmpeg -f pulse -ac 1 -i default -f v4l2 -i  /dev/video0 -vcodec libx264 -t 00:01:00 $video_dir 


    


    The log file of that script contain the following :

    


    video_audio folder exists...
Date Sub-directory exists...

Package ffmpeg is already installed...
Package v4l-utils is already installed...

Package: ffmpeg
Status: install ok installed
Priority: optional
Section: video
Installed-Size: 2010
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Multi-Arch: foreign
Version: 7:4.2.4-1ubuntu0.1
Replaces: libav-tools (<< 6:12~~), qt-faststart (<< 7:2.7.1-3~)
Depends: libavcodec58 (= 7:4.2.4-1ubuntu0.1), libavdevice58 (= 7:4.2.4-1ubuntu0.1), libavfilter7 (= 7:4.2.4-1ubuntu0.1), libavformat58 (= 7:4.2.4-1ubuntu0.1), libavresample4 (= 7:4.2.4-1ubuntu0.1), libavutil56 (= 7:4.2.4-1ubuntu0.1), libc6 (>= 2.29), libpostproc55 (= 7:4.2.4-1ubuntu0.1), libsdl2-2.0-0 (>= 2.0.10), libswresample3 (= 7:4.2.4-1ubuntu0.1), libswscale5 (= 7:4.2.4-1ubuntu0.1)
Suggests: ffmpeg-doc
Breaks: libav-tools (<< 6:12~~), qt-faststart (<< 7:2.7.1-3~), winff (<< 1.5.5-5~)
Description: Tools for transcoding, streaming and playing of multimedia files
 FFmpeg is the leading multimedia framework, able to decode, encode, transcode,
 mux, demux, stream, filter and play pretty much anything that humans and
 machines have created. It supports the most obscure ancient formats up to the
 cutting edge.
 .
 This package contains:
  * ffmpeg: a command line tool to convert multimedia files between formats
  * ffplay: a simple media player based on SDL and the FFmpeg libraries
  * ffprobe: a simple multimedia stream analyzer
  * qt-faststart: a utility to rearrange Quicktime files
Homepage: https://ffmpeg.org/
Original-Maintainer: Debian Multimedia Maintainers <debian-multimedia@lists.debian.org>
Package: v4l-utils
Status: install ok installed
Priority: optional
Section: utils
Installed-Size: 2104
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Version: 1.18.0-2build1
Replaces: ivtv-utils (<< 1.4.1-2), media-ctl
Depends: libv4l-0 (= 1.18.0-2build1), libv4l2rds0 (= 1.18.0-2build1), libc6 (>= 2.17), libgcc-s1 (>= 3.0), libstdc++6 (>= 5.2), libudev1 (>= 183)
Breaks: ivtv-utils (<< 1.4.1-2), media-ctl
Description: Collection of command line video4linux utilities
 v4l-utils contains the following video4linux command line utilities:
 .
  decode_tm6000: decodes tm6000 proprietary format streams
  rds-ctl: tool to receive and decode Radio Data System (RDS) streams
  v4l2-compliance: tool to test v4l2 API compliance of drivers
  v4l2-ctl, cx18-ctl, ivtv-ctl: tools to control v4l2 controls from the cmdline
  v4l2-dbg: tool to directly get and set registers of v4l2 devices
  v4l2-sysfs-path: sysfs helper tool
Original-Maintainer: Gregor Jasny <gjasny@googlemail.com>
Homepage: https://linuxtv.org/downloads/v4l-utils/


    


    Due to the reason that the python files are of the same structure I'm uploading a sample file here :

    


    # -*- coding: utf-8 -*-
from threading import Timer
from pynput.mouse import Listener
import logging
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(
    os.path.realpath(__file__)), "../"))

from Functions import utils as ut

if __name__=='__main__':

    ut.initialize_dirs()
    rec_file = ''.join(('mouse_',ut.get_date(),'.txt'))
    raw_data = ut.get_name('Mouse')
    rec_file = os.path.join(raw_data,rec_file)
    logging.basicConfig(filename=rec_file,level=logging.DEBUG,format="%(asctime)s    %(message)s")

    try:
        with Listener(on_move=ut.on_move, on_click=ut.on_click,on_scroll=ut.on_scroll) as listener:
            Timer(60, listener.stop).start()
            listener.join()
    except KeyboardInterrupt as err:
        print(err)
        sys.exit(0)

    print('Exiting logger...')



    


    I'm also uploading the functions that I use :

    


    # -*- coding: utf-8 -*-&#xA;from serial import Serial&#xA;from datetime import datetime, timedelta&#xA;import pandas as pd&#xA;import collections&#xA;import logging&#xA;import shutil&#xA;import serial&#xA;import time&#xA;import sys&#xA;import os&#xA;&#xA;click_held = False&#xA;button = None&#xA;&#xA;&#xA;def on_move(x,y):&#xA;    """The callback to call when mouse move events occur&#xA;&#xA;    Args:&#xA;        x (float): The new pointer position&#xA;        y (float): The new pointer poisition&#xA;    """&#xA;    if click_held:&#xA;        logging.info("MV    {0:>8}  {1:>8}  {2:>8}:".format(x,y,str(None)))&#xA;    else:&#xA;        logging.info("MV    {0:>8}  {1:>8}  {2:>8}:".format(x,y,str(None)))&#xA;&#xA;&#xA;def on_click(x,y,button,pressed):&#xA;    """The callback to call when a mouse button is clicked&#xA;&#xA;    Args:&#xA;        x (float): Mouse coordinates on screen&#xA;        y (float): Mouse coordinates on screen&#xA;        button (str): one of the Button values&#xA;        pressed (bool): Pressed is whether the button was pressed&#xA;    """&#xA;    global click_held&#xA;    if pressed:&#xA;        click_held = True&#xA;        logging.info("CLK    {0:>7}    {1:>6}    {2:>13}".format(x,y,button))&#xA;    else:&#xA;        click_held = False&#xA;        logging.info("RLS    {0:>7}    {1:>6}    {2:>13}".format(x,y,button))&#xA;&#xA;&#xA;def on_scroll(x,y,dx,dy):&#xA;    """The callback to call when mouse scroll events occur&#xA;&#xA;    Args:&#xA;        x (float): The new pointer position on screen&#xA;        y (float): The new pointer position on screen&#xA;        dx (int): The horizontal scroll. The units of scrolling is undefined&#xA;        dy (int): The vertical scroll. The units of scrolling is undefined&#xA;    """&#xA;    if dy == -1:&#xA;        logging.info("SCRD    {0:>6}    {1:>6}    {2:>6}".format(x,y,str(None)))&#xA;    elif dy == 1:&#xA;        logging.info("SCRU    {0:>6}    {1:>6}    {2:>6}".format(x,y,str(None)))&#xA;    else:&#xA;        pass&#xA;&#xA;&#xA;def on_press_keys(key):&#xA;    """The callback to call when a button is pressed.&#xA;&#xA;    Args:&#xA;        key (str): A KeyCode,a Key or None if the key is unknown&#xA;    """&#xA;    subkeys = [&#xA;    &#x27;Key.alt&#x27;,&#x27;Key.alt_gr&#x27;,&#x27;Key.alt_r&#x27;,&#x27;Key.backspace&#x27;,&#xA;    &#x27;Key.space&#x27;,&#x27;Key.ctrl&#x27;,&#x27;Key.ctrl_r&#x27;,&#x27;Key.down&#x27;,&#xA;    &#x27;Key.up&#x27;,&#x27;Key.left&#x27;,&#x27;Key.right&#x27;,&#x27;Key.page_down&#x27;,&#xA;    &#x27;Key.page_up&#x27;,&#x27;Key.enter&#x27;,&#x27;Key.shift&#x27;,&#x27;Key.shift_r&#x27;&#xA;    ]&#xA;&#xA;    key = str(key).strip(&#x27;\&#x27;&#x27;)&#xA;    if(key in subkeys):&#xA;        #print(key)&#xA;        logging.info(key)&#xA;    else:&#xA;        pass&#xA;&#xA;&#xA;def record_chair(output_file):&#xA;    """Read the data stream coming from the serial monitor&#xA;       in order to get the sensor readings&#xA;&#xA;    Args:&#xA;        output_file (str): The file name, where the data stream will be stored&#xA;    """&#xA;    serial_port = "/dev/ttyACM0"&#xA;    baud_rate = 9600&#xA;    ser = serial.Serial(serial_port,baud_rate)&#xA;    logging.basicConfig(filename=output_file,level=logging.DEBUG,format="%(asctime)s    %(message)s")&#xA;    flag = False&#xA;    start = time.time()&#xA;    while time.time() - start &lt; 60.0:&#xA;        try:&#xA;            serial_data = str(ser.readline().decode().strip(&#x27;\r\n&#x27;))&#xA;            time.sleep(0.2)&#xA;            tmp = serial_data.split(&#x27;  &#x27;)[0] #Getting Sensor Id&#xA;            if(tmp == &#x27;A0&#x27;):&#xA;                flag = True&#xA;            if (flag and tmp != &#x27;A4&#x27;):&#xA;                #print(serial_data)&#xA;                logging.info(serial_data)&#xA;            if(flag and tmp == &#x27;A4&#x27;):&#xA;                flag = False&#xA;                #print(serial_data)&#xA;                logging.info(serial_data)&#xA;        except (UnicodeDecodeError, KeyboardInterrupt) as err:&#xA;            print(err)&#xA;            print(err.args)&#xA;            sys.exit(0)&#xA;&#xA;&#xA;def initialize_dirs():&#xA;    """Create the appropriate directories in order to save&#xA;       and process the collected data&#xA;    """&#xA;    current_path = os.path.abspath(os.getcwd())&#xA;    os.chdir(&#x27;..&#x27;)&#xA;    current_path = (os.path.abspath(os.curdir)) #/Multodal_User_Monitoring&#xA;    current_path = os.path.join(current_path,&#x27;Data&#x27;)&#xA;    create_subdirs([current_path])&#xA;&#xA;    #Create mouse log folder&#xA;    mouse = os.path.join(current_path,&#x27;Mouse&#x27;)&#xA;    create_subdirs([mouse])&#xA;    #Create mouse subfolders&#xA;    names = concat_names(mouse)&#xA;    create_subdirs(names)&#xA;&#xA;    #Create keyboard log  folder&#xA;    keyboard = os.path.join(current_path,&#x27;Keyboard&#x27;)&#xA;    create_subdirs([keyboard])&#xA;    #Create keyboard subfolders&#xA;    names = concat_names(keyboard)&#xA;    create_subdirs(names)&#xA;&#xA;    #Create the chair log folder&#xA;    chair = os.path.join(current_path,&#x27;Chair&#x27;)&#xA;    create_subdirs([chair])&#xA;    #Create chair subfolders&#xA;    names = concat_names(chair)&#xA;    create_subdirs(names)&#xA;&#xA;    #Create webcam log folder&#xA;    webcam = os.path.join(current_path,&#x27;Webcam&#x27;)&#xA;    create_subdirs([webcam])&#xA;&#xA;def concat_names(dir) -> str:&#xA;    """Concatenate the given folder names&#xA;       with the appropriate path&#xA;&#xA;    Args:&#xA;        dir (str): The directory to create the subfolders&#xA;&#xA;    Returns:&#xA;        list: The new absolute paths&#xA;    """&#xA;    raw_data = os.path.join(dir,&#x27;Raw&#x27;)&#xA;    edited_data = os.path.join(dir,&#x27;Edited_logs&#x27;)&#xA;    csv_data = os.path.join(dir,&#x27;CSV&#x27;)&#xA;    features = os.path.join(dir,&#x27;Features&#x27;)&#xA;    dirs = [raw_data,edited_data,csv_data,features]&#xA;    return dirs&#xA;&#xA;&#xA;def create_subdirs(paths):&#xA;    """Create sub directories given some absolute paths&#xA;&#xA;    Args:&#xA;        paths (list): A list containing the paths to be created&#xA;    """&#xA;    for index,path in enumerate(paths):&#xA;        if(os.path.isdir(paths[index])):&#xA;            pass&#xA;        else:&#xA;            os.mkdir(paths[index])&#xA;&#xA;&#xA;def round_down(num,divisor) -> int:&#xA;    """Round the number of lines contained into the recording file,&#xA;       down to the nearest multiple of the given divisor&#xA;&#xA;    Args:&#xA;        num (int): The number of lines contained into the given log file&#xA;        divisor (int): The divisor in order to get tuples of divisor&#xA;&#xA;    Returns:&#xA;        int: The nearest multiple of five&#xA;    """&#xA;    return num-(num%divisor)&#xA;&#xA;&#xA;def get_date() -> str:&#xA;    """Get the current date in order to properly name&#xA;       the recored log files&#xA;    Returns:&#xA;        str: The current date in: YY_MM_DD format&#xA;    """&#xA;    return datetime.now().strftime(&#x27;%Y_%m_%d&#x27;)&#xA;&#xA;&#xA;def get_name(modality) -> str:&#xA;    """Save the recorded log into /Data//Raw&#xA;&#xA;    Args:&#xA;        modality (str): The log data source&#xA;&#xA;    Returns:&#xA;        str: The absolute path where each recording is saved&#xA;    """&#xA;    current_path = os.path.abspath(os.getcwd())&#xA;    current_path = os.path.join(current_path,&#x27;Data&#x27;)&#xA;&#xA;    if modality == &#x27;Chair&#x27;:&#xA;        chair_path = os.path.join(current_path,modality,&#x27;Raw&#x27;)&#xA;        return chair_path&#xA;&#xA;    elif modality == &#x27;Mouse&#x27;:&#xA;        mouse_path = os.path.join(current_path,modality,&#x27;Raw&#x27;)&#xA;        return mouse_path&#xA;&#xA;    elif modality == &#x27;Keyboard&#x27;:&#xA;        keyboard_path = os.path.join(current_path,modality,&#x27;Raw&#x27;)&#xA;        return keyboard_path&#xA;&#xA;&#xA;def crawl_dir(target,folder) -> str:&#xA;    """Enumerate all the given files in a directory&#xA;       based on the given file extension&#xA;&#xA;    Args:&#xA;        target (str): The file to search for&#xA;        folder (str): The folder to search&#xA;&#xA;    Returns:&#xA;        [type]: A list containing the file names&#xA;    """&#xA;    current_path = os.path.abspath(os.getcwd())&#xA;    path = os.path.join(current_path,folder)&#xA;    file_names =[]&#xA;    for f in os.listdir(path):&#xA;        if(f.endswith(target)):&#xA;            fname=os.path.join(path,f)&#xA;            file_names.append(fname)&#xA;    return file_names&#xA;&#xA;&#xA;def convert_keys2_csv(input_file,output_file):&#xA;    """Convert the data stream file(keylogger recording) from .txt to .csv format&#xA;&#xA;    Args:&#xA;        input_file (str): The data stream file in .txt format&#xA;        output_file (str): The csv extension file name&#xA;    """&#xA;    df = pd.read_fwf(input_file)&#xA;    col_names = [&#x27;Date&#x27;,&#x27;Time&#x27;,&#x27;Key&#x27;]&#xA;    df.to_csv(output_file,header=col_names,encoding=&#x27;utf-8&#x27;,index=False)&#xA;&#xA;&#xA;def convert_mouse2_csv(input_file,output_file):&#xA;    """Convert the data stream file(mouselogger recording) from .txt to .csv format&#xA;&#xA;    Args:&#xA;        input_file (str): The data stream file in .txt format&#xA;        output_file (str): The csv extension file name&#xA;    """&#xA;    df = pd.read_fwf(input_file)&#xA;    col_names = [&#x27;Date&#x27;,&#x27;Time&#x27;,&#x27;Action&#x27;,&#x27;PosX&#x27;,&#x27;PosY&#x27;,&#x27;Button&#x27;]&#xA;    df.to_csv(output_file,header=col_names,encoding=&#x27;utf-8&#x27;,index=False)&#xA;&#xA;&#xA;def convert_chair_2_csv(input_file,output_file):&#xA;    """Convert the data stream file(chair recording)&#xA;       from .txt to .csv format&#xA;&#xA;    Args:&#xA;        input_file (str): The data stream file in .txt format&#xA;        output_file (str): The csv extension file name&#xA;    """&#xA;    if(os.path.isfile(input_file)):&#xA;        pass&#xA;    else:&#xA;        print(&#x27;Invalid working directory...&#x27;)&#xA;        print(&#x27;Aborting...&#x27;)&#xA;        sys.exit(0)&#xA;&#xA;    tmp0,tmp1,tmp2,tmp3,tmp4 = 0,1,2,3,4&#xA;&#xA;    line_number = 0&#xA;    for line in open(input_file).readlines():&#xA;        line_number &#x2B;= 1&#xA;&#xA;    rounded_line = round_down(line_number,5)&#xA;    d = collections.defaultdict(list)&#xA;&#xA;    with open(input_file,&#x27;r&#x27;) as f1:&#xA;        lines = f1.readlines()&#xA;        for i in range(rounded_line // 5):&#xA;            #Sensor:Analog input 0 values&#xA;            Sid0 = lines[i&#x2B;tmp0]&#xA;            temp = Sid0.split()&#xA;            d[&#x27;Sid0&#x27;].append([temp[0],temp[1],temp[2],temp[3]])&#xA;            #Sensor:Analog input 1 values&#xA;            Sid1 = lines[i&#x2B;tmp1]&#xA;            temp = Sid1.split()&#xA;            d[&#x27;Sid1&#x27;].append([temp[0],temp[1],temp[2],temp[3]])&#xA;            #Sensor:Analog input 2 values&#xA;            Sid2 = lines[i&#x2B;tmp2]&#xA;            temp = Sid2.split()&#xA;            d[&#x27;Sid2&#x27;].append([temp[0],temp[1],temp[2],temp[3]])&#xA;            #Sensor:Analog input 3 values&#xA;            Sid3 = lines[i&#x2B;tmp3]&#xA;            temp = Sid3.split()&#xA;            d[&#x27;Sid3&#x27;].append([temp[0],temp[1],temp[2],temp[3]])&#xA;            #Sensor:Analog input 4 values&#xA;            Sid4 = lines[i&#x2B;tmp4]&#xA;            temp = Sid4.split()&#xA;            d[&#x27;Sid4&#x27;].append([temp[0],temp[1],temp[2],temp[3]])&#xA;&#xA;            tmp0 &#x2B;= 4&#xA;            tmp1 &#x2B;= 4&#xA;            tmp2 &#x2B;= 4&#xA;            tmp3 &#x2B;= 4&#xA;            tmp4 &#x2B;= 4&#xA;&#xA;    l = []&#xA;    for i in range(rounded_line // 5):&#xA;        date = d[&#x27;Sid0&#x27;][i][0]&#xA;        time = d[&#x27;Sid0&#x27;][i][1]&#xA;        A0_val = d[&#x27;Sid0&#x27;][i][3]&#xA;        A1_val = d[&#x27;Sid1&#x27;][i][3]&#xA;        A2_val = d[&#x27;Sid2&#x27;][i][3]&#xA;        A3_val = d[&#x27;Sid3&#x27;][i][3]&#xA;        A4_val = d[&#x27;Sid4&#x27;][i][3]&#xA;        l.append([date,time,A0_val,A1_val,A2_val,A3_val,A4_val])&#xA;&#xA;    sensor_readings_df = pd.DataFrame.from_records(l)&#xA;    sensor_readings_df.columns = [&#x27;Date&#x27;,&#x27;Time&#x27;,&#x27;A0&#x27;,&#x27;A1&#x27;,&#x27;A2&#x27;,&#x27;A3&#x27;,&#x27;A4&#x27;]&#xA;    sensor_readings_df.to_csv(output_file, encoding=&#x27;utf-8&#x27;, index=False)&#xA;    del l&#xA;&#xA;&#xA;def parse_raw_data(modality):&#xA;    """Convert each modality&#x27;s raw data into csv format and move&#xA;       the edited raw data into the appropriate Edited_logs folder&#xA;&#xA;    Args:&#xA;        modality (str): The data source&#xA;    """&#xA;    #Change directories&#xA;    current_path = os.path.abspath(os.getcwd()) #/Functions&#xA;    os.chdir(&#x27;..&#x27;)&#xA;    current_path = (os.path.abspath(os.curdir)) #/Multimodal_User_Monitoring&#xA;    os.chdir(&#x27;./Data&#x27;)#/Multimodal_User_Monitoring/Data&#xA;    current_path = (os.path.abspath(os.curdir)) #/Multimodal_User_Monitoring/Data&#xA;    current_path = os.path.join(current_path,modality) #example: /Multimodal_User_Monitoring/Data/<modality>&#xA;    raw_data_path = os.path.join(current_path,&#x27;Raw&#x27;)&#xA;    csv_data_path = os.path.join(current_path,&#x27;CSV&#x27;)&#xA;    edited_logs_path = os.path.join(current_path,&#x27;Edited_logs&#x27;)&#xA;&#xA;    txt_names = crawl_dir(&#x27;.txt&#x27;,raw_data_path)&#xA;    csv_names = []&#xA;    for elem in txt_names:&#xA;        name = elem.split(&#x27;/&#x27;)[-1].split(&#x27;.&#x27;)[0]&#xA;        csv_name = name&#x2B;&#x27;.csv&#x27;&#xA;        tmp = os.path.join(csv_data_path,csv_name)&#xA;        csv_names.append(tmp)&#xA;&#xA;    if modality == &#x27;Mouse&#x27;:&#xA;        if len(txt_names) == len(csv_names):&#xA;            for i, elem in enumerate(txt_names):&#xA;            #for i in range(len(txt_names)):&#xA;                convert_mouse2_csv(txt_names[i],csv_names[i])&#xA;                shutil.move(txt_names[i],edited_logs_path)&#xA;&#xA;    elif modality == &#x27;Keyboard&#x27;:&#xA;        if len(txt_names) == len(csv_names):&#xA;            for i, elem in enumerate(txt_names):&#xA;            #for i in range(len(txt_names)):&#xA;                convert_keys2_csv(txt_names[i],csv_names[i])&#xA;                shutil.move(txt_names[i],edited_logs_path)&#xA;&#xA;    elif modality == &#x27;Chair&#x27;:&#xA;        if len(txt_names) == len(csv_names):&#xA;            for i, elem in enumerate(txt_names):&#xA;            #for i in range(len(txt_names)):&#xA;                convert_chair_2_csv(txt_names[i],csv_names[i])&#xA;                shutil.move(txt_names[i],edited_logs_path)&#xA;&#xA;</modality>

    &#xA;

    I need to mention that the logs of the python3 scripts are empty

    &#xA;

  • hwcontext_vulkan : check for memory size before choosing type

    24 novembre 2020, par Lynne
    hwcontext_vulkan : check for memory size before choosing type
    

    It makes allocation a bit more robust in case some weird device with
    weird drivers which segments memory in weird ways appears.

    • [DH] libavutil/hwcontext_vulkan.c