Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (73)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • Activation de l’inscription des visiteurs

    12 avril 2011, par

    Il est également possible d’activer l’inscription des visiteurs ce qui permettra à tout un chacun d’ouvrir soit même un compte sur le canal en question dans le cadre de projets ouverts par exemple.
    Pour ce faire, il suffit d’aller dans l’espace de configuration du site en choisissant le sous menus "Gestion des utilisateurs". Le premier formulaire visible correspond à cette fonctionnalité.
    Par défaut, MediaSPIP a créé lors de son initialisation un élément de menu dans le menu du haut de la page menant (...)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

Sur d’autres sites (6817)

  • avformat/f_select : add support for more pixel formats for scene change score calculations

    21 juillet 2019, par Limin Wang
    avformat/f_select : add support for more pixel formats for scene change score calculations
    

    This avoids automatic conversions to rgb if scene change score is used in the expression.

    Below is the tested results for the new added pixel format without autoscale to rgb24 :
    1. AV_PIX_FMT_YUVJ420P
    time ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f lavfi \
    "sws_flags=+accurate_rnd+bitexact ;movie=../fate-suite/svq3/Vertical400kbit.sorenson3.mov,select=gt(scene\,.25)"

    master :
    pkt_pts=1620|tag:lavfi.scene_score=1.000000
    pkt_pts=4140|tag:lavfi.scene_score=0.875036
    pkt_pts=5800|tag:lavfi.scene_score=1.000000
    pkt_pts=6720|tag:lavfi.scene_score=0.461625
    pkt_pts=8160|tag:lavfi.scene_score=1.000000
    pkt_pts=9760|tag:lavfi.scene_score=1.000000
    pkt_pts=14080|tag:lavfi.scene_score=0.838916
    pkt_pts=15700|tag:lavfi.scene_score=1.000000
    pkt_pts=18500|tag:lavfi.scene_score=0.474948
    pkt_pts=20040|tag:lavfi.scene_score=0.379700
    pkt_pts=21760|tag:lavfi.scene_score=1.000000
    ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f 0.71s user 0.01s system 99% cpu 0.721 total

    patch applied :
    pkt_pts=1620|tag:lavfi.scene_score=1.000000
    pkt_pts=4140|tag:lavfi.scene_score=0.668643
    pkt_pts=5800|tag:lavfi.scene_score=0.996721
    pkt_pts=6720|tag:lavfi.scene_score=0.357390
    pkt_pts=8160|tag:lavfi.scene_score=0.886268
    pkt_pts=9760|tag:lavfi.scene_score=0.926219
    pkt_pts=14080|tag:lavfi.scene_score=0.650033
    pkt_pts=15700|tag:lavfi.scene_score=1.000000
    pkt_pts=18500|tag:lavfi.scene_score=0.316402
    pkt_pts=20040|tag:lavfi.scene_score=0.269509
    pkt_pts=21760|tag:lavfi.scene_score=1.000000
    ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f 0.19s user 0.01s system 81% cpu 0.240 total

    2. AV_PIX_FMT_YUV420P
    time ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f lavfi \
    "sws_flags=+accurate_rnd+bitexact ;movie=../Passengers_Breakfast_1080-sdr.mkv,select=gt(scene\,.2)"
    master :
    pkt_pts=3587|tag:lavfi.scene_score=0.462364
    pkt_pts=4838|tag:lavfi.scene_score=0.419519
    pkt_pts=6548|tag:lavfi.scene_score=0.397027
    pkt_pts=9968|tag:lavfi.scene_score=0.419245
    pkt_pts=12471|tag:lavfi.scene_score=0.413084
    pkt_pts=16225|tag:lavfi.scene_score=0.506370
    pkt_pts=19645|tag:lavfi.scene_score=0.507538
    pkt_pts=22314|tag:lavfi.scene_score=0.504319
    pkt_pts=24817|tag:lavfi.scene_score=0.417544
    pkt_pts=25651|tag:lavfi.scene_score=0.413916
    pkt_pts=26652|tag:lavfi.scene_score=0.487707
    18.58s user 0.07s system 99% cpu 18.663 total

    patch applied :
    pkt_pts=3587|tag:lavfi.scene_score=0.272173
    pkt_pts=4838|tag:lavfi.scene_score=0.247841
    pkt_pts=6548|tag:lavfi.scene_score=0.233134
    pkt_pts=9968|tag:lavfi.scene_score=0.247253
    pkt_pts=12471|tag:lavfi.scene_score=0.244129
    pkt_pts=16225|tag:lavfi.scene_score=0.302531
    pkt_pts=19645|tag:lavfi.scene_score=0.303560
    pkt_pts=22314|tag:lavfi.scene_score=0.301861
    pkt_pts=24817|tag:lavfi.scene_score=0.249331
    pkt_pts=25651|tag:lavfi.scene_score=0.247096
    pkt_pts=26652|tag:lavfi.scene_score=0.287728
    10.90s user 0.06s system 99% cpu 10.967 total

    3. AV_PIX_FMT_YUV422P

    time ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f lavfi \
    "sws_flags=+accurate_rnd+bitexact ;movie=../Passengers_Breakfast_1080-sdr.mkv,format=yuv422p,select=gt(scene\,.2)"
    master :

    patched applied :
    pkt_pts=3587|tag:lavfi.scene_score=0.224017
    pkt_pts=4838|tag:lavfi.scene_score=0.204225
    pkt_pts=9968|tag:lavfi.scene_score=0.204636
    pkt_pts=12471|tag:lavfi.scene_score=0.202772
    pkt_pts=16225|tag:lavfi.scene_score=0.248765
    pkt_pts=19645|tag:lavfi.scene_score=0.250144
    pkt_pts=22314|tag:lavfi.scene_score=0.248802
    pkt_pts=24817|tag:lavfi.scene_score=0.208362
    pkt_pts=25651|tag:lavfi.scene_score=0.205777
    pkt_pts=26652|tag:lavfi.scene_score=0.230742

    4. AV_PIX_FMT_YUV420P10
    time ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f lavfi \
    "sws_flags=+accurate_rnd+bitexact ;movie=../Passengers_Breakfast_4k.mkv,select=gt(scene\,.2)"

    master :
    pkt_pts=3587|tag:lavfi.scene_score=0.269890
    pkt_pts=4838|tag:lavfi.scene_score=0.248957
    pkt_pts=6548|tag:lavfi.scene_score=0.234619
    pkt_pts=9969|tag:lavfi.scene_score=0.224912
    pkt_pts=12471|tag:lavfi.scene_score=0.225158
    pkt_pts=16225|tag:lavfi.scene_score=0.289809
    pkt_pts=19645|tag:lavfi.scene_score=0.285013
    pkt_pts=22314|tag:lavfi.scene_score=0.280295
    pkt_pts=24817|tag:lavfi.scene_score=0.206486
    pkt_pts=25651|tag:lavfi.scene_score=0.208556
    pkt_pts=26652|tag:lavfi.scene_score=0.249577
    ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f 76.03s user 0.22s system 99% cpu 1:16.27 total

    patch applied
    pkt_pts=3587|tag:lavfi.scene_score=0.269890
    pkt_pts=4838|tag:lavfi.scene_score=0.248957
    pkt_pts=6548|tag:lavfi.scene_score=0.234619
    pkt_pts=9969|tag:lavfi.scene_score=0.224912
    pkt_pts=12471|tag:lavfi.scene_score=0.225158
    pkt_pts=16225|tag:lavfi.scene_score=0.289809
    pkt_pts=19645|tag:lavfi.scene_score=0.285013
    pkt_pts=22314|tag:lavfi.scene_score=0.280295
    pkt_pts=24817|tag:lavfi.scene_score=0.206486
    pkt_pts=25651|tag:lavfi.scene_score=0.208556
    pkt_pts=26652|tag:lavfi.scene_score=0.249577
    ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f 50.27s user 0.20s system 99% cpu 50.476 total

    5. AV_PIX_FMT_RGBA, AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, AV_PIX_FMT_GRAY8
    are tested by format= with the fate sample : Vertical400kbit.sorenson3.mov like below :
    time ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f lavfi \
    "sws_flags=+accurate_rnd+bitexact ;movie=../fate-suite/svq3/Vertical400kbit.sorenson3.mov,format=rgba,select=gt(scene\,.25)"

    patch applied :
    pkt_pts=1620|tag:lavfi.scene_score=1.000000
    pkt_pts=4140|tag:lavfi.scene_score=0.656277
    pkt_pts=5800|tag:lavfi.scene_score=1.000000
    pkt_pts=6720|tag:lavfi.scene_score=0.346218
    pkt_pts=8160|tag:lavfi.scene_score=0.987686
    pkt_pts=9760|tag:lavfi.scene_score=1.000000
    pkt_pts=14080|tag:lavfi.scene_score=0.629187
    pkt_pts=15700|tag:lavfi.scene_score=1.000000
    pkt_pts=18500|tag:lavfi.scene_score=0.356211
    pkt_pts=20040|tag:lavfi.scene_score=0.284775
    pkt_pts=21760|tag:lavfi.scene_score=1.000000

    6. AV_PIX_FMT_YUVJ422P
    time ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f lavfi \
    "sws_flags=+accurate_rnd+bitexact ;movie=../fate-suite/svq3/Vertical400kbit.sorenson3.mov,format=yuvj422p,select=gt(scene\,.25)"

    patch applied :
    pkt_pts=1620|tag:lavfi.scene_score=0.838281
    pkt_pts=4140|tag:lavfi.scene_score=0.541382
    pkt_pts=5800|tag:lavfi.scene_score=0.780588
    pkt_pts=6720|tag:lavfi.scene_score=0.298274
    pkt_pts=8160|tag:lavfi.scene_score=0.699106
    pkt_pts=9760|tag:lavfi.scene_score=0.730136
    pkt_pts=14080|tag:lavfi.scene_score=0.537742
    pkt_pts=15700|tag:lavfi.scene_score=0.811946
    pkt_pts=18500|tag:lavfi.scene_score=0.263382
    pkt_pts=21760|tag:lavfi.scene_score=0.880773

    Reviewed-by : Marton Balint <cus@passwd.hu>
    Signed-off-by : Limin Wang <lance.lmwang@gmail.com>

    • [DH] libavfilter/f_select.c
    • [DH] tests/ref/fate/filter-metadata-scenedetect
  • PyQt QGraphicsScene Render Scene As Video Format

    28 mai 2024, par Alex

    I'm trying to allow the user to export the scene as an mp4 (video format), the items of the scene consists of QGraphicsVideoItem and multiple QGraphicsTextItem, I need to export the scene as it will allow the user to save the video with the text items. I've found one of the ways to do this but the issue is that it will take hours for a simple 5 seconds videos as it saves every image to a byte to create a video, every image is a millisecond. If I change from millisecond to seconds it could speed up but the video will not look as smooth, is there a more efficient way of doing this, without it taking so long ?

    &#xA;

    from PySide6.QtCore import *&#xA;from PySide6.QtGui import *&#xA;from PySide6.QtWidgets import *&#xA;from PySide6.QtSvgWidgets import *&#xA;from PySide6.QtMultimediaWidgets import QGraphicsVideoItem&#xA;from PySide6.QtMultimedia import QMediaPlayer, QAudioOutput, QMediaMetaData &#xA;&#xA;import subprocess&#xA;&#xA;import sys&#xA;&#xA;class ExportVideo(QThread):&#xA;    def __init__(self, video_item, video_player, graphics_scene, graphics_view):&#xA;        super().__init__()&#xA;        self.video_item = video_item&#xA;        self.video_player = video_player&#xA;        self.graphics_scene = graphics_scene&#xA;        self.graphics_view = graphics_view&#xA;    &#xA;    def run(self):&#xA;        self.video_player.pause()&#xA;        duration = self.video_player.duration()&#xA;        meta = self.video_player.metaData()&#xA;&#xA;&#xA;        # Prepare a pipe for ffmpeg to write to&#xA;        ffmpeg_process = subprocess.Popen([&#x27;ffmpeg&#x27;, &#x27;-y&#x27;, &#x27;-f&#x27;, &#x27;image2pipe&#x27;, &#x27;-r&#x27;, &#x27;1000&#x27;, &#x27;-i&#x27;, &#x27;-&#x27;, &#x27;-c:v&#x27;, &#x27;libx265&#x27;, &#x27;-pix_fmt&#x27;, &#x27;yuv420p&#x27;, &#x27;output.mp4&#x27;], stdin=subprocess.PIPE)&#xA;&#xA;        for duration in range(0, duration):&#xA;            self.video_player.setPosition(duration)&#xA;&#xA;            # Add logic to render the frame here&#xA;            print("Exporting frame:", duration) &#xA;&#xA;            image = QImage(self.graphics_scene.sceneRect().size().toSize(), QImage.Format_ARGB32)&#xA;            painter = QPainter(image)&#xA;            self.graphics_scene.render(painter)&#xA;            painter.end()&#xA;&#xA;            # Convert QImage to bytes&#xA;            byte_array = QByteArray()&#xA;            buffer = QBuffer(byte_array)&#xA;            buffer.open(QIODevice.WriteOnly)&#xA;            image.save(buffer, &#x27;JPEG&#x27;)&#xA;&#xA;            # Write image bytes to ffmpeg process&#xA;            ffmpeg_process.stdin.write(byte_array.data())&#xA;&#xA;        # Close the pipe to signal ffmpeg that all frames have been processed&#xA;        ffmpeg_process.stdin.close()&#xA;        ffmpeg_process.wait()&#xA;&#xA;&#xA;class PyVideoPlayer(QWidget):&#xA;    &#xA;    def __init__(self):&#xA;        super().__init__()&#xA;&#xA;        self.text_data = []&#xA;&#xA;        self.mediaPlayer = QMediaPlayer()&#xA;        self.audioOutput = QAudioOutput()&#xA;&#xA;        self.graphics_view = QGraphicsView()&#xA;        self.graphic_scene = QGraphicsScene()&#xA;&#xA;        self.graphics_view.setScene(self.graphic_scene)&#xA;        self.graphic_scene.setBackgroundBrush(Qt.black)&#xA;        self.graphics_view.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)&#xA;        self.graphics_view.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)&#xA;&#xA;        self.video_item = QGraphicsVideoItem()&#xA;        self.graphic_scene.addItem(self.video_item)&#xA;        self.save_video = QPushButton()&#xA;        &#xA;        layout = QVBoxLayout()&#xA;        layout.addWidget(self.graphics_view, stretch=1)&#xA;        layout.addWidget(self.save_video)&#xA;        self.setLayout(layout)&#xA;&#xA;        # Slots Section&#xA;        self.mediaPlayer.setVideoOutput(self.video_item)&#xA;        self.mediaPlayer.positionChanged.connect(self.changeVideoPosition)&#xA;        self.save_video.clicked.connect(self.saveVideo)&#xA;&#xA;    def setMedia(self, fileName):&#xA;        self.mediaPlayer.setSource(QUrl.fromLocalFile(fileName))&#xA;        self.mediaPlayer.setAudioOutput(self.audioOutput)&#xA;        self.play()&#xA;        self.video_item.setSize(self.mediaPlayer.videoSink().videoSize())&#xA;&#xA;        self.text_item = QGraphicsTextItem()&#xA;        self.text_item.setPlainText("Test Dummy")&#xA;        self.text_item.setDefaultTextColor(Qt.white)&#xA;        font = QFont()&#xA;        font.setPointSize(90)  &#xA;        self.text_item.setFont(font)&#xA;        self.text_item.setPos(self.graphic_scene.sceneRect().x() &#x2B; self.text_item.boundingRect().width(), self.graphic_scene.sceneRect().center().y() - self.text_item.boundingRect().height())&#xA;        self.graphic_scene.addItem(self.text_item)&#xA;        self.text_data.append("Test Dummy")&#xA;&#xA;    def play(self):&#xA;        if self.mediaPlayer.playbackState() == QMediaPlayer.PlaybackState.PlayingState:&#xA;            self.mediaPlayer.pause()&#xA;        else:&#xA;            self.mediaPlayer.play()&#xA;&#xA;    def changeVideoPosition(self, duration):&#xA;        if duration > 1000 and self.text_item.isVisible():&#xA;            print("Hide Text")&#xA;            self.text_item.hide()&#xA;&#xA;    def resize_graphic_scene(self):&#xA;        self.graphics_view.fitInView(self.graphic_scene.sceneRect(), Qt.KeepAspectRatio)&#xA;&#xA;    def showEvent(self, event):&#xA;        self.resize_graphic_scene()&#xA;&#xA;    def resizeEvent(self, event):&#xA;        self.resize_graphic_scene()&#xA;&#xA;    def saveVideo(self):&#xA;        self.videoExport = ExportVideo(self.video_item, self.mediaPlayer, self.graphic_scene, self.graphics_view)&#xA;        self.videoExport.start()&#xA;&#xA;    &#xA;&#xA;&#xA;if __name__ == "__main__":&#xA;    app = QApplication(sys.argv)&#xA;    window = PyVideoPlayer()&#xA;    window.setMedia("example.mp4")&#xA;    window.setGeometry(100, 100, 400, 300)  # Set the window size&#xA;    window.setWindowTitle("QGraphicsView Example")&#xA;    window.show()&#xA;    sys.exit(app.exec())&#xA;&#xA;

    &#xA;

      &#xA;
    • EDIT : Changed from PNG to JPEG, it speeds up the image.save, I also get this issue : Assertion fctx->async_lock failed at C:/ffmpeg-n6.0/libavcodec/pthread_frame.c:155. I think it must have to do with setting the video player position.
    • &#xA;

    &#xA;

  • Evolution #2370 : Activation d’une pétition et autres options relativement rares

    21 février 2019, par tcharlss (*´_ゝ`)