Recherche avancée

Médias (0)

Mot : - Tags -/content

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

Autres articles (56)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Submit enhancements and plugins

    13 avril 2011

    If you have developed a new extension to add one or more useful features to MediaSPIP, let us know and its integration into the core MedisSPIP functionality will be considered.
    You can use the development discussion list to request for help with creating a plugin. As MediaSPIP is based on SPIP - or you can use the SPIP discussion list SPIP-Zone.

Sur d’autres sites (7084)

  • NGINX RTMP Server - Continuity replacement of track

    6 janvier 2023, par sweetngx

    I broadcast my video archive as live streaming with FFMpeg or similar applications. But since there are multiple videos, ffmpeg reconnects with the rtmp server in each new track, and while watching the live stream, the connection naturally terminates in each video transition and I continue watching by reconnecting to rtmp. What I want to do is that when ffmpeg switches to each new track, the rtmp server does not terminate my connection and continues the new video stream without interruption, that is, in flow changes, the rtmp server can wait for the new flow for a while and continue where it left off. I actually tried to do this using wait_video but it is not efficient and stable enough. How do you think I can solve this problem ? Should I solve it on the FFMpeg side or should I solve it on the Rtmp Server side ? All my videos have the same resolution and codec properties

    


  • FFmpeg remuxing parts of an audio file

    22 décembre 2022, par zorleone

    I'm trying to remux individual tracks from a FLAC file using the FFmpeg libraries.
I get the starting timestamps from a Cue sheet, I seek to the timestamps using avformat_seek_file. However after writing the packets to output files, they only have data from the beginning of the input file.

    


    This is the code snippet which opens the input FLAC and also creates an output AVFormatContext for each track. I'm guessing the issue is avformat_seek_file, it doesn't seem to do anything, since even though I seek to the beginning of a track, the output file contains data from the beginning of the input.

    


        for(int i = 0; i <= sheet.ntracks; i++) {
        sheet.avfmtctx = avformat_alloc_context();
        if(avformat_open_input(&sheet.avfmtctx, sheet.file, NULL, NULL) < 0) {
            fprintf(stderr,
                    "avformat_open_input(): failed to open %s\n",
                    sheet.file);
            return 1;
        }
        int audio_stream_idx = -1;
        for(int i = 0; i < sheet.avfmtctx->nb_streams; i++) {
            if(sheet.avfmtctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
                audio_stream_idx = i;
                break;
            }
        }
        avformat_find_stream_info(sheet.avfmtctx, NULL);
        AVFormatContext *output;
        char *filepath = title_to_filepath(&sheet.tracks[i], sheet.file);
        avformat_alloc_output_context2(&output, NULL, NULL, filepath);
        AVStream *out_audio_stream = avformat_new_stream(output, NULL);
        avcodec_parameters_copy(out_audio_stream->codecpar,
                                sheet.avfmtctx->streams[audio_stream_idx]->codecpar);

        if(avio_open(&output->pb, filepath, AVIO_FLAG_WRITE) < 0) {
            fprintf(stderr, "Failed to open %s for writing\n", filepath);
            return 1;
        }
        if(avformat_write_header(output, NULL) < 0) {
            fprintf(stderr, "avformat_write_header() failed\n");
            return 1;
        }
        int64_t current_frame = sheet.tracks[i].index;
        int64_t next_track_index = (i < sheet.ntracks) ?
                                   sheet.tracks[i + 1].index :
                                   INT64_MAX;
        if(avformat_seek_file(sheet.avfmtctx,
                           -1,
                           INT64_MIN,
                           current_frame,
                           current_frame,
                           0) < 0) {
            fprintf(stderr, "Failed to seek to the index of track %d\n", i);
            avformat_free_context(sheet.avfmtctx);
            sheet.avfmtctx = NULL;
            av_write_trailer(output);
            avio_closep(&output->pb);
            avformat_free_context(output);
            free(filepath);
            continue;
        }
        AVPacket *pkt = av_packet_alloc();
        int64_t pts_diff = AV_NOPTS_VALUE, dts_diff = AV_NOPTS_VALUE;
        while(current_frame < next_track_index && !avio_feof(output->pb)) {
            int ret;
            if((ret = av_read_frame(sheet.avfmtctx, pkt)) < 0) {
                if(ret != AVERROR_EOF)
                    fprintf(stderr, "av_read_frame() failed: %s\n", av_err2str(ret));
                break;
            }
            if(pkt->stream_index != audio_stream_idx)
                continue;
            // runs only once
            if(pts_diff == AV_NOPTS_VALUE && dts_diff == AV_NOPTS_VALUE) {
                pts_diff = pkt->pts;
                dts_diff = pkt->dts;
            }

            pkt->stream_index = 0; // first and only stream
            pkt->pts -= pts_diff;
            pkt->dts -= dts_diff;
            pkt->pos = -1;
            av_interleaved_write_frame(output, pkt);

            current_frame++;
        }

        avformat_free_context(sheet.avfmtctx);
        sheet.avfmtctx = NULL;

        av_write_trailer(output);
        av_packet_free(&pkt);
        avio_closep(&output->pb);
        avformat_free_context(output);

        free(filepath);
    }



    


    current_frame and next_track_index are calculated from the INDEX lines in the Cue sheet : MM * 60 * 75 + SS * 75 + FF.
Can someone tell me what I'm doing wrong, and how to get the data I need from the input ?

    


  • corrupted video after concat parts of captured RTSP stream with FFMPEG

    11 décembre 2022, par 555Russich

    Target : capture rtsp stream with sound from intercom camera and save it as 1hour duration video

    



    


    URL for rtsp stream is updаting every 2 minutes, but i need to get parts with 1hour duration. So i see only solution to concatenate 2 minutes videos. It's required time between capturing stream parts to get response from server and reconnect with another url

    



    


    First i tried opencv. It's not working with sound

    



    


    Then i started using ffmpeg :

    


    Capturing stream :

    


    ffmpeg -rtsp_transport tcp -i  2min_part.mp4


    


    Concatenating :

    


    ffmpeg -safe 0 -f concat -i parts_list.txt -c copy concatenated_1.mp4


    


    in stdout getting Non-monotonous DTS in output stream :

    


    [mp4 @ 0x560c12d80bc0] Non-monotonous DTS in output stream 0:0; previous: 57400952, current: 41462297; changing to 57400953. This may result in incorrect timestamps in the output file.
[mp4 @ 0x560c12d80bc0] Non-monotonous DTS in output stream 0:0; previous: 57400953, current: 41462809; changing to 57400954. This may result in incorrect timestamps in the output file.
[mp4 @ 0x560c12d80bc0] Non-monotonous DTS in output stream 0:0; previous: 57400954, current: 41463321; changing to 57400955. This may result in incorrect timestamps in the output file.
...


    


    After opening video in media players i see that from one second video is stopped, but sound is going on. Interesting part that with every new opening this second (starting from video stops) changes

    



    


    Then i tried this solution :

    


    ffmpeg -safe 0 -f concat -segment_time_metadata 1 -i parts_list.txt -vf select=concatdec_select -af aselect=concatdec_select,aresample=async=1 concatenated_2.mp4


    


    No Non-monotonous DTS wаrnings, but video is still corrupted like first. Also this solution requires a lot of CPU while first concatenating method is very fast.

    



    


    Question : How to do concatenating and get not corrupted video ? May be i need to configure capturing options to simply use concatenating with -c copy ?

    


    parts of videos and concatenated

    


    using exiftool concatenated_1.mp4 i see that :

    


    Duration                        : 1:17:44
Track Duration                  : 1:17:44
Media Duration                  : 0:53:59