Recherche avancée

Médias (91)

Autres articles (79)

  • Amélioration de la version de base

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

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

Sur d’autres sites (6876)

  • How to recover video from H264 frames and timestamps [closed]

    10 juin 2024, par kokosda

    My service receives H264 frames and some metadata related to them like Timestamp from MS Teams.

    


    Observations :

    


      

    • Those frames are inter-frame compressed.
    • 


    • Resolution of those frames can change.
    • 


    • Timestamps are like this one 39264692280552704. That represents year 125 if fed to .NET consturctor new DateTime(39264692280552704), so I need to add 1899 years to get a real date.
    • 


    • I can wrap the sequence to a playable mp4 container with ffmpeg -i input.h264 -c copy output.mp4, however it is not what I want because the resulting video plays too fast, like on fast forward. Thus, I would like those timestamps would be considered to recover a real timeline.
    • 


    


    I merged all the H264 frames in one file like input.h264 and saved all the timestamps in another file like metadata.json. In metadata.json, each object describes a single frame from input.h264.

    


    My question is how to recover the source video from frames and timestamps that I received from Teams ? Particularly, using FFMPEG.

    


  • Flutter : How to use "ffmpeg_kit_flutter" to merge videos ?

    28 mai 2024, par Hani Kanakri

    i am using "ffmpeg_kit_flutter" to merge two videos with code

    


    &#xA;import &#x27;dart:io&#x27;;&#xA;&#xA;import &#x27;package:ffmpeg_kit_flutter/ffmpeg_kit.dart&#x27;;&#xA;import &#x27;package:ffmpeg_kit_flutter/abstract_session.dart&#x27;;&#xA;import &#x27;package:ffmpeg_kit_flutter/return_code.dart&#x27;;&#xA;import &#x27;package:flutter/material.dart&#x27;;&#xA;import &#x27;package:flutter_bloc/flutter_bloc.dart&#x27;;&#xA;import &#x27;package:wechat_assets_picker/wechat_assets_picker.dart&#x27;;&#xA;&#xA;import &#x27;/features/merge_videos/cubit/merge_videos_state.dart&#x27;;&#xA;&#xA;class MergeVideosCubit extends Cubit<mergevideosstate> {&#xA;  MergeVideosCubit(this.originalFile) : super(InitialMergeVideos());&#xA;  final File? originalFile;&#xA;&#xA;  Future<void> selectVideo(BuildContext context) async {&#xA;    final List<assetentity>? videos = await AssetPicker.pickAssets(&#xA;      context,&#xA;      pickerConfig: const AssetPickerConfig(requestType: RequestType.video),&#xA;    );&#xA;&#xA;    if (videos != null &amp;&amp; videos.isNotEmpty) {&#xA;      for (AssetEntity asset in videos) {&#xA;        File? videoFile = await asset.file;&#xA;        if (videoFile != null) {&#xA;          print(&#x27;Selected Asset Path: ${videoFile.path}&#x27;);&#xA;          mergeVideos(originalFile!.path, videoFile.path);&#xA;        }&#xA;      }&#xA;    }&#xA;  }&#xA;&#xA;  Future<void> mergeVideos(String inputPath1, String inputPath2) async {&#xA;    final String outputPath = "/storage/emulated/0/merged_video_${now()}.mp4";&#xA;    // final String command =&#xA;    //     &#x27;-i $inputPath1 -i $inputPath2 -filter_complex "[0:v][0:a][1:v][1:a] concat=n=2:v=1:a=1[outv][outa]" -map "[outv]" -map "[outa]" -y $outputPath&#x27;;&#xA;    final String command =&#xA;        &#x27;-i $inputPath1 -i $inputPath2 -filter_complex "[0:v][1:v]concat=n=2:v=1:a=0[outv]" -map "[outv]" -y $outputPath&#x27;;&#xA;    print("FFmpeg process starting with command: $command");&#xA;    print(command);&#xA;    print("LOADING LOADING LOADING LOADING LOADING LOADING LOADING MERGE");&#xA;    emit(LoadMergeVideos());&#xA;    await FFmpegKit.execute(command).then((value) async {&#xA;      await value.getDuration();&#xA;      var id = await value.getSessionId();&#xA;&#xA;      print(value);&#xA;      print(id);&#xA;      print(await value.getDuration());&#xA;    });&#xA;    await FFmpegKit.executeAsync(command, (session) async {&#xA;      final returnCode = await session.getReturnCode();&#xA;      await session.getSessionId();&#xA;      print(await session.getSessionId());&#xA;&#xA;      if (ReturnCode.isSuccess(returnCode)) {&#xA;        print("SUCCESS: Video merged successfully at $outputPath");&#xA;        print("SUCCESS SUCCESS SUCCESS SUCCESS SUCCESS SUCCESS MERGE");&#xA;        emit(SuccessMergeVideos());&#xA;&#xA;      } else if (ReturnCode.isCancel(returnCode)) {&#xA;        print("CANCELLED: Video merging was cancelled.");&#xA;        print("CANCEL CANCEL CANCEL CANCEL CANCEL CANCEL CANCEL MERGE");&#xA;        emit(CancelMergeVideos());&#xA;&#xA;      } else {&#xA;        print("ERROR: Failed to merge videos.");&#xA;        print("ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR MERGE");&#xA;        emit(ErrorMergeVideos());&#xA;&#xA;        final failLog = await session.getFailStackTrace();&#xA;&#xA;        print("FFmpeg Failure Log: $failLog");&#xA;      }&#xA;    });&#xA;  }&#xA;&#xA;  String now() {&#xA;    final DateTime now = DateTime.now();&#xA;    return "${now.year}${now.month}${now.day}_${now.hour}${now.minute}${now.second}";&#xA;  }&#xA;}&#xA;</void></assetentity></void></mergevideosstate>

    &#xA;

    The console when i run the code

    &#xA;

    &#xA;D/EGL_emulation(23858): app_time_stats: avg=2379.66ms min=5.87ms max=23160.09ms count=10&#xA;I/PhotoManager(23858): uri: content://media/external/file&#xA;I/PhotoManager(23858): projection: _display_name, _data, _id, title, bucket_id, bucket_display_name, width, height, orientation, date_added, date_modified, mime_type, datetaken, duration, media_type, relative_path&#xA;I/PhotoManager(23858): selection: _id = ?&#xA;I/PhotoManager(23858): selectionArgs: 1000000039&#xA;I/PhotoManager(23858): sortOrder: null&#xA;I/PhotoManager(23858): sql: _id = 1000000039&#xA;I/PhotoManager(23858): cursor count: 1&#xA;I/flutter (23858): Selected Asset Path: /storage/emulated/0/Movies/VID_20240512_115116.mp4&#xA;I/flutter (23858): FFmpeg process starting with command: -i /storage/emulated/0/Movies/VID_20240512_115128.mp4 -i /storage/emulated/0/Movies/VID_20240512_115116.mp4 -filter_complex "[0:v][1:v]concat=n=2:v=1:a=0[outv]" -map "[outv]" -y /storage/emulated/0/merged_video_2024513_122719.mp4&#xA;I/flutter (23858): -i /storage/emulated/0/Movies/VID_20240512_115128.mp4 -i /storage/emulated/0/Movies/VID_20240512_115116.mp4 -filter_complex "[0:v][1:v]concat=n=2:v=1:a=0[outv]" -map "[outv]" -y /storage/emulated/0/merged_video_2024513_122719.mp4&#xA;I/flutter (23858): LOADING LOADING LOADING LOADING LOADING LOADING LOADING MERGE&#xA;I/flutter (23858): Instance of &#x27;FFmpegSession&#x27;&#xA;I/flutter (23858): 1&#xA;I/flutter (23858): 246&#xA;I/flutter (23858): 2&#xA;I/flutter (23858): ERROR: Failed to merge videos.&#xA;I/flutter (23858): ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR MERGE&#xA;D/EGL_emulation(23858): app_time_stats: avg=87.27ms min=4.92ms max=319.92ms count=13&#xA;I/flutter (23858): FFmpeg Failure Log: null&#xA;

    &#xA;

    In "mergeVideos" function the "returnCode" it return value "1" when i look in the package code

    &#xA;

    getState() async {&#xA;    try {&#xA;      return _platform&#xA;          .abstractSessionGetState(this.getSessionId())&#xA;          .then((state) {&#xA;        switch (state) {&#xA;          case 0:&#xA;            return SessionState.created;&#xA;          case 1:&#xA;            return SessionState.running;&#xA;          case 2:&#xA;            return SessionState.failed;&#xA;          case 3:&#xA;          default:&#xA;            return SessionState.completed;&#xA;        }&#xA;      });&#xA;    } on PlatformException catch (e, stack) {&#xA;      print("Plugin getState error: ${e.message}");&#xA;      return Future.error("getState failed.", stack);&#xA;    }&#xA;}&#xA;

    &#xA;

    Which mean its keep running but in my code it does not wait until complete merging

    &#xA;

    how can i fix that ??!

    &#xA;

    but i think my problem is in command(concat)

    &#xA;

    &#xA;-i /storage/emulated/0/Movies/VID_20240512_115128.mp4 -i /storage/emulated/0/Movies/VID_20240512_115116.mp4 -filter_complex "[0:v][1:v]concat=n=2:v=1:a=0[outv]" -map "[outv]" -y /storage/emulated/0/merged_video_2024513_122719.mp4&#xA;

    &#xA;

    (This is my command when i run the code) ??

    &#xA;

  • FFMpeg command line to create specific MPD Manifest

    22 février 2024, par Seth Haberman

    I have tried to get an FFMpeg command to yield the below manifest. Right below is the FFmpeg command that I have tried to make but it has not created the same manifest file as what I am trying to replicate a stream from a third party system to add my own stream to their system so that it will actually play back.

    &#xA;

    "$ffmpeg_path" \&#xA;    -i "$input_file" \&#xA;    -r 30000/1001 \&#xA;    -vf "scale=3840:1080" \&#xA;    -c:v libx265 \&#xA;    -c:a aac -b:a 128k \&#xA;    -ar 48000 \&#xA;    -f dash \&#xA;    -use_timeline 1 \&#xA;    -use_template 1 \&#xA;    -init_seg_name "init-stream\$RepresentationID\$.m4s" \&#xA;    -media_seg_name "chunk-stream\$RepresentationID\$-\$Number%05d\$.m4s" \&#xA;    -seg_duration 3 \&#xA;    "$output_file"&#xA;

    &#xA;

    The code above yields a manifest that is structured like below.

    &#xA;

    &lt;?xml version="1.0" encoding="utf-8"?>&#xA;<mpd xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" mediapresentationduration="PT1M35.1S" maxsegmentduration="PT3.0S" minbuffertime="PT16.8S">&#xA;    <programinformation>&#xA;    </programinformation>&#xA;    <servicedescription>&#xA;    </servicedescription>&#xA;    <period start="PT0.0S">&#xA;        <adaptationset contenttype="video" startwithsap="1" segmentalignment="true" bitstreamswitching="true" framerate="30000/1001" maxwidth="3840" maxheight="1080" par="32:9">&#xA;            <representation mimetype="video/mp4" codecs="hev1" bandwidth="2227590" width="3840" height="1080" sar="1:1">&#xA;                <segmenttemplate timescale="30000" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startnumber="1">&#xA;                    <segmenttimeline>&#xA;                        <s t="0" d="247247"></s>&#xA;                        <s d="250250" r="9"></s>&#xA;                        <s d="104104"></s>&#xA;                    </segmenttimeline>&#xA;                </segmenttemplate>&#xA;            </representation>&#xA;        </adaptationset>&#xA;        <adaptationset contenttype="audio" startwithsap="1" segmentalignment="true" bitstreamswitching="true">&#xA;            <representation mimetype="audio/mp4" codecs="mp4a.40.2" bandwidth="128000" audiosamplingrate="48000">&#xA;                <audiochannelconfiguration schemeiduri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="1"></audiochannelconfiguration>&#xA;                <segmenttemplate timescale="48000" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startnumber="1">&#xA;                    <segmenttimeline>&#xA;                        <s t="0" d="143360"></s>&#xA;                        <s d="144384" r="29"></s>&#xA;                        <s d="93120"></s>&#xA;                    </segmenttimeline>&#xA;                </segmenttemplate>&#xA;            </representation>&#xA;        </adaptationset>&#xA;    </period>&#xA;</mpd>&#xA;&#xA;

    &#xA;

    The problem is that I I need it to create a stream where the manifest looks like the manifest below. If it doesn't look or function as below, it will not playback correctly on this third parties system.

    &#xA;

    &lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?>&#xA;<mpd xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" mediapresentationduration="PT1M35.7S" minbuffertime="PT5.9S">&#xA;    <programinformation></programinformation>&#xA;    <period start="PT0.0S">&#xA;        <adaptationset contenttype="video" segmentalignment="true" bitstreamswitching="true">&#xA;            <representation bandwidth="12000000" width="3840" height="1080" framerate="30000/1001" mimetype="video/mp4" codecs="hev1">&#xA;                <segmenttemplate media="chunk-stream$RepresentationID$-$Number%05d$.m4s" initialization="init-stream$RepresentationID$.m4s" startnumber="1" timescale="30000">&#xA;                    <segmenttimeline>&#xA;                        <s t="0" d="89089" r="31"></s>&#xA;                        <s d="21021"></s>&#xA;                    </segmenttimeline>&#xA;                </segmenttemplate>&#xA;            </representation>&#xA;        </adaptationset>&#xA;        <adaptationset contenttype="audio" segmentalignment="true" bitstreamswitching="true">&#xA;            <representation bandwidth="1536000" audiosamplingrate="48000" mimetype="audio/mp4" codecs="mp4a.40.2">&#xA;                <audiochannelconfiguration schemeiduri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="16"></audiochannelconfiguration>&#xA;                <segmenttemplate media="chunk-stream$RepresentationID$-$Number%05d$.m4s" initialization="init-stream$RepresentationID$.m4s" startnumber="1" timescale="48000">&#xA;                    <segmenttimeline>&#xA;                        <s t="0" d="143360"></s>&#xA;                        <s d="142336" r="2"></s>&#xA;                        <s d="143360"></s>&#xA;                        <s d="142336" r="3"></s>&#xA;                        <s d="143360"></s>&#xA;                        <s d="142336" r="3"></s>&#xA;                        <s d="143360"></s>&#xA;                        <s d="142336" r="3"></s>&#xA;                        <s d="143360"></s>&#xA;                        <s d="142336" r="3"></s>&#xA;                        <s d="143360"></s>&#xA;                        <s d="142336" r="3"></s>&#xA;                        <s d="143360"></s>&#xA;                        <s d="142336" r="1"></s>&#xA;                        <s d="32768"></s>&#xA;                    </segmenttimeline>&#xA;                </segmenttemplate>&#xA;            </representation>&#xA;        </adaptationset>&#xA;    </period>&#xA;</mpd>&#xA;

    &#xA;