Recherche avancée

Médias (1)

Mot : - Tags -/publicité

Autres articles (67)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Possibilité de déploiement en ferme

    12 avril 2011, par

    MediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
    Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)

Sur d’autres sites (10742)

  • How can i merge two videos using ffmpeg ?

    10 novembre 2017, par hasib prince

    I am using writingminds:FFmpegAndroid:0.3.2 library.and facing this permission denied issue.

    D/Video merging :: progress: /storage/emulated/0/DCIM/Camera/VID_20171109_070248.mp4: Permission denied

    11-10 17:35:09.905 10592-10592/com.example.hasib.vjoiner D/Video merging: : failure : ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
    built with gcc 4.8 (GCC)

                                                                            libavutil      55. 17.103 / 55. 17.103
                                                                            libavcodec     57. 24.102 / 57. 24.102
                                                                            libavformat    57. 25.100 / 57. 25.100
                                                                            libavdevice    57.  0.101 / 57.  0.101
                                                                            libavfilter     6. 31.100 /  6. 31.100
                                                                            libswscale      4.  0.100 /  4.  0.100
                                                                            libswresample   2.  0.101 /  2.  0.101
                                                                            libpostproc    54.  0.100 / 54.  0.100
                                                                          /storage/emulated/0/DCIM/Camera/VID_20171109_070248.mp4: Permission denied

    11-10 17:35:09.905 10592-10592/com.example.hasib.vjoiner D/Video merging: : finished

    and this is the command i was going to execute.

    String[] command = new String[]{"-y", "-i", videoPaths.get(0), "-i", videoPaths.get(1).toString(), "-strict", "experimental", "-filter_complex",
               "[0:v]scale=iw*min(1920/iw\\,1080/ih):ih*min(1920/iw\\,1080/ih), pad=1920:1080:(1920-iw*min(1920/iw\\,1080/ih))/2:(1080-ih*min(1920/iw\\,1080/ih))/2,setsar=1:1[v0];[1:v] scale=iw*min(1920/iw\\,1080/ih):ih*min(1920/iw\\,1080/ih), pad=1920:1080:(1920-iw*min(1920/iw\\,1080/ih))/2:(1080-ih*min(1920/iw\\,1080/ih))/2,setsar=1:1[v1];[v0][0:a][v1][1:a] concat=n=2:v=1:a=1",
               "-ab", "48000", "-ac", "2", "-ar", "22050", "-s", "1920x1080", "-vcodec", "libx264", "-crf", "27", "-q", "4", "-preset", "ultrafast", outputPath + "/output.mp4"};
  • cv::cudacodec::VideoReader unable to Play rtsp stream

    22 février 2018, par Pawan

    System information

    • OpenCV => 3.3.0
    • Operating System / Platform => Ubuntu 16.04, x86_64
    • Compiler => gcc version 5.4.1 20160904
    • Cuda => 8.0
    • Nvidia card => GTX 1080 Ti
    • ffmpeg details
      • libavutil 55. 74.100 / 55. 74.100
      • libavcodec 57.103.100 / 57.103.100
      • libavformat 57. 77.100 / 57. 77.100
      • libavdevice 57. 7.101 / 57. 7.101
      • libavfilter 6.100.100 / 6.100.100
      • libswscale 4. 7.103 / 4. 7.103
      • libswresample 2. 8.100 / 2. 8.100

    Detailed description

    i am trying to play a rtsp stream using cudacodec::VideoReader

    Rtsp Stream Details ( from vlc )

    stream_details

    this stream plays fine in vlc and cv::VideoCapture but when i try to play it in cudacodec::VideoReader i get a error saying :

    OpenCV Error: Gpu API call (CUDA_ERROR_FILE_NOT_FOUND [Code = 301]) in CuvidVideoSource, file /home/deep/Development/libraries/opencv/opencv/modules/cudacodec/src/cuvid_video_source.cpp, line 66

    OpenCV Error: Assertion failed (init_MediaStream_FFMPEG()) in FFmpegVideoSource, file /home/deep/Development/libraries/opencv/opencv/modules/cudacodec/src/ffmpeg_video_source.cpp, line 101

    Steps to reproduce

    #include <iostream>
    #include "opencv2/opencv_modules.hpp"

    #if defined(HAVE_OPENCV_CUDACODEC)

    #include <opencv2></opencv2>core.hpp>
    #include <opencv2></opencv2>cudacodec.hpp>
    #include <opencv2></opencv2>highgui.hpp>

    int main(int argc, const char* argv[])
    {
       const std::string fname = "rtsp://admin:admin@192.168.1.13/media/video2";

       cv::namedWindow("GPU", cv::WINDOW_NORMAL);

       cv::cuda::GpuMat d_frame;
       cv::Ptr d_reader = cv::cudacodec::createVideoReader(fname);

       for (;;)
       {

           if (!d_reader->nextFrame(d_frame))
               break;

           cv::Mat frame;
           d_frame.download(frame);
           cv::imshow("GPU", frame);

           if (cv::waitKey(3) > 0)
               break;
       }
       return 0;
    }

    #else
    int main()
    {
       std::cout &lt;&lt; "OpenCV was built without CUDA Video decoding support\n" &lt;&lt; std::endl;
       return 0;
    }
    #endif
    </iostream>

    I tried debugging it using GDB and saw that in ffmpeg_video_source.cpp bool init_MediaStream_FFMPEG() directly returns without checking the if condition.

    GDB output

    cv::cudacodec::detail::FFmpegVideoSource::FFmpegVideoSource
    (this=0x402a20 &lt;_start>, fname=...) at /home/deep/Development/libraries/opencv/opencv/modules/cudacodec/src/ffmpeg_video_source.cpp:98
    98      cv::cudacodec::detail::FFmpegVideoSource::FFmpegVideoSource(const String&amp; fname) :
    (gdb) n
    99          stream_(0)
    (gdb) n
    101         CV_Assert( init_MediaStream_FFMPEG() );
    (gdb) s
    (anonymous namespace)::init_MediaStream_FFMPEG () at /home/deep/Development/libraries/opencv/opencv/modules/cudacodec/src/ffmpeg_video_source.cpp:94
    94              return initialized;
    (gdb) display initialized
    4: initialized = false
    (gdb) s
    95          }

    UPDATE :

    I have solved the problem. solution link

  • ffmpeg concatenating videos of different fps while keeping the total length not changed

    23 novembre 2017, par A_Matar

    I wanna pad an mp4 video stream with another video clip of a static image that I created using :

    def generate_white_vid (duration):
       output_filename = os.path.join(p_path,'white_vid_'+" 0:.2f}".format(duration)+'.mp4')
       ffmpeg_create_vid_from_static_img = 'ffmpeg -loop 1 -i /path/WhiteBackground.jpg -c:v libx264 -t %f -pix_fmt yuv420p -vf scale=1920:1080 %s' % (duration, output_filename)
       p = subprocess.Popen(ffmpeg_create_vid_from_static_img, shell=True)
       p.communicate()
       return output_filename

    I use the following to concatenate :

    def concat_vids(clip_paths):
       filenames_txt = open('clips_to_join.txt','w')
       for clip in clip_paths:
           filenames_txt.write ('file \''+ clip+'\'\n')
       filenames_txt.close()
       output_filename = clip_paths[0].split('.', 2)[0]
       output_file_path = os.path.join(root_path, output_filename+'-padded.mp4')
       # join the clips
       ffmpeg_command = ["ffmpeg", "-f", "concat", "-safe", "0", "-i", "clips_to_join.txt", "-codec", "copy", output_file_path] # output_filename = ch0X-start_time-end_time
       p = subprocess.Popen(ffmpeg_command)
       p.communicate() # wait till the subprocess finishes. You can send commands to process as well.
       return output_file_path

    When I check the length of the resulting video after concatenation, I find that it is not equal to the sum of the two segments that I concatenated, and sometimes it is even less by some seconds !!

    Here is how I get the video length in seconds :

    def ffmpeg_len(vid_path):
       '''
       Returns length in seconds using ffmpeg
       '''
       ffmpeg_get_mediafile_length = ['sh', '-c', 'ffmpeg -i "$1" 2>&amp;1 | grep Duration', '_', vid_path]
       p = subprocess.Popen(ffmpeg_get_mediafile_length, stdout=subprocess.PIPE, stderr=subprocess.PIPE)    
       output, err = p.communicate()
       length_regexp = 'Duration: (\d{2}):(\d{2}):(\d{2})(\.\d+),'
       re_length = re.compile(length_regexp)
       matches = re_length.search(output)
       if matches:
           video_length = int(matches.group(1)) * 3600 + \
                           int(matches.group(2)) * 60 + \
                           int(matches.group(3)) + float(matches.group(4))
           return video_length
       else:
           print("Can't determine video length.")
           print err
           raise SystemExit

    My guess is that maybe the concatenation unifies the fps rate for the all the clips to be joined, if this is the case, how to prevent this from happening ? How can I get a video of the desired length exactly.

    Maybe it worth mentioning that the video to padded is very short 0.42 second, the original video is 210.58 and the resultant video is 210.56 !

    I have verified that ffmpeg does generate the desired padding region and it is of the desired length 0.42 I got a 0.43 segment when I forced 30 fps but it is okay.