Recherche avancée

Médias (91)

Autres articles (92)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (4310)

  • problem with changing the frames in an video with opencv

    5 septembre 2023, par Avizipi

    I have a code that runs in the last few months without any problem. The code shows an image from a video with extra data from the relevant db. using the keyboard you can jump around some frames and get better insights. However, in the last week changing the frame of the video stopped working.

    


    I built a small script that show the problem.

    


    import cv2

vid_cap_reader_path = "vid_230830_122746_C.avi"
cap_rgb = cv2.VideoCapture(vid_cap_reader_path)

k = 0
while 1:
    if k == ord("q"):
        break
    if k == ord("b"):
        before = cap_rgb.get(cv2.CAP_PROP_POS_FRAMES)
        cap_rgb.set(cv2.CAP_PROP_POS_FRAMES, before + 30.0)
        after = cap_rgb.get(cv2.CAP_PROP_POS_FRAMES)
        print(f"before = {before} after = {after}")
    ret, img = cap_rgb.read()
    if ret:
        cv2.imshow("bla", img)
        k = cv2.waitKey(0)
    else:
        break


    


    This is what is printed to the terminal :

    


    [mpeg4 @ 0x1d87400] warning: first frame is no keyframe
before = 36.0 after = 0.0
before = 67.0 after = 0.0
[mpeg4 @ 0x1d87400] warning: first frame is no keyframe
before = 40.0 after = 0.0
[mpeg4 @ 0x1d87400] warning: first frame is no keyframe


    


    The video itself doesn't "jump" for the next frame as expected and also most of the properties that opencv have return 0. I tested also CAP_PROP_FRAME_COUNT, and CAP_PROP_POS_MSEC without any lack, although the msec flag did give non-zero results which make no sense.

    


    It is also important to mention that I am building this application in a docker file and I am not using a specific version for my requirements. The tests here are with opencv-python==4.7.0.68. Also, the videos are working fine while playing them on VLC.

    


    I was looking around the net for a similar problem from the recent time and didn't find much except this github issue that may be similar. I started to downgrade opencv one by one without any luck.

    


    Maybe someone here can help with this issue, or give me a lead to doing something different.

    


  • What is the technically correct way to achieve A/V sync in an MP4 file ?

    25 juillet 2023, par Douglas B

    I am working with a small header only mp4 library (minimp4) to write mp4 files consisting of AAC audio and HVEC video streams, and using FFmpeg/ffplay/ffprobe to inspect and play them. I am a bit confused however, about mp4 concepts like decode/presentation/composition times and how I should be using those for sync.

    


    Initially, I was writing all samples of audio and video as they came in, and using my expected duration as the duration. This obviously lead to a situation where I sometimes started getting video samples before audio causing the audio to run ahead of video. To correct this, I first attempted to manually set the "timestamp" parameter the library writes as well as use a real calculated duration. I realized this would not work in the mode I was using (non fragmented) and seemed to be an improper approach as the timestamp would be written as a decode timestamp (tfdt, not presentation), so instead I changed my writing functions to throw away any A/V samples that start before the other has some ready. This approach seems to work really well, although I am not sure how resilient it would be to drift over time.

    


    After getting that to work and trying to look through FFmpeg source to see how they are handled, I noticed that ffprobe, at least, does use the decode timestamp as a presentation timestamp in some cases (int64_t pts = pkt->pts != AV_NOPTS_VALUE ? pkt->pts : pkt->dts;). I am also having trouble finding where a valid pkt->pts would come from at this point so it almost seems like the intended case.

    


    Google lead me to the CTTS table/composition timestamp, but that seems to be more for reordering frames (not something I have to worry about as I am using all I-frames for video) so I am a bit at a loss/confused about what the technically proper, or at least most common/supported way of handling A/V sync in MP4 files is.

    


  • How to add an image frame to the end of a video using FFmpeg without re-encoding ?

    17 juillet 2023, par hello world

    I'm looking for a way to add an image frame to the end of a video using FFmpeg without re-encoding the video. The image file I want to use as the frame has the same width and height as the video file. I've tried using the following command :

    


    ffmpeg -i input.mp4 -loop 1 -i frame.jpg -c:v copy -c:a copy -shortest output.mp4


    


    However, this command seems to re-encode the video, which is not desirable as it increases processing time and may lead to some loss in quality.

    


    Is there a way to achieve this without re-encoding the video and only overlaying the image frame onto the video ? I'd greatly appreciate any insights or alternative commands to accomplish this task efficiently.

    


    Thank you in advance for your help !