Recherche avancée

Médias (0)

Mot : - Tags -/clipboard

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

Autres articles (76)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

Sur d’autres sites (7103)

  • Encoded Video's path gets changed in database after encoding with ffmpeg and celery and works as normal without celery

    16 novembre 2020, par Danny

    I have this code to transcode video and it works well without celery. With celery, the path of the file in the database shows a different path and the video cannot be played in the browser, but it saves the file in the correct location in the pc.

    


    If I don't use celery, then the file path in database is media/videos/videos/<filename>.mp4</filename> and file also gets saved here. This way the template is able to play the video. But if I use celery, the output gets saved in media/videos/videos/<filename>.mp4</filename> but the path in database will be media/<filename>.mp4</filename> somehow and thus template can't play the video.

    &#xA;

    Is it because my page gets updated before the task ? and not getting saved properly ?

    &#xA;

    views.py

    &#xA;

    def post(self, *args, **kwargs):&#xA;    form = VideoPostForm(self.request.POST or None, self.request.FILES or None)&#xA;    if form.is_valid():&#xA;        video = form.save(commit=False)&#xA;        video.user = self.request.user&#xA;        video.save()&#xA;        form.save_m2m()&#xA;        # task_video_encoding(video.id)&#xA;        task_video_encoding.delay(video.id)&#xA;        return redirect(&#x27;videos:my_video_home&#x27;)&#xA;    else:&#xA;        raise ValidationError(&#x27;Check all form fields.&#x27;)&#xA;

    &#xA;

    encoding.py

    &#xA;

    def encode_video(video_id):&#xA;    video = VideoPost.objects.get(id = video_id)&#xA;    input_file_path = video.temp_file.path&#xA;    # print(input_file_path)&#xA;    input_file_name = video.title&#xA;    #get the filename (without extension)&#xA;    filename = os.path.basename(input_file_path)&#xA;    # print(filename)&#xA;    # path to the new file, change it according to where you want to put it&#xA;    output_file_name = os.path.join(&#x27;{}.mp4&#x27;.format(filename))&#xA;    # print(output_file_name)&#xA;    # output_file_path = os.path.join(settings.MEDIA_ROOT, output_file_name)&#xA;    output_file_path = os.path.join(settings.MEDIA_ROOT, &#x27;videos&#x27;, &#x27;videos&#x27;, output_file_name)&#xA;    # print(output_file_path)&#xA;&#xA;    for i in range(1):&#xA;        subprocess.call([settings.VIDEO_ENCODING_FFMPEG_PATH, &#x27;-i&#x27;, input_file_path, &#x27;-codec:v&#x27;, &#x27;libx264&#x27;, &#x27;-crf&#x27;, &#x27;-preset&#x27;,&#xA;                    &#x27;-b:v&#x27;, &#x27;3000k&#x27;, &#x27;-maxrate&#x27;, &#x27;-bufsize&#x27;, &#x27;6000k&#x27;, &#x27;-vf&#x27;, &#x27;scale=-2:720&#x27;,&#xA;                    &#x27;-codec:a&#x27;, &#x27;aac&#x27;, &#x27;128k&#x27;, &#x27;-strict&#x27;, &#x27;-2&#x27;, output_file_path])&#xA;    # Save the new file in the database&#xA;    video.file = output_file_name&#xA;    video.save(update_fields=[&#x27;file&#x27;])&#xA;    print(video.file)&#xA;    video.temp_file.delete()&#xA;

    &#xA;

    models

    &#xA;

    class VideoPost(models.Model):&#xA;    user                = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, blank=True, null=True)&#xA;    title               = models.TextField(max_length=1000)&#xA;    temp_file           = models.FileField(upload_to=&#x27;videos/temp_videos/&#x27;, validators=[validate_file_extension], null=True)&#xA;    file                = models.FileField(upload_to=&#x27;videos/videos/&#x27;, validators=[validate_file_extension], blank=True, max_length=255)&#xA;    post_date           = models.DateTimeField(auto_now_add=True, verbose_name="Date Posted")&#xA;    updated             = models.DateTimeField(auto_now_add=True, verbose_name="Date Updated")&#xA;    slug                = models.SlugField(blank=True, unique=True, max_length=255)&#xA;

    &#xA;

    Can anyone help me how to change this code in a way to show the converted video properly in the template.

    &#xA;

  • ffmpeg output to stdout is a black box (python)

    27 juillet 2022, par dwilliams

    Project Background :&#xA;The project I'm working on takes an image from a UE simulation camera, uses OpenCV to convert the image to .jpg, and streams the .jpg to a localhost port so that a second program can retrieve the images and annotate the objects in the simulation. I am attempting to convert these to a suitable format for UE4's WmfMediaPlayer via ffmpeg so that it can be streamed to another localhost port.

    &#xA;

    Problem :&#xA;I have managed to get a the stream active but the video at the end of stream is a black square. I'm confident but not 100% certain that I've setup the ffmpeg correctly. The output to console seem to imply that the conversion is working but I've been fooled before. It could also be the flask yield component.

    &#xA;

    ffmpeg declaration/setup :

    &#xA;

    process = (&#xA;        ffmpeg&#xA;        .input(&#x27;C:/MOT/test.jpg&#x27;)   &#xA;        .output(&#x27;pipe:1&#x27;, vcodec=&#x27;libx264&#x27;, format=&#x27;avi&#x27;)   &#xA;        .overwrite_output()&#xA;        .run_async(pipe_stdin=True, pipe_stdout=True)&#xA;    )&#xA;

    &#xA;

    Flask Integration :

    &#xA;

    @app.route(&#x27;/annotated&#x27;)&#xA;def annotated():&#xA;    return Response(&#xA;        frame_generator_annotated(),&#xA;        mimetype=&#x27;multipart/x-mixed-replace; boundary=frame&#x27;&#xA;    )&#xA;&#xA;&#xA;def frame_generator_annotated():&#xA;    global process&#xA;    while (True):&#xA;        frame = process.stdout.read()&#xA;        yield (b&#x27;--frame\r\n&#x27;&#xA;               b&#x27;Content-Type: video/avi\r\n\r\n&#x27; &#x2B; frame &#x2B; b&#x27;\r\n\r\n&#x27;)&#xA;

    &#xA;

    stream view :&#xA;http://localhost:5001/annotated

    &#xA;

    ffmpeg console output :

    &#xA;

    Running on all addresses.&#xA;   WARNING: This is a development server. Do not use it in a production deployment.&#xA; * Running on http://192.168.1.220:5001/ (Press CTRL&#x2B;C to quit)&#xA;ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers&#xA;  built with gcc 10.2.1 (GCC) 20200726&#xA;  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --enable-librav1e --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf&#xA;  libavutil      56. 51.100 / 56. 51.100&#xA;  libavcodec     58. 91.100 / 58. 91.100&#xA;  libavformat    58. 45.100 / 58. 45.100&#xA;  libavdevice    58. 10.100 / 58. 10.100&#xA;  libavfilter     7. 85.100 /  7. 85.100&#xA;  libswscale      5.  7.100 /  5.  7.100&#xA;  libswresample   3.  7.100 /  3.  7.100&#xA;  libpostproc    55.  7.100 / 55.  7.100&#xA;[mjpeg @ 00000269be0faec0] EOI missing, emulating&#xA;Input #0, image2, from &#x27;C:/MOT/test.jpg&#x27;:&#xA;  Duration: 00:00:00.04, start: 0.000000, bitrate: 1968 kb/s&#xA;    Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1024x576 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))&#xA;Press [q] to stop, [?] for help&#xA;[libx264 @ 00000269be0fc240] using SAR=1/1&#xA;[libx264 @ 00000269be0fc240] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2&#xA;[libx264 @ 00000269be0fc240] profile High, level 3.1, 4:2:0, 8-bit&#xA;Output #0, avi, to &#x27;pipe:1&#x27;:&#xA;  Metadata:&#xA;    ISFT            : Lavf58.45.100&#xA;    Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuvj420p(pc), 1024x576 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 25 tbn, 25 tbc&#xA;    Metadata:&#xA;      encoder         : Lavc58.91.100 libx264&#xA;    Side data:&#xA;      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A&#xA;frame=    1 fps=0.0 q=28.0 Lsize=       2kB time=00:00:00.04 bitrate= 447.2kbits/s speed= 2.9x    &#xA;video:1kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 157.307251%&#xA;[libx264 @ 00000269be0fc240] frame I:1     Avg QP:13.00  size:   869&#xA;[libx264 @ 00000269be0fc240] mb I  I16..4: 100.0%  0.0%  0.0%&#xA;[libx264 @ 00000269be0fc240] 8x8 transform intra:0.0%&#xA;[libx264 @ 00000269be0fc240] coded y,uvDC,uvAC intra: 0.0% 0.0% 0.0%&#xA;[libx264 @ 00000269be0fc240] i16 v,h,dc,p: 97%  0%  3%  0%&#xA;[libx264 @ 00000269be0fc240] i8c dc,h,v,p: 100%  0%  0%  0%&#xA;[libx264 @ 00000269be0fc240] kb/s:173.80&#xA;

    &#xA;

  • in FFMPEG_AVAILABLE,How to insert a black frame in avpicture_fill if the frame is not available [on hold]

    22 août 2018, par Vidhi Patel

    This code should work :

    avpicture_fill((AVPicture*) picture, (tUInt8*) this->ptrOVL->get_pOutputDataOVL(), PIX_FMT_BGR24, c->width, c->height);

    but as the title says : what if the frame isn’t available ?