Recherche avancée

Médias (0)

Mot : - Tags -/alertes

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

Autres articles (67)

  • Qu’est ce qu’un éditorial

    21 juin 2013, par

    Ecrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
    Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
    Vous pouvez personnaliser le formulaire de création d’un éditorial.
    Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

Sur d’autres sites (6696)

  • OSError : [Errno 13] Permission denied with FFMPEG

    14 février 2015, par jing yi

    I have just started using Python and am looking at using python to read mp3 files. I tried to use ffmpeg to read the mp3 file, however, i kept getting error of permission denied.

    Appreciate if you could advise me on how to resolve this error !

    Thank you !

    $ cd '/Users/jingyi/Downloads/' && '/usr/bin/pythonw'  '/Users/jingyi/Downloads/sound detection.py'  && echo Exit status: $? && exit 1
    Traceback (most recent call last):
     File "/Users/jingyi/Downloads/sound detection.py", line 14, in <module>
       pipe = sp.Popen(command, stdout = sp.PIPE)
     File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 709, in __init__
       errread, errwrite)
     File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1326, in _execute_child
       raise child_exception

    OSError: [Errno 13] Permission denied
    </module>

       FFMPEG_BIN = '/Users/jingyi/Downloads/ffmpeg'
       #INPUT_Sound = '/Users/jingyi/Downloads/Snore.mp3'

       import subprocess as sp

       command = [ FFMPEG_BIN,
               '-i', '/Users/jingyi/Downloads/Snore.mp3',
               '-f', 's16le',
               '-acodec', 'pcm_s16le',
               '-ar', '44100', # ouput will have 44100 Hz
               '-ac', '2', # stereo (set to '1' for mono)
               '-']
       pipe = sp.Popen(command, stdout = sp.PIPE)
  • How to convert .srt file into ttml based xml subtitle file using ffmpeg ?

    25 août 2023, par geo-freak

    I have an .srt subtitle file. I want to convert it into .ttml format(or xml) using ffmpeg command. I tried using traditional way to convert this. But ffmpeg throwing an error. Is there any way to convert this in Linux platform ? Or any other command line applications do this conversion ?

    &#xA;

    Below is the command I tried.

    &#xA;

    ffmpeg -i my_srt.srt -y srt-to-xml.xml -v verbose&#xA;&#xA;ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&#xA;built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)&#xA;configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared&#xA;libavutil      56. 31.100 / 56. 31.100&#xA;libavcodec     58. 54.100 / 58. 54.100&#xA;libavformat    58. 29.100 / 58. 29.100&#xA;libavdevice    58.  8.100 / 58.  8.100&#xA;libavfilter     7. 57.100 /  7. 57.100&#xA;libavresample   4.  0.  0 /  4.  0.  0&#xA;libswscale      5.  5.100 /  5.  5.100&#xA;libswresample   3.  5.100 /  3.  5.100&#xA;libpostproc    55.  5.100 / 55.  5.100&#xA;Input #0, srt, from &#x27;my_srt.srt&#x27;:&#xA;Duration: N/A, bitrate: N/A&#xA;    Stream #0:0: Subtitle: subrip&#xA;Output #0, webm_dash_manifest, to &#x27;srt-to-xml.xml&#x27;:&#xA;Output file #0 does not contain any stream&#xA;[AVIOContext @ 0x5614924ef500] Statistics: 22267 bytes read, 0 seeks&#xA;

    &#xA;

    I even tried like below.

    &#xA;

    ffmpeg -i my_srt.srt -y srt_to_ttml.ttml&#xA;

    &#xA;

    It didn't work too.

    &#xA;

  • FFMPEG Corrupt output remuxing MP4 (Using API in C) -First file OK, 2nd file onwards is not

    25 janvier, par RichardP

    I have a simple application written in C - it takes the video from a RTSP camera and just writes to disk in 1 minute segments. The first file created works fine, plays on anlmost anything. The Second file does not play. Programatically, The trace shows they are the same code flows, but I cant seem to find where the problem is to allow the 2nd file to be play exactly the same as the first.

    &#xA;

    There are frames in the 2nd file but they are random. The second file is created EXACTLY the same way as the first.

    &#xA;

    Any help from a guru would be greatly appreciated.

    &#xA;

    EDIT : FIX - The output duration needs to be set before the trailer is written.

    &#xA;

    int actual_duration = (int)difftime(time(NULL), start_time);&#xA;&#xA;for (int i = 0; i &lt; output_ctx->nb_streams; i&#x2B;&#x2B;) {&#xA;    output_ctx->streams[i]->duration = actual_duration * AV_TIME_BASE;&#xA;}&#xA;&#xA;output_ctx->duration = actual_duration * AV_TIME_BASE;&#xA;printf("DURATION = %d\r\n",output_ctx->duration);&#xA;&#xA;// Set the start_time for the output context&#xA;output_ctx->start_time = 0;&#xA;&#xA;av_write_trailer(output_ctx);&#xA;

    &#xA;

    Code flow

    &#xA;

       Open RTSP Stream &#xA;A: Create File n context &#xA;   Remux to file n &#xA;   Wait for minute to change &#xA;   Close File n context  &#xA;   increment n Goto A&#xA;

    &#xA;

    Makefile

    &#xA;

    CC = gcc&#xA;CFLAGS = -Wall -g&#xA;LIBS = -lavformat -lavcodec -lavutil -lavdevice -lswscale -lavfilter -lavutil -lm -lz -lpthread&#xA;&#xA;TARGET = rtsp_remux&#xA;&#xA;all: $(TARGET)&#xA;&#xA;$(TARGET): rtsp_remux.o&#xA;        $(CC) -o $(TARGET) rtsp_remux.o $(LIBS)&#xA;&#xA;rtsp_remux.o: rtsp_remux.c&#xA;        $(CC) $(CFLAGS) -c rtsp_remux.c&#xA;&#xA;clean:&#xA;        rm -f $(TARGET) rtsp_remux.o&#xA;&#xA;.PHONY: all clean&#xA;

    &#xA;

    rtsp_remux.c

    &#xA;

    #include <libavformat></libavformat>avformat.h>&#xA;#include <libavutil></libavutil>time.h>&#xA;#include &#xA;#include &#xA;&#xA;#define OUTPUT_PREFIX "output"&#xA;#define OUTPUT_EXTENSION ".mp4"&#xA;#define MAX_FILES 4&#xA;&#xA;int main(int argc, char *argv[]) {&#xA;    if (argc &lt; 2) {&#xA;        fprintf(stderr, "Usage: %s <rtsp url="url">\n", argv[0]);&#xA;        return -1;&#xA;    }&#xA;&#xA;    const char *rtsp_url = argv[1];&#xA;    AVFormatContext *input_ctx = NULL, *output_ctx = NULL;&#xA;    AVOutputFormat *output_fmt = NULL;&#xA;    AVPacket pkt;&#xA;    int ret, file_count = 0;&#xA;    char output_filename[1024];&#xA;    time_t current_time;&#xA;    struct tm *timeinfo;&#xA;    int rename_lock = 0;&#xA;&#xA;    avformat_network_init();&#xA;&#xA;    if ((ret = avformat_open_input(&amp;input_ctx, rtsp_url, NULL, NULL)) &lt; 0) {&#xA;        fprintf(stderr, "Could not open input file &#x27;%s&#x27;\n", rtsp_url);&#xA;        return -1;&#xA;    }&#xA;&#xA;    if ((ret = avformat_find_stream_info(input_ctx, NULL)) &lt; 0) {&#xA;        fprintf(stderr, "Failed to retrieve input stream information\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    av_dump_format(input_ctx, 0, rtsp_url, 0);&#xA;&#xA;    while (file_count &lt; MAX_FILES) {&#xA;        snprintf(output_filename, sizeof(output_filename), "%s_%03d%s", OUTPUT_PREFIX, file_count, OUTPUT_EXTENSION);&#xA;&#xA;        if ((ret = avformat_alloc_output_context2(&amp;output_ctx, NULL, NULL, output_filename)) &lt; 0) {&#xA;            fprintf(stderr, "Could not create output context\n");&#xA;            return -1;&#xA;        }&#xA;&#xA;        output_fmt = output_ctx->oformat;&#xA;&#xA;        for (int i = 0; i &lt; input_ctx->nb_streams; i&#x2B;&#x2B;) {&#xA;            AVStream *in_stream = input_ctx->streams[i];&#xA;            AVStream *out_stream = avformat_new_stream(output_ctx, NULL);&#xA;            if (!out_stream) {&#xA;                fprintf(stderr, "Failed allocating output stream\n");&#xA;                return -1;&#xA;            }&#xA;&#xA;            if ((ret = avcodec_parameters_copy(out_stream->codecpar, in_stream->codecpar)) &lt; 0) {&#xA;                fprintf(stderr, "Failed to copy codec parameters\n");&#xA;                return -1;&#xA;            }&#xA;            out_stream->codecpar->codec_tag = 0;&#xA;        }&#xA;&#xA;        if (!(output_fmt->flags &amp; AVFMT_NOFILE)) {&#xA;            if ((ret = avio_open(&amp;output_ctx->pb, output_filename, AVIO_FLAG_WRITE)) &lt; 0) {&#xA;                fprintf(stderr, "Could not open output file &#x27;%s&#x27;\n", output_filename);&#xA;                return -1;&#xA;            }&#xA;        }&#xA;&#xA;        if ((ret = avformat_write_header(output_ctx, NULL)) &lt; 0) {&#xA;            fprintf(stderr, "Error occurred when opening output file\n");&#xA;            return -1;&#xA;        }&#xA;&#xA;        while (1) {&#xA;            current_time = time(NULL);&#xA;            timeinfo = localtime(&amp;current_time);&#xA;&#xA;            if (timeinfo->tm_sec == 0 &amp;&amp; !rename_lock) {&#xA;                rename_lock = 1;&#xA;                break;&#xA;            } else if (timeinfo->tm_sec != 0) {&#xA;                rename_lock = 0;&#xA;            }&#xA;&#xA;            if ((ret = av_read_frame(input_ctx, &amp;pkt)) &lt; 0)&#xA;                break;&#xA;&#xA;            AVStream *in_stream = input_ctx->streams[pkt.stream_index];&#xA;            AVStream *out_stream = output_ctx->streams[pkt.stream_index];&#xA;&#xA;            pkt.pts = av_rescale_q_rnd(pkt.pts, in_stream->time_base, out_stream->time_base, AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX);&#xA;            pkt.dts = av_rescale_q_rnd(pkt.dts, in_stream->time_base, out_stream->time_base, AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX);&#xA;            pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, out_stream->time_base);&#xA;            pkt.pos = -1;&#xA;&#xA;            if ((ret = av_interleaved_write_frame(output_ctx, &amp;pkt)) &lt; 0) {&#xA;                fprintf(stderr, "Error muxing packet\n");&#xA;                break;&#xA;            }&#xA;&#xA;            av_packet_unref(&amp;pkt);&#xA;        }&#xA;&#xA;        av_write_trailer(output_ctx);&#xA;&#xA;        if (!(output_fmt->flags &amp; AVFMT_NOFILE))&#xA;            avio_closep(&amp;output_ctx->pb);&#xA;&#xA;        avformat_free_context(output_ctx);&#xA;&#xA;        file_count&#x2B;&#x2B;;&#xA;    }&#xA;&#xA;    avformat_close_input(&amp;input_ctx);&#xA;    avformat_network_deinit();&#xA;&#xA;    return 0;&#xA;}&#xA;</rtsp>

    &#xA;

    I have tried changing to pointers, freeing and different things. I was expecting the 2nd file created to behave identically to the first.

    &#xA;