Recherche avancée

Médias (0)

Mot : - Tags -/auteurs

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

Autres articles (80)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (6046)

  • How to append an image to a video using OpenCV or FFMPEG or Moviepy or other libraries ?

    19 juillet 2022, par Trần Tiến Văn

    Do you know a library in Python to add a frame image to an existing video ? The result video must have the same quality as the image.

    


    I tried to use OpenCV to add google image : https://www.google.com/search?q=google&sxsrf=ALiCzsZhrdoHnOTmg0We4dxtguCqzma5Jg:1657603343101&source=lnms&tbm=isch&sa=X&ved=2ahUKEwiTh8bTzfL4AhWhplYBHfXNAKwQ_AUoAXoECAIQAw&biw=1492&bih=739&dpr=1.25#imgrc=PRtenhDnrVrfOM

    


    But the quality decreases when the video elongates.

    


    Here is the final result video : https://drive.google.com/file/d/1ArDvoX-kN9H_oLbACk3kU1Cid93SMczC/view?usp=sharing

    


    Here is my code using OpenCV :

    


            image = cv2.imread(path_image)
        height, width, dimensions = image.shape
            
        video = cv2.VideoCapture(path_video)
        
        
        frames = []
        while(True):
            
            ret, frame = video.read()
            
            if ret == True: 
                frames.append(frame)
                # frame = frame.resize(frame, (width, height), fx=0, fy=0, interpolation = cv2.INTER_CUBIC)
                
                # Press S on keyboard 
                # to stop the process
                if cv2.waitKey(1) & 0xFF == ord('s'):
                    break
            # Break the loop
            else:
                break
            
        video2 = cv2.VideoWriter(path_video,cv2.VideoWriter_fourcc('M','J','P','G'), 30, (width, height))
        for frame in frames:
            video2.write(frame)
        video2.write(image)
        video2.release()  # releasing the video generated     
        print("Added {}".format(image_name))


    


    I hope to improve the quality of this video.

    


  • OpenCV : FFMPEG : tag is not supported with codec id 12 and format 'mp4 / MP4

    30 septembre 2023, par Tina J

    I was trying to run a repo located HERE. Basically, just targeting SimpleVideoSummarizer.cc which uses OpenCV for some basic video processing. I'm using Ubuntu 14.04. Following is the save part of the code :

    



    void SimpleVideoSummarizer::playAndSaveSummaryVideo(char* videoFileSave) {&#xA;    cv::VideoCapture capture(videoFile);&#xA;    cv::Mat frame;&#xA;    capture.set(CV_CAP_PROP_POS_FRAMES, 0);&#xA;    cv::VideoWriter videoWriter;&#xA;    if (videoFileSave != "") {&#xA;        videoWriter = cv::VideoWriter(videoFileSave, CV_FOURCC(&#x27;M&#x27;, &#x27;J&#x27;, &#x27;P&#x27;, &#x27;G&#x27;), static_cast<int>(capture.get(CV_CAP_PROP_FPS)), cv::Size(capture.get(CV_CAP_PROP_FRAME_WIDTH), capture.get(CV_CAP_PROP_FRAME_HEIGHT)));&#xA;    }&#xA;    for (std::set<int>::iterator it = summarySet.begin(); it != summarySet.end(); it&#x2B;&#x2B;) {&#xA;        capture.set(CV_CAP_PROP_POS_FRAMES, segmentStartTimes[*it] * frameRate);&#xA;        for (int i = segmentStartTimes[*it]; i &lt; segmentStartTimes[*it &#x2B; 1]; i&#x2B;&#x2B;) {&#xA;            for (int j = 0; j &lt; frameRate; j&#x2B;&#x2B;) {&#xA;                capture >> frame;&#xA;                cv::putText(frame, "Time: " &#x2B; IntToString(i) &#x2B; " seconds", cvPoint(30, 30),&#xA;                            cv::FONT_HERSHEY_COMPLEX_SMALL, 0.8, cvScalar(200, 200, 250), 1, CV_AA);&#xA;                if (frame.data) {&#xA;                    cv::imshow("Summary Video", frame);&#xA;                }&#xA;                if (videoFileSave != "") {&#xA;                    videoWriter.write(frame);&#xA;                }&#xA;                // Press  ESC on keyboard to exit&#xA;                char c = static_cast<char>(cv::waitKey(25));&#xA;                if (c == 27) {&#xA;                    break;&#xA;                }&#xA;            }&#xA;        }&#xA;    }&#xA;    capture.release();&#xA;}&#xA;</char></int></int>

    &#xA;&#xA;

    I pass an input.mp4 file and specify a out.mp4 as well. Unfortunately, when the example is trying to save the output video file, it throws errors on the FOURCC :

    &#xA;&#xA;

    OpenCV: FFMPEG: tag 0x44495658/&#x27;XVID&#x27; is not supported with codec id 12 and format &#x27;mp4 / MP4 (MPEG-4 Part 14)&#x27;&#xA;OpenCV: FFMPEG: fallback to use tag 0x7634706d/&#x27;mp4v&#x27;&#xA;

    &#xA;&#xA;

    or another one :

    &#xA;&#xA;

    OpenCV: FFMPEG: tag 0x3234504d/&#x27;MP42&#x27; is not supported with codec id 15 and format &#x27;mp4 / MP4 (MPEG-4 Part 14)&#x27;&#xA;[mp4 @ 0x16bc700] Could not find tag for codec msmpeg4v2 in stream #0, codec not currently supported in container&#xA;

    &#xA;&#xA;

    I tried to change the FOURCC in this part of the code which writes the video, and applied XVID, MJPG, X264, MP42, MP4V. None worked and threw similar errors.

    &#xA;&#xA;

    What is the problem ? How to fix it ?

    &#xA;

  • Why am I having issues re-encoding rtsp stream to rtmp via FFMPEG-python ? [closed]

    27 août 2023, par Luke Lopez

    I can see that the python script is not throwing errors however I cant stream the video via VLC player.

    &#xA;

    &#xA;  Metadata:&#xA;    title           : Media Server&#xA;    encoder         : Lavf60.3.100&#xA;  Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p(tv, progressive), 640x360, q=2-31, 1 kb/s, 25 fps, 1k tbn&#xA;    Metadata:&#xA;      encoder         : Lavc60.3.100 libx264&#xA;    Side data:&#xA;      cpb: bitrate max/min/avg: 0/0/1000 buffer size: 0 vbv_delay: N/A&#xA;frame= 1927 fps= 25 q=69.0 size=      92kB time=00:01:17.00 bitrate=   9.7kbits/s dup=13 drop=1 speed=0.98x     &#xA;&#xA;&#xA;&#xA;import subprocess&#xA;&#xA;# Input RTSP stream URL&#xA;input_stream_url = "rtsp://myStream"&#xA;&#xA;# Wowza RTMP or RTSP URL (replace with your Wowza server&#x27;s details)&#xA;wowza_url = "rtmp://myWowzaServer"&#xA;&#xA;# Resolution &#xA;desired_width = 640&#xA;desired_height = 360&#xA;&#xA;# Video bitrate and frame rate settings&#xA;video_bitrate = "1240"  # 1240 Kbps&#xA;fps = 25&#xA;&#xA;# Start FFmpeg process to pull and push the stream with specified settings&#xA;ffmpeg_command = [&#xA;    &#x27;ffmpeg&#x27;,&#xA;    &#x27;-rtsp_transport&#x27;, &#x27;tcp&#x27;,  # Use TCP for RTSP transport (optional)&#xA;    &#x27;-i&#x27;, input_stream_url,    # Input RTSP stream URL&#xA;    &#x27;-s&#x27;, f&#x27;{desired_width}x{desired_height}&#x27;,  # Desired resolution&#xA;    &#x27;-c:v&#x27;, &#x27;libx264&#x27;,        # Video codec: H.264&#xA;    &#x27;-b:v&#x27;, video_bitrate,    # Video bitrate&#xA;    &#x27;-r&#x27;, str(fps),            # Frame rate&#xA;    &#x27;-c:a&#x27;, &#x27;aac&#x27;,            # Audio codec: AAC&#xA;    &#x27;-f&#x27;, &#x27;flv&#x27;,              # Output format (FLV for RTMP, rtsp for RTSP)&#xA;    wowza_url                 # Wowza RTMP or RTSP URL&#xA;]&#xA;&#xA;# Start FFmpeg as a subprocess&#xA;ffmpeg_process = subprocess.Popen(ffmpeg_command)&#xA;&#xA;# Stop Condition&#xA;print("Press Enter to stop...")&#xA;input()&#xA;&#xA;# Terminate FFmpeg when done&#xA;ffmpeg_process.terminate()&#xA;&#xA;

    &#xA;

    So far I have tried implementing best encoding practices as recommended by Wowza, have been messing with the frame rate, bitrate etc... but with no luck. Hopefully someone experienced with using FFMpeg can give suggestions / solutions ??

    &#xA;

    Thanks !

    &#xA;