Advanced search

Medias (91)

Other articles (87)

  • MediaSPIP version 0.1 Beta

    16 April 2011, by

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

  • Amélioration de la version de base

    13 September 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Mise à jour de la version 0.1 vers 0.2

    24 June 2013, by

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1); Installation des dépendances pour Smush; Installation de MediaInfo et FFprobe pour la récupération des métadonnées; On n’utilise plus ffmpeg2theora; On n’installe plus flvtool2 au profit de flvtool++; On n’installe plus ffmpeg-php qui n’est plus maintenu au profit de (...)

On other websites (9702)

  • FFMPEG - Download video in parts and concat, stutter at concat points

    23 July 2022, by rnbwSmn

    My goal is to download a video (or M3U8) in parts/chunks which I can later concat.

    


    For context, I would like to download videos in an Android Service which may be stopped at any time, so I think chunking is the right approach.

    


    After some time I got the "downloading the parts" right, using this. I would later put that in a function, and for now I chose the chunks to be 30 seconds long.

    


    %offset% = 30 * %part%

ffmpeg -ss %offset% -t 30 -i INPUT_FILE -avoid_negative_ts 1 out%part%.mp4


    


    The first line is just pseudocode, part is starting at 0.
This works fine, downloading 30 second long .mp4 files.

    


    After that I tried merging them together into a single .mp4. For the tests I only downloaded the first few parts.

    


    Concat command:

    


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


    


    This would be a very short concat.txt file:

    


    file 'out0.mp4'
file 'out1.mp4'


    


    The concat works but has one problem: At the point where both files are actually combined, so at 30 seconds, there is a small stutter in video and audio.

    


    So what I think is going on is that I download parts that are 30s long, starting at multiples of 30s so there is a small overlap? In the "Details" part of the Windows file properties it also shows a length of 31 seconds, so the video is even longer than I want.

    


    I tried setting the duration of each part in the concat.txt, both to 30s and to 30s - 1 frame

    


    23.98 fps -> 1/23.98 spf = 0.0417s


    


    But with a duration of 30 as well as 29.9583, although it is better, there is still a small stutter.

    


    file 'out0.mp4'
duration 29.9583
file 'out1.mp4'
duration 29.9583


    


    I also tried with a different fileformat, .ts files, but the stutter was still there. I still think my timings are not quite right, but at this point I don't know where the problem is exactly. What do I need to change to remove the small stutter?

    


  • How to download live streaming videos with HTTP .flv url

    20 February 2017, by Sajjad Darvishi

    I just wanted to record a live stream by downloading this link but it did’nt work by curl , ffmpeg and wget please help me how can i record this?

    http://uhs-akamai.ustream.tv/dal09/dal09-uhs-live02/live/22505108/1487587571614/plain/uhs/1/chunk_1487590613_79324dc9f7.flv

  • ffmpeg avcodec_parameters_copy crash on android

    9 November 2023, by 徐同鹏

    i'm new to this, and i am trying to create an muxer app out of android ffmpeg, so i compile .so lib through ubuntu with:

    


    API=21
CPU=armv8-a
ARCH=arm64
PREFIX=$(pwd)/android/$CPU/$ARCH
TOOLCHAIN=/root/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64
CROSS_PREFIX=$TOOLCHAIN/bin/aarch64-linux-android-
CC=$TOOLCHAIN/bin/aarch64-linux-android$API-clang
CXX=$TOOLCHAIN/bin/aarch64-linux-android$API-clang++
SYSROOT=$TOOLCHAIN/sysroot
OPTIMIZE_CFLAGS="-march=$CPU"

./configure \
        --prefix=$PREFIX \
        --arch=$ARCH \
        --cpu=$CPU \
        --cross-prefix=$CROSS_PREFIX \
        --cc=$CC \
        --cxx=$CXX \
        --sysroot=$SYSROOT \
        --extra-cflags="-Os -fPIC $OPTIMIZE_CFLAGS" \
        --target-os=android \
        --enable-cross-compile \
        --disable-gpl \
        --enable-shared \
        --disable-static \
        --disable-programs \
        --disable-ffmpeg \
        --disable-ffplay \
        --disable-ffprobe \
        --disable-doc \
        --disable-htmlpages \
        --disable-manpages \
        --disable-txtpages


    


    i also got some c++ code snippet of muxer:

    


    #include &#xA;#include <string>&#xA;#include &#xA;#include <iostream>&#xA;#include <fstream>&#xA;#include &#xA;&#xA;using namespace std;&#xA;&#xA;extern "C" {&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavutil></libavutil>opt.h>&#xA;#include <libswresample></libswresample>swresample.h>&#xA;}&#xA;&#xA;//cout&#xA;#ifndef LOG_TAG&#xA;#define LOG_TAG "recite.debug"&#xA;#include <android></android>log.h>&#xA;#define debug(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)&#xA;#endif&#xA;//cout&#xA;&#xA;string jstringToStdString(JNIEnv* env, jstring jstr) {&#xA;    if (jstr == NULL) {&#xA;        return "";&#xA;    }&#xA;    char* chars = (char*)env->GetStringUTFChars(jstr, NULL);&#xA;    string ret(chars);&#xA;    env->ReleaseStringUTFChars(jstr, chars);&#xA;    return ret;&#xA;}&#xA;&#xA;void FFMPEG_Callback(void* ptr, int level, const char* fmt, va_list vl)&#xA;{&#xA;    //if(level != 32) return;&#xA;    char buffer[1024];&#xA;    vsprintf(buffer, fmt, vl);&#xA;    debug("msg : [%d] %s", level, buffer);&#xA;}&#xA;&#xA;//Java_com_example_recite_display_tabs_Setting_run&#xA;extern "C" JNIEXPORT int JNICALL&#xA;Java_com_example_recite_util_Bilibili_compose(JNIEnv * env, jclass obj, jstring audioSrc, jstring videoSrc, jstring dest)&#xA;{&#xA;    int ret;&#xA;    av_log_set_callback(&amp;FFMPEG_Callback);&#xA;    //    const char* input_video_file_name = "payphone.mp4";&#xA;    //    const char* input_audio_file_name = "payphone.mp3";&#xA;    //    const char* output_file_name = "out.mp4";&#xA;    const char* input_audio_file_name = (const char*)env->GetStringUTFChars(audioSrc, NULL);&#xA;    const char* input_video_file_name = (const char*)env->GetStringUTFChars(videoSrc, NULL);&#xA;    const char* output_file_name = (const char*)env->GetStringUTFChars(dest, NULL);&#xA;&#xA;    debug("video src: %s", input_video_file_name);&#xA;    debug("audio src: %s", input_audio_file_name);&#xA;    debug("dest src: %s", output_file_name);&#xA;&#xA;    AVFormatContext* ifmt_ctx_v = NULL, * ifmt_ctx_a = NULL;&#xA;    AVFormatContext* ofmt_ctx = NULL;&#xA;&#xA;    int in_stream_index_v = -1;&#xA;    int in_stream_index_a = -1;&#xA;&#xA;    int out_stream_index_v = -1;&#xA;    int out_stream_index_a = -1;&#xA;&#xA;    debug("&lt;--------------- input file info --------------->\n");&#xA;&#xA;    if ((ret = avformat_open_input(&amp;ifmt_ctx_v, input_video_file_name, NULL, NULL)) &lt; 0) {&#xA;        debug("Cannot open input file\n");&#xA;        return ret;&#xA;    }&#xA;    if ((ret = avformat_find_stream_info(ifmt_ctx_v, NULL)) &lt; 0) {&#xA;        debug("Cannot find stream information\n");&#xA;        return ret;&#xA;    }&#xA;    ret = av_find_best_stream(ifmt_ctx_v, AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0);&#xA;    if (ret &lt; 0) {&#xA;        debug("Cannot find video stream\n");&#xA;        return ret;&#xA;    }&#xA;    in_stream_index_v = ret;&#xA;    av_dump_format(ifmt_ctx_v, 0, input_video_file_name, 0);&#xA;&#xA;    if ((ret = avformat_open_input(&amp;ifmt_ctx_a, input_audio_file_name, NULL, NULL)) &lt; 0) {&#xA;        debug("Cannot open input file\n");&#xA;        return ret;&#xA;    }&#xA;    if ((ret = avformat_find_stream_info(ifmt_ctx_a, NULL)) &lt; 0) {&#xA;        debug("Cannot find stream information\n");&#xA;        return ret;&#xA;    }&#xA;    ret = av_find_best_stream(ifmt_ctx_a, AVMEDIA_TYPE_AUDIO, -1, -1, NULL, 0);&#xA;    if (ret &lt; 0) {&#xA;        debug("Cannot find audio stream\n");&#xA;        return ret;&#xA;    }&#xA;    in_stream_index_a = ret;&#xA;    av_dump_format(ifmt_ctx_a, 0, input_audio_file_name, 0);&#xA;&#xA;    ret = avformat_alloc_output_context2(&amp;ofmt_ctx, NULL, NULL, output_file_name);&#xA;    if (ret &lt; 0) {&#xA;        debug("Cannot open output file\n");&#xA;        return ret;&#xA;    }&#xA;    if (in_stream_index_v >= 0) {&#xA;        AVStream* in_stream = ifmt_ctx_v->streams[in_stream_index_v];&#xA;        AVStream* out_stream = avformat_new_stream(ofmt_ctx, NULL);&#xA;        debug("\n&lt;--------------- crash begin --------------->\n");&#xA;** //the code crashes here on android **&#xA;***     ret = avcodec_parameters_copy(out_stream->codecpar, in_stream->codecpar);***&#xA;        debug("\n&lt;--------------- crash end --------------->\n");&#xA;        out_stream->codecpar->codec_tag = 0;&#xA;&#xA;        out_stream_index_v = out_stream->index;&#xA;    }&#xA;&#xA;&#xA;// blah...blah...&#xA;&#xA;</fstream></iostream></string>

    &#xA;

    I have already rebuild .so lib twice, it's not working.&#xA;can anyone please tell me why the code works fine on Linux(pc), but it crashes on android?&#xA;and i am not really sure how to debug c++ code in android... any help would be appreciated, tks in advance!!!

    &#xA;