Bonjour,
Je souhaiterais, à partir d'une sortie standard, récupérer seulement les informations qui m’intéressent pour les mettre dans un fichier log.txt
En effet j'ai mon script essai.sh:
Une partie de la sortie mon terminal est:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 #!/bin/sh ffmpeg -i perte.avi -vf blackdetect=d=1:pic_th=0.70:pix_th=0.10 -an -f null - echo Analyse fichier avi 1 terminee ffmpeg -i test.avi -vf blackdetect=d=1:pic_th=0.70:pix_th=0.10 -an -f null - echo Analyse fichier avi 2 terminee ffmpeg -i perte3.avi -vf blackdetect=d=1:pic_th=0.70:pix_th=0.10 -an -f null - echo Analyse fichier avi 3 terminee
En rouge les informations que je souhaiterais extraire pour chaque fichier video. (et mettre ces informations dans un fichier texte log.txt)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 Stream #0:1: Audio: mp2 (P[0][0][0] / 0x0050), 32000 Hz, 2 channels, s16, 64 kb/s [buffer @ 0xa9af260] w:704 h:576 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param: [blackdetect @ 0xa9a31e0] black_min_duration:1 pixel_black_th:0.100000 pixel_black_th_i:37 picture_black_ratio_th:0.700000 Output #0, null, to 'pipe:': Metadata: encoder : Lavf54.2.100 Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 704x576 [SAR 1:1 DAR 11:9], q=2-31, 200 kb/s, 90k tbn, 12.50 tbc Stream mapping: Stream #0:0 -> #0:0 (mpeg4 -> rawvideo) Press [q] to stop, [?] for help black_start:1083.48 black_end:1203.81 black_duration:120.325 bitrate= 0.0kbits/s dup=1177 drop=0 frame=46651 fps=522 q=0.0 Lsize= 0kB time=01:02:12.22 bitrate= 0.0kbits/s dup=1404 drop=0 video:0kB audio:0kB global headers:0kB muxing overhead -nan%
Je ne sais pas si c'est possible de faire ça en 1 seul script essai.sh (qui exécuterait les commandes puis lirait la sortie standard et récupérerait les informations qui m'intéressent pour les mettre dans un fichier txt)
Merci pour votre aide!![]()
Partager