Recherche avancée

Médias (0)

Mot : - Tags -/objet éditorial

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

Autres articles (112)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

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

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

Sur d’autres sites (15571)

  • Index error with MoviePy and OSError : MoviePy error : failed to read the duration of file

    24 août 2022, par Alejandro

    I made a small script to concatenate some clips. The names of the clips are stored in another text file that is read from.

    


    I get the error first that

    


    in ffmpeg_parse_infos
line = [l for l in lines if keyword in l][index]
IndexError: list index out of range


    


    then during that exception above, another occurs below

    


    Traceback (most recent call last):&#xA;  File "e:\Projects\TwitchMontage\VideoCompilation\src\create_video.py", line 32, in <module>&#xA;    clips = create_clips_from_list(list)&#xA;  File "e:\Projects\TwitchMontage\VideoCompilation\src\create_video.py", line 20, in create_clips_from_list&#xA;    clip = VideoFileClip(str(video_file_path))&#xA;  File "C:\Users\Alejandro\AppData\Local\Programs\Python\Python38\lib\site-packages\moviepy\video\io\VideoFileClip.py", line 88, in __init__&#xA;    self.reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt,&#xA;  File "C:\Users\Alejandro\AppData\Local\Programs\Python\Python38\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 35, in __init__&#xA;    infos = ffmpeg_parse_infos(filename, print_infos, check_duration,&#xA;  File "C:\Users\Alejandro\AppData\Local\Programs\Python\Python38\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 289, in ffmpeg_parse_infos&#xA;    raise IOError(("MoviePy error: failed to read the duration of file %s.\n"&#xA;OSError: MoviePy error: failed to read the duration of file E:\Projects\TwitchMontage\VideoCompilation\VideoFiles\raw_clips\clip0.mp4&#xA;</module>

    &#xA;

    I suspect something is wrong with FFMPEG but I have no idea what to change to fix this. Is there any manipulation I can make to FFMPEG or the videos themselves to make them work with moviepy ?

    &#xA;

    Code is below :

    &#xA;

    import os&#xA;from moviepy.editor import VideoFileClip, concatenate_videoclips&#xA;&#xA;PATH_TO_VALID_CLIPS = &#x27;VideoCompilation/ClipData/valid_clips.txt&#x27;&#xA;PATH_TO_RAW_CLIPS = &#x27;E:\Projects\TwitchMontage\VideoCompilation\VideoFiles\\raw_clips&#x27;&#xA;os.environ[&#x27;IMAGEIO_FFMPEG_EXE&#x27;] = &#x27;ffmpeg&#x27;&#xA;&#xA;def read_valid_clips_list():&#xA;    #read valid clips&#xA;    file = open(PATH_TO_VALID_CLIPS, &#x27;r&#x27;)&#xA;    list = file.readlines()&#xA;    return list&#xA;&#xA;def create_clips_from_list(list):&#xA;    clips = []&#xA;    for i, filename in enumerate(list):&#xA;        print(str(i) &#x2B; &#x27;\n&#x27;)&#xA;        video_file_path = os.path.abspath(os.path.join(PATH_TO_RAW_CLIPS, filename))&#xA;        print(video_file_path &#x2B; &#x27;\n&#x27;)&#xA;        clip = VideoFileClip(str(video_file_path))&#xA;        clips.append(clip)&#xA;&#xA;    return clips&#xA;&#xA;def create_draft(clips):&#xA;    draft = concatenate_videoclips(clips)&#xA;    draft.write_videofile("VideoCompilation/VideoFiles/videos/draft.mp4")&#xA;    return draft&#xA;&#xA;list = read_valid_clips_list()&#xA;clips = create_clips_from_list(list)&#xA;draft = create_draft(clips)&#xA;

    &#xA;

    EDIT :

    &#xA;

    I discovered something strange. When I manually create the combined video, there are no errors but the video created is corrupted and unplayable.

    &#xA;

    sample code image

    &#xA;

  • acces to data stream (KLV) with windows media-foundation

    20 février 2023, par hacenesh

    Is there any way to acces data stream with Windows Media Foundation ?

    &#xA;

    I have a video stream that contains tree streams : Audio, video and Data stream&#xA;When I opend the file with ffmpeg I can access the three stream :

    &#xA;

      &#xA;
    • AVMEDIA_TYPE_AUDIO
    • &#xA;

    • AVMEDIA_TYPE_VIDEO
    • &#xA;

    • AVMEDIA_TYPE_DATA
    • &#xA;

    &#xA;

    This image show more details about the data stream I wanted to retrieve.&#xA;enter image description here

    &#xA;

    With windows media-foundation I can only see audio and video streams.

    &#xA;

    IMFMediaSource* pVideoSource = NULL;&#xA;IMFSourceReader* pVideoReader = NULL;           &#xA;....&#xA;....&#xA;while (pVideoReader->GetStreamSelection(stmIndex, &amp;isSelected) == S_OK) {&#xA;      printf("Stream %d is selected %d.\n", stmIndex, isSelected);&#xA;&#xA;      CHECK_HR(pVideoReader->GetCurrentMediaType(stmIndex, &amp;pStmMediaType), "Failed to get media type for selected stream.");&#xA;&#xA;      std::cout &lt;&lt; "Media type: " &lt;&lt; GetMediaTypeDescription(pStmMediaType) &lt;&lt; std::endl;&#xA;&#xA;      GUID majorMediaType;&#xA;      pStmMediaType->GetGUID(MF_MT_MAJOR_TYPE, &amp;majorMediaType);&#xA;      if (majorMediaType == MFMediaType_Audio) {&#xA;          std::cout &lt;&lt; "Source audio stream index is " &lt;&lt; stmIndex &lt;&lt; "." &lt;&lt; std::endl;&#xA;      }&#xA;      else if (majorMediaType == MFMediaType_Video) {&#xA;          std::cout &lt;&lt; "Video stream index is " &lt;&lt; stmIndex &lt;&lt; "." &lt;&lt; std::endl;&#xA;      }&#xA;      stmIndex&#x2B;&#x2B;;&#xA;      SAFE_RELEASE(pStmMediaType);&#xA;  }&#xA;&#xA;

    &#xA;

    **Output **

    &#xA;

    &#xA;

    Stream 0 is selected 1.&#xA;Media type : MFMediaType_Audio : MF_MT_AUDIO_AVG_BYTES_PER_SECOND=16031, MF_MT_AUDIO_BLOCK_ALIGNMENT=1, 33026EE0-E387-4582-AE0A-34A2AD3BAA18=1, MF_MT_AUDIO_NUM_CHANNELS=2, MF_MT_MAJOR_TYPE=MFMediaType_Audio, MF_MT_AUDIO_SAMPLES_PER_SECOND=48000, MF_MT_AAC_AUDIO_PROFILE_LEVEL_INDICATION=254, MF_MT_AUDIO_PREFER_WAVEFORMATEX=1, MF_MT_USER_DATA=, MF_MT_FIXED_SIZE_SAMPLES=1, MF_MT_AAC_PAYLOAD_TYPE=1, MF_MT_ALL_SAMPLES_INDEPENDENT=1, MF_MT_SAMPLE_SIZE=1, MF_MT_SUBTYPE=MFAudioFormat_AAC,&#xA;Source audio stream index is 0.&#xA;Stream 1 is selected 1.&#xA;Media type : MFMediaType_Video : MF_MT_FRAME_SIZE=W:1920 H : 1080, MF_MT_MPEG_SEQUENCE_HEADER=, MF_MT_MAJOR_TYPE=MFMediaType_Video, MF_MT_AM_FORMAT_TYPE=E06D80E3-DB46-11CF-B4D1-00805F6CBBEA, MF_MT_MPEG2_LEVEL=41, MF_MT_MPEG2_PROFILE=66, MF_MT_FIXED_SIZE_SAMPLES=1, MF_MT_FRAME_RATE=25/1, MF_MT_PIXEL_ASPECT_RATIO=1:1, MF_MT_SAMPLE_SIZE=1, MF_MT_INTERLACE_MODE=2, MF_MT_SUBTYPE=3F40F4F0-5622-4FF8-B6D8-A17A584BEE5E,&#xA;Video stream index is 1.&#xA;Source media type count : 1, is first stream selected 1.&#xA;Default output media type for source reader :&#xA;MFMediaType_Video : MF_MT_FRAME_SIZE=W:1920 H : 1080, MF_MT_MPEG_SEQUENCE_HEADER=, MF_MT_MAJOR_TYPE=MFMediaType_Video, MF_MT_AM_FORMAT_TYPE=E06D80E3-DB46-11CF-B4D1-00805F6CBBEA, MF_MT_MPEG2_LEVEL=41, MF_MT_MPEG2_PROFILE=66, MF_MT_FIXED_SIZE_SAMPLES=1, MF_MT_FRAME_RATE=25/1, MF_MT_PIXEL_ASPECT_RATIO=1:1, MF_MT_SAMPLE_SIZE=1, MF_MT_INTERLACE_MODE=2, MF_MT_SUBTYPE=3F40F4F0-5622-4FF8-B6D8-A17A584BEE5E,

    &#xA;

    &#xA;

    I also looked on the sample metadata. I didn't find anything.&#xA;MFSampleExtension_CaptureMetadata

    &#xA;

     HRESULT hr = videoSample->GetUnknown(MFSampleExtension_CaptureMetadata, IID_IMFAttributes, (void**)&amp;pAttributes);&#xA;

    &#xA;

    Result

    &#xA;

    &#xA;

    hr = 0xc00d36e6 : The requested attribute was not found.&#xA;access to data stream with media-foundation

    &#xA;

    &#xA;

  • ProcessBuilder is not called when trying to start a process

    15 juin 2022, par xnok

    I am trying to understand more about the ffmpeg usage in JavaCV for android studio and for said task I am trying to use ProcessBuilder. I tried writting a simple program to debug the pb.start(); Although, I am not getting a response. What I did was to start a default/empty activity and pasted the following program :

    &#xA;

    package com.example.myapplication;&#xA;&#xA;import androidx.annotation.RequiresApi;&#xA;import androidx.appcompat.app.AppCompatActivity;&#xA;import java.io.BufferedReader;&#xA;import java.io.IOException;&#xA;import java.io.InputStreamReader;&#xA;import java.io.OutputStream;&#xA;&#xA;import org.bytedeco.javacpp.Loader;&#xA;&#xA;import android.os.Build;&#xA;import android.os.Bundle;&#xA;import android.util.Log;&#xA;&#xA;public class MainActivity extends AppCompatActivity {&#xA;    static final int cols = 192;&#xA;    static final int rows = 108;&#xA;    static final String ffmpeg = Loader.load(org.bytedeco.ffmpeg.ffmpeg.class);&#xA;    static final String rtmp_url = "test.flv";&#xA;    static final String[] command = {ffmpeg,&#xA;            "-y",&#xA;            "-f", "rawvideo",&#xA;            "-vcodec", "rawvideo",&#xA;            "-pix_fmt", "bgr24",&#xA;            "-s", (Integer.toString(cols) &#x2B; "x" &#x2B; Integer.toString(rows)),&#xA;            "-r", "10",&#xA;            "-i", "pipe:",&#xA;            "-c:v", "libx264",&#xA;            "-pix_fmt", "yuv420p",&#xA;            "-preset", "ultrafast",&#xA;            "-f", "flv",&#xA;            rtmp_url};&#xA;    @RequiresApi(api = Build.VERSION_CODES.O)&#xA;    @Override&#xA;    protected void onCreate(Bundle savedInstanceState) {&#xA;        super.onCreate(savedInstanceState);&#xA;        setContentView(R.layout.activity_main);&#xA;        new Thread(t1).start();&#xA;&#xA;    }&#xA;    private static Runnable t1 = () -> {&#xA;        Log.e("TAG", "void OnCreate called successfully!");&#xA;        ProcessBuilder pb = new ProcessBuilder(command).redirectErrorStream(true);&#xA;        pb.redirectErrorStream(true);&#xA;        try {&#xA;            Process process = pb.start();&#xA;            BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));&#xA;            OutputStream writer = process.getOutputStream();&#xA;            Log.e("TAG", "Something good happened here");&#xA;        } catch (IOException e) {&#xA;            e.printStackTrace();&#xA;            Log.e("TAG", "Nothing good happened here");&#xA;        }&#xA;    };&#xA;&#xA;&#xA;}&#xA;

    &#xA;

    My current problem is that I can't seem to start properly the processBuilder process via pb.start() ;

    &#xA;

    I get the following logs from the logcat panel :

    &#xA;

    2022-06-14 17:24:46.328 13371-13371/com.example.myapplication E/TAG: void OnCreate called successfully!&#xA;2022-06-14 17:24:46.333 13371-13371/com.example.myapplication E/TAG: Nothing good happened here&#xA;

    &#xA;

    I'd like to understand why is it skipping the try/catch block and not starting the process ?

    &#xA;

    EDIT : I made some changes as per @g00se's suggestions and I got the following stack trace from the code above :

    &#xA;

    2022-06-15 00:32:26.700 29787-29787/? E/USNET: USNET: appName: com.example.myapplication&#xA;2022-06-15 00:32:29.328 29787-29828/com.example.myapplication E/TAG: void OnCreate called successfully!&#xA;2022-06-15 00:32:29.330 29787-29828/com.example.myapplication E/AndroidRuntime: FATAL EXCEPTION: Thread-4&#xA;    Process: com.example.myapplication, PID: 29787&#xA;    java.lang.NullPointerException&#xA;        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1012)&#xA;        at com.example.myapplication.MainActivity.lambda$static$0(MainActivity.java:48)&#xA;        at com.example.myapplication.MainActivity$$ExternalSyntheticLambda0.run(Unknown Source:0)&#xA;        at java.lang.Thread.run(Thread.java:920)&#xA;

    &#xA;