Recherche avancée

Médias (91)

Autres articles (36)

  • 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 (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (6218)

  • Facing issue with mp4Parser

    20 novembre 2014, par Rohit

    I am trying to trim video with the help of mp4Parser. In output am getting trimmed video but just before video finishes it give error "Sorry cant Play this video". Video am making is H264.

       public static void main(String args) throws IOException {

       Movie movie = new MovieCreator()
               .build(new RandomAccessFileIsoBufferWrapperImpl(
                       new File(
                               "/sdcard/Videos11/"+args+".mp4")));

       List<track> tracks = movie.getTracks();
       Log.e("Tracks","Following are the Tracks:- "+tracks);
       movie.setTracks(new LinkedList<track>());
       // remove all tracks we will create new tracks from the old

       double startTime = 0.000;
       double endTime = 6.000;

       boolean timeCorrected = false;

       // Here we try to find a track that has sync samples. Since we can only
       // start decoding
       // at such a sample we SHOULD make sure that the start of the new
       // fragment is exactly
       // such a frame
       for (Track track : tracks) {
           if (track.getSyncSamples() != null
                   &amp;&amp; track.getSyncSamples().length > 0) {
               if (timeCorrected) {
                   // This exception here could be a false positive in case we
                   // have multiple tracks
                   // with sync samples at exactly the same positions. E.g. a
                   // single movie containing
                   // multiple qualities of the same video (Microsoft Smooth
                   // Streaming file)

                   throw new RuntimeException(
                           "The startTime has already been corrected by another track with SyncSample. Not Supported.");
               }
               startTime = correctTimeToNextSyncSample(track, startTime);
               endTime = correctTimeToNextSyncSample(track, endTime);
               timeCorrected = true;
           }
       }

       for (Track track : tracks) {
           long currentSample = 0;
           double currentTime = 0;
           long startSample = -1;
           long endSample = -1;

           for (int i = 0; i &lt; track.getDecodingTimeEntries().size(); i++) {
               TimeToSampleBox.Entry entry = track.getDecodingTimeEntries().get(i);
               for (int j = 0; j &lt; entry.getCount(); j++) {
                   // entry.getDelta() is the amount of time the current sample
                   // covers.

                   if (currentTime &lt;= startTime) {
                       // current sample is still before the new starttime
                       startSample = currentSample;
                   }
                   if (currentTime &lt;= endTime) {
                       // current sample is after the new start time and still
                       // before the new endtime
                       endSample = currentSample;
                   } else {
                       // current sample is after the end of the cropped video
                       break;
                   }
                   currentTime += (double) entry.getDelta()
                           / (double) track.getTrackMetaData().getTimescale();
                   currentSample++;
               }
           }
           movie.addTrack(new CroppedTrack(track, startSample, endSample));
       }

       IsoFile out = new DefaultMp4Builder().build(movie);

       String filePath = "sdcard/test"+i+".mp4";
       i++;
       File f = new File(filePath);
       FileOutputStream fos = new FileOutputStream(f);
       BufferedOutputStream bos = new BufferedOutputStream(fos, 65535);
       out.getBox(new IsoOutputStream(fos));
       bos.close();
       fos.flush();
       fos.close();

    }

    private static double correctTimeToNextSyncSample(Track track,
           double cutHere) {
       double[] timeOfSyncSamples = new double[track.getSyncSamples().length];
       long currentSample = 0;
       double currentTime = 0;
       for (int i = 0; i &lt; track.getDecodingTimeEntries().size(); i++) {
           TimeToSampleBox.Entry entry = track.getDecodingTimeEntries().get(i);
           for (int j = 0; j &lt; entry.getCount(); j++) {
               if (Arrays.binarySearch(track.getSyncSamples(),
                       currentSample + 1) >= 0) {
                   // samples always start with 1 but we start with zero
                   // therefore +1
                   timeOfSyncSamples[Arrays.binarySearch(
                           track.getSyncSamples(), currentSample + 1)] = currentTime;
               }
               currentTime += (double) entry.getDelta()
                       / (double) track.getTrackMetaData().getTimescale();
               currentSample++;
           }
       }
       for (double timeOfSyncSample : timeOfSyncSamples) {
           if (timeOfSyncSample > cutHere) {
               return timeOfSyncSample;
           }
       }
       return timeOfSyncSamples[timeOfSyncSamples.length - 1];
    }
    </track></track>

    Making video of 30 seconds and want to trim first 6 seconds. Working but in last(between 5 to 6 sec) it shows Cant play this video. Any help will be appreciated.

  • building ffmpeg 2.1.8 with MSVC2013 (configure produces errors)

    29 juin 2017, par scaram

    I am trying to build ffmpeg 2.1.8 for a legacy project. I use windows 10, MSVC 2013, MSYS, YASM and this tutorial.

    After

    ./configure --toolchain=msvc --enable-shared

    I see the many errors in config.log, here the first three ones

    1. error : ’test’ declared as an array with a negative size
    2. fatal error C1189 : #error : "unsatisfied condition : defined GLIBC"
    3. fatal error C1083 : File (Include) cannot be opened : "newlib.h" : No such file or directory

    here the more detailed information...

    C:/Users/scaram/AppData/Local/Temp/ffconf.LgAWDJFi.o_preprocessed.c:8859:27: error: 'test' declared as an array with a negative size
    ffconf.LgAWDJFi.o_converted.c
    C:/Users/scaram/AppData/Local/Temp/ffconf.RncapARb.c(1) : error C2118: Negativer Index
    check_cpp_condition features.h defined __UCLIBC__
    check_cpp
    BEGIN /tmp/ffconf.RncapARb.c
       1   #include
       2   #if !(defined __UCLIBC__)
       3   #error "unsatisfied condition: defined __UCLIBC__"
       4   #endif
    END /tmp/ffconf.RncapARb.c
    c99wrap cl -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -nologo -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64 -P -Fi /tmp/ffconf.LgAWDJFi.o /tmp/ffconf.RncapARb.c
    ffconf.RncapARb.c
    C:/Users/scaram/AppData/Local/Temp/ffconf.RncapARb.c(3) : fatal error C1189: #error :  "unsatisfied condition: defined __UCLIBC__"
    check_cpp_condition features.h defined __GLIBC__
    check_cpp
    BEGIN /tmp/ffconf.RncapARb.c
       1   #include
       2   #if !(defined __GLIBC__)
       3   #error "unsatisfied condition: defined __GLIBC__"
       4   #endif
    END /tmp/ffconf.RncapARb.c
    c99wrap cl -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -nologo -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64 -P -Fi /tmp/ffconf.LgAWDJFi.o /tmp/ffconf.RncapARb.c
    ffconf.RncapARb.c
    C:/Users/scaram/AppData/Local/Temp/ffconf.RncapARb.c(3) : fatal error C1189: #error :  "unsatisfied condition: defined __GLIBC__"
    check_cpp_condition newlib.h defined _NEWLIB_VERSION
    check_cpp
    BEGIN /tmp/ffconf.RncapARb.c
       1   #include
       2   #if !(defined _NEWLIB_VERSION)
       3   #error "unsatisfied condition: defined _NEWLIB_VERSION"
       4   #endif
    END /tmp/ffconf.RncapARb.c
    c99wrap cl -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -nologo -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64 -P -Fi /tmp/ffconf.LgAWDJFi.o /tmp/ffconf.RncapARb.c
    ffconf.RncapARb.c
    C:/Users/scaram/AppData/Local/Temp/ffconf.RncapARb.c(1) : fatal error C1083: File (Include) cannot be opened: "newlib.h": No such file or directory
    check_header _mingw.h
    check_cpp
    BEGIN /tmp/ffconf.RncapARb.c
       1   #include &lt;_mingw.h>
       2   int x;
    END /tmp/ffconf.RncapARb.c

    What can I do to make it work ?

  • VLC RTSP HTML5 transcoding

    30 mai 2022, par Pierogi

    I'm trying to get audio streaming on an HTML page from an RTSP server.

    &#xA;

    The RTSP server is the rtsp-simple-server running a command line below.
    &#xA;./rtsp-simple-server rtsp-simple-server.yml.
    &#xA;The configure file is the default.

    &#xA;

    The stream player is FFmpeg running a command line below.
    &#xA;ffmpeg -re -stream_loop -1 -i myaudio.mp3 -c copy -f rtsp -rtsp_transport tcp rtsp://localhost:8554/mystream

    &#xA;

    The console log at the time the rtsp-simple-server and the ffmpeg are started is below.

    &#xA;

    2022/05/29 19:06:38 INF rtsp-simple-server v0.18.4&#xA;2022/05/29 19:06:38 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)&#xA;2022/05/29 19:06:38 INF [RTMP] listener opened on :1935&#xA;2022/05/29 19:06:38 INF [HLS] listener opened on :8888&#xA;2022/05/29 19:09:16 INF [RTSP] [conn [::1]:62737] opened&#xA;2022/05/29 19:09:16 INF [RTSP] [session 271690815] created by [::1]:62737&#xA;2022/05/29 19:09:16 INF [RTSP] [session 271690815] is publishing to path &#x27;mystream&#x27;, 1 track with TCP&#xA;

    &#xA;

    And the time the rtsp path(rtsp ://localhost:8554/mystream) is opened by VLC, the contents can be played properly. The additional console log at the time is below.

    &#xA;

    2022/05/29 19:13:19 INF [RTSP] [conn 127.0.0.1:62780] opened&#xA;2022/05/29 19:13:19 INF [RTSP] [session 734209460] created by 127.0.0.1:62780&#xA;2022/05/29 19:13:19 INF [RTSP] [session 734209460] is reading from path &#x27;mystream&#x27;, 1 track with UDP&#xA;2022/05/29 19:13:29 INF [RTSP] [session 734209460] destroyed (teared down by 127.0.0.1:62780)&#xA;2022/05/29 19:13:29 INF [RTSP] [conn 127.0.0.1:62780] closed (EOF)&#xA;2022/05/29 19:13:29 INF [RTSP] [conn 127.0.0.1:62781] opened&#xA;2022/05/29 19:13:29 INF [RTSP] [session 445756113] created by 127.0.0.1:62781&#xA;2022/05/29 19:13:29 INF [RTSP] [session 445756113] is reading from path &#x27;mystream&#x27;, 1 track with TCP&#xA;

    &#xA;

    However, I open the rtsp streaming from the VLC's "Network" tab like below,&#xA;enter image description here

    &#xA;

    and configure the "Stream output" like below,&#xA;enter image description here

    &#xA;

    and I tried to get this streaming from an HTML page like below,

    &#xA;

    &#xA;&#xA;  &#xA;    &#xA;    &#xA;  &#xA;  &#xA;    <h1>transcode test</h1>&#xA;    <audio src="http://localhost:9999/mystream" autoplay="autoplay"></audio>&#xA;  &#xA;&#xA;

    &#xA;

    the browser console displays Failed to load resource: the server responded with a status of 404 (Not found). I've already tried other ports(etc. 8080).

    &#xA;

    So, how can I get the rtsp stream from the RTSP server on an HTML page.&#xA;Any idea ?

    &#xA;

    My environment.

    &#xA;

      &#xA;
    • Browser : Microsoft edge
    • &#xA;

    • OS : MacOS 11.6.5
    • &#xA;

    • rtsp-simple-server : 0.18.4
    • &#xA;

    • FFmpeg : 5.0.1
    • &#xA;

    • VLC : 3.0.17.3
    • &#xA;

    &#xA;