
Recherche avancée
Médias (1)
-
1 000 000 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
Autres articles (96)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
Publier sur MédiaSpip
13 juin 2013Puis-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
Sur d’autres sites (5726)
-
Error Opening RTMP Stream through FFmpeg command when executed through exec package [closed]
3 octobre 2024, par AkhilI have been trying to transcode the live stream from RTMP server running on
rtmp://localhost:1936/live/test
with FFmpeg in a Go application usingos/exec
package, But seems to not work and gives the input/output error (I have attached below). The same exact ffmpeg command when I execute on terminal, works as its supposed to. Not Sure why that is, here is my code for reproducing and analyzing the mistakes.

ffmpegCmd := fmt.Sprintf("ffmpeg -nostdin -i rtmp://localhost:1936/live/%s -c:v libx264 -s %s -f %s %s/stream.mpd",
 streamKey, resolution, sp.OutputFormat, outputPath)
 log.Printf("Executing FFmpeg command: %s", ffmpegCmd)

 // Prepare the command execution with a timeout context
 ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) // Set a 60-second timeout
 defer cancel()

 cmd := exec.CommandContext(ctx, "bash", "-c", ffmpegCmd)



the ffmpeg command looks like this :

ffmpeg -nostdin -i rtmp://localhost:1936/live/test -c:v libx264 -s 1920x1080 -f dash output/test/1080p/stream.mpd


I get the following error :


Error opening input: Input/output error

Error opening input file rtmp://localhost:1936/live/test.

Error opening input files: Input/output error

Exiting normally, received signal 2.

signal: interrupt



I have already tried to break the command, and then execute it. Something like :


cmd := exec.CommandContext(ctx,
 "ffmpeg",
 "-nostdin",
 "-i", "rtmp://localhost:1936/live/"+streamKey,
 "-c:v", "libx264",
 "-s", resolution,
 "-f", sp.OutputFormat,
 outputPath+"/stream.mpd")



After running the ffmpeg command with -loglevel debug and -report :


Here is the logs and errors I get :


When I run it within the go application :


ffmpeg started on 2024-10-02 at 12:00:06
Report written to "ffmpeg-20241002-120006.log"
Log level: 48
Command line:
ffmpeg -loglevel debug -report -i rtmp://localhost:1936/live/test -c:v libx264 -s 1920x1080 -f dash ./output/test/1080p/stream.mpd
ffmpeg version 7.0.2 Copyright (c) 2000-2024 the FFmpeg developers
 built with Apple clang version 15.0.0 (clang-1500.3.9.4)
 configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.0.2_1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon
 libavutil 59. 8.100 / 59. 8.100
 libavcodec 61. 3.100 / 61. 3.100
 libavformat 61. 1.100 / 61. 1.100
 libavdevice 61. 1.100 / 61. 1.100
 libavfilter 10. 1.100 / 10. 1.100
 libswscale 8. 1.100 / 8. 1.100
 libswresample 5. 1.100 / 5. 1.100
 libpostproc 58. 1.100 / 58. 1.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-i' ... matched as input url with argument 'rtmp://localhost:1936/live/test'.
Reading option '-c:v' ... matched as option 'c' (select encoder/decoder ('copy' to copy stream without reencoding)) with argument 'libx264'.
Reading option '-s' ... matched as option 's' (set frame size (WxH or abbreviation)) with argument '1920x1080'.
Reading option '-f' ... matched as option 'f' (force container format (auto-detected otherwise)) with argument 'dash'.
Reading option './output/test/1080p/stream.mpd' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url rtmp://localhost:1936/live/test.
Successfully parsed a group of options.
Opening an input file: rtmp://localhost:1936/live/test.
[AVFormatContext @ 0x13f721f90] Opening 'rtmp://localhost:1936/live/test' for reading
[rtmp @ 0x13f6040e0] No default whitelist set
[tcp @ 0x13f7223d0] No default whitelist set
[tcp @ 0x13f7223d0] Original list of addresses:
[tcp @ 0x13f7223d0] Address ::1 port 1936
[tcp @ 0x13f7223d0] Address 127.0.0.1 port 1936
[tcp @ 0x13f7223d0] Interleaved list of addresses:
[tcp @ 0x13f7223d0] Address ::1 port 1936
[tcp @ 0x13f7223d0] Address 127.0.0.1 port 1936
[tcp @ 0x13f7223d0] Starting connection attempt to ::1 port 1936
[tcp @ 0x13f7223d0] Connection attempt to ::1 port 1936 failed: Connection refused
[tcp @ 0x13f7223d0] Starting connection attempt to 127.0.0.1 port 1936
[tcp @ 0x13f7223d0] Successfully connected to 127.0.0.1 port 1936
[rtmp @ 0x13f6040e0] Handshaking...
[rtmp @ 0x13f6040e0] Type answer 3
[rtmp @ 0x13f6040e0] Server version 13.14.10.13
[rtmp @ 0x13f6040e0] Proto = rtmp, path = /live/test, app = live, fname = test
[rtmp @ 0x13f6040e0] Window acknowledgement size = 5000000
[rtmp @ 0x13f6040e0] Max sent, unacked = 5000000
[rtmp @ 0x13f6040e0] New incoming chunk size = 4096
[rtmp @ 0x13f6040e0] Creating stream...
[rtmp @ 0x13f6040e0] Sending play command for 'test'
[rtmp @ 0x13f6040e0] Deleting stream...
[in#0 @ 0x13f721d40] Error opening input: Input/output error
Error opening input file rtmp://localhost:1936/live/test.
Error opening input files: Input/output error
Exiting normally, received signal 2.



This is what i get when i run the same command on terminal :


<same as="as" but="but" please="please" scroll="scroll" further="further">

[rtmp @ 0x1437144c0] No default whitelist set
[tcp @ 0x143604f20] No default whitelist set
[tcp @ 0x143604f20] Original list of addresses:
[tcp @ 0x143604f20] Address ::1 port 1936
[tcp @ 0x143604f20] Address 127.0.0.1 port 1936
[tcp @ 0x143604f20] Interleaved list of addresses:
[tcp @ 0x143604f20] Address ::1 port 1936
[tcp @ 0x143604f20] Address 127.0.0.1 port 1936
[tcp @ 0x143604f20] Starting connection attempt to ::1 port 1936
[tcp @ 0x143604f20] Connection attempt to ::1 port 1936 failed: Connection refused
[tcp @ 0x143604f20] Starting connection attempt to 127.0.0.1 port 1936
[tcp @ 0x143604f20] Successfully connected to 127.0.0.1 port 1936
[rtmp @ 0x1437144c0] Handshaking...
[rtmp @ 0x1437144c0] Type answer 3
[rtmp @ 0x1437144c0] Server version 13.14.10.13
[rtmp @ 0x1437144c0] Proto = rtmp, path = /live/test, app = live, fname = test
[rtmp @ 0x1437144c0] Window acknowledgement size = 5000000
[rtmp @ 0x1437144c0] Max sent, unacked = 5000000
[rtmp @ 0x1437144c0] New incoming chunk size = 4096
[rtmp @ 0x1437144c0] Creating stream...
[rtmp @ 0x1437144c0] Sending play command for 'test'
[flv @ 0x143604b30] Format flv probed with size=2048 and score=100
[flv @ 0x143604b30] Before avformat_find_stream_info() pos: 13 bytes read:2263 seeks:0 nb_streams:0
Transform tree:
 mdct_inv_float_c - type: mdct_float, len: 64, factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only]
 fft32_ns_float_neon - type: fft_float, len: 32, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]
Transform tree:
 mdct_inv_float_c - type: mdct_float, len: 64, factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only]
 fft32_ns_float_neon - type: fft_float, len: 32, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]
Transform tree:
 mdct_pfa_15xM_inv_float_c - type: mdct_float, len: 120, factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only]
 fft4_fwd_float_neon - type: fft_float, len: 4, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]
Transform tree:
 mdct_inv_float_c - type: mdct_float, len: 128, factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only]
 fft_sr_ns_float_neon - type: fft_float, len: 64, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]
Transform tree:
 mdct_pfa_15xM_inv_float_c - type: mdct_float, len: 480, factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only]
 fft16_ns_float_neon - type: fft_float, len: 16, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]
Transform tree:
 mdct_inv_float_c - type: mdct_float, len: 512, factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only]
 fft_sr_ns_float_neon - type: fft_float, len: 256, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]
Transform tree:
 mdct_pfa_15xM_inv_float_c - type: mdct_float, len: 960, factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only]
 fft32_ns_float_neon - type: fft_float, len: 32, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]
Transform tree:
 mdct_inv_float_c - type: mdct_float, len: 1024, factors[2]: [2, any], flags: [unaligned, out_of_place, inv_only]
 fft_sr_ns_float_neon - type: fft_float, len: 512, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]
Transform tree:
 mdct_fwd_float_c - type: mdct_float, len: 1024, factors[2]: [2, any], flags: [unaligned, out_of_place, fwd_only]
 fft_sr_ns_float_neon - type: fft_float, len: 512, factor: 2, flags: [aligned, inplace, out_of_place, preshuf]
[NULL @ 0x144124920] nal_unit_type: 7(SPS), nal_ref_idc: 3
[NULL @ 0x144124920] Decoding VUI
[NULL @ 0x144124920] nal_unit_type: 8(PPS), nal_ref_idc: 3
[NULL @ 0x144124920] Decoding VUI
[h264 @ 0x144124920] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x144124920] Decoding VUI
[h264 @ 0x144124920] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x144124920] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x144124920] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x144124920] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x144124920] Decoding VUI
[h264 @ 0x144124920] Format yuv420p chosen by get_format().
[h264 @ 0x144124920] Reinit context to 1280x720, pix_fmt: yuv420p
[h264 @ 0x144124920] no picture 
[flv @ 0x143604b30] All info found
[flv @ 0x143604b30] rfps: 29.666667 0.016552
[flv @ 0x143604b30] rfps: 29.750000 0.009347
[flv @ 0x143604b30] rfps: 29.750000 0.009347
[flv @ 0x143604b30] rfps: 29.833333 0.004197
[flv @ 0x143604b30] rfps: 29.916667 0.001104
[flv @ 0x143604b30] rfps: 29.916667 0.001104
[flv @ 0x143604b30] rfps: 30.000000 0.000067
[flv @ 0x143604b30] rfps: 30.000000 0.000067
[flv @ 0x143604b30] rfps: 60.000000 0.000270
[flv @ 0x143604b30] rfps: 60.000000 0.000270
[flv @ 0x143604b30] rfps: 120.000000 0.001079
[flv @ 0x143604b30] rfps: 120.000000 0.001079
[flv @ 0x143604b30] rfps: 240.000000 0.004316
[flv @ 0x143604b30] rfps: 240.000000 0.004316
[flv @ 0x143604b30] rfps: 29.970030 0.000204
[flv @ 0x143604b30] rfps: 29.970030 0.000204
[flv @ 0x143604b30] rfps: 59.940060 0.000814
[flv @ 0x143604b30] rfps: 59.940060 0.000814
[flv @ 0x143604b30] After avformat_find_stream_info() pos: 496783 bytes read:496783 seeks:0 frames:179
Input #0, flv, from 'rtmp://localhost:1936/live/test':
 Metadata:
 |RtmpSampleAccess: true
 Server : NGINX RTMP (github.com/arut/nginx-rtmp-module)
 displayWidth : 1280
 displayHeight : 720
 fps : 30
 profile : 
 level : 
 Duration: 00:00:00.00, start: 6.742000, bitrate: N/A
 Stream #0:0, 138, 1/1000: Audio: aac (LC), 48000 Hz, stereo, fltp, 163 kb/s
 Stream #0:1, 41, 1/1000: Video: h264 (High), 1 reference frame, yuv420p(tv, bt709, progressive, left), 1280x720 [SAR 1:1 DAR 16:9], 0/1, 2560 kb/s, 30 fps, 30 tbr, 1k tbn
Successfully opened the file.
Parsing a group of options: output url ./output/test/1080p/stream.mpd.
Applying option c:v (select encoder/decoder ('copy' to copy stream without reencoding)) with argument libx264.
Applying option s (set frame size (WxH or abbreviation)) with argument 1920x1080.
Applying option f (force container format (auto-detected otherwise)) with argument dash.
Successfully parsed a group of options.
Opening an output file: ./output/test/1080p/stream.mpd.
[out#0/dash @ 0x123707480] No explicit maps, mapping streams automatically...
[vost#0:0/libx264 @ 0x123707d60] Created video stream from input stream 0:1
detected 10 logical cores
[h264 @ 0x123607b70] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x123607b70] Decoding VUI
[h264 @ 0x123607b70] nal_unit_type: 8(PPS), nal_ref_idc: 3
[aost#0:1/aac @ 0x144028080] Created audio stream from input stream 0:0
Transform tree:
 mdct_inv_float_c - type: md

<it simply="simply" starts="starts" working="working">
</it></same>


I am not sure if there is something to do with Permissions.


-
How to add custom configure option with VCPKG when building FFMPEG ?
1er novembre 2024, par NickWuzhDoes anyone know how to enable x11grab format in FFMPEG with VCPKG ?


I'm building FFMPEG in vcpkg manifest mode. Here is my vcpkg.json :


{
 "name": "project",
 "version": "1.0.0",
 "dependencies": [
 {
 "name": "ffmpeg",
 "features": [
 "avcodec",
 "avdevice",
 "avfilter",
 "avformat",
 "bzip2",
 "ffmpeg",
 "lzma",
 "postproc",
 "swresample",
 "swscale",
 "x264",
 "zlib"
 ]
 },
 "iniparser",
 "jsoncpp",
 "spdlog"
 ]
}




And I want to enable x11grab configuration in order to capture screen in Linux, but I found no feature was adapted.
Soon I found that —enable-libxcb was needed in configure and it was autodetect. So I build and install libxcb with source. And pkg-config can find it :


$ pkg-config --modversion xcb
1.17.0



But it doesn't work because in default it is —disable-autodetect in $VCPKG_ROOT/ports/ffmpeg/portfile.cmake :


set(OPTIONS "--enable-pic --disable-doc --enable-debug --enable-runtime-cpudetect --disable-autodetect")



I try to modify $VCPKG_ROOT/ports/ffmpeg/portfile.cmake —enalbe-autodetect, but it doesn't work either. Here is the short message when appling
vcpkg install --triplet x64-linux-release


-- Using source at /usr/local/src/cpp/third-party/vcpkg/buildtrees/ffmpeg/src/n7.0.2-8cb3114be3.clean
-- Getting CMake variables for x64-linux-release
-- Building Options: --enable-pic --disable-doc --enable-debug --enable-runtime-cpudetect --disable-autodetect --target-os=linux --enable-pthreads --cc=gcc --host_cc=gcc --cxx=g++ --nm=nm --ar='ar' --ranlib=ranlib --strip=strip --enable-gpl --enable-ffmpeg --disable-ffplay --disable-ffprobe --enable-avcodec --enable-avdevice --enable-avformat --enable-avfilter --enable-postproc --enable-swresample --enable-swscale --disable-alsa --disable-amf --disable-libaom --disable-libass --disable-avisynth --enable-bzlib --disable-libdav1d --disable-libfdk-aac --disable-libfontconfig --disable-libharfbuzz --disable-libfreetype --disable-libfribidi --disable-iconv --disable-libilbc --enable-lzma --disable-libmp3lame --disable-libmodplug --disable-cuda --disable-nvenc --disable-nvdec --disable-cuvid --disable-ffnvcodec --disable-opencl --disable-opengl --disable-libopenh264 --disable-libopenjpeg --disable-libopenmpt --disable-openssl --disable-libopus --enable-sdl2 --disable-libsnappy --disable-libsoxr --disable-libspeex --disable-libssh --disable-libtensorflow --disable-libtesseract --disable-libtheora --disable-libvorbis --disable-libvpx --disable-libwebp --enable-libx264 --disable-libx265 --disable-libxml2 --enable-zlib --disable-libsrt --disable-libmfx --enable-cross-compile --pkg-config="/bin/pkg-config" --pkg-config-flags=--static
-- Building Release Options: --enable-optimizations --extra-ldflags=-L"/usr/local/src/cpp/cmq/build/vcpkg_installed/x64-linux-release/lib"
-- Building ffmpeg for Release



$ ffmpeg -devices
ffmpeg version 7.0.2 Copyright (c) 2000-2024 the FFmpeg developers
 built with gcc 14.2.0 (GCC)
 configuration: --prefix=/usr/local/src/cpp/third-party/vcpkg/packages/ffmpeg_x64-linux-release --enable-pic --disable-doc --enable-debug --enable-runtime-cpudetect --disable-autodetect --target-os=linux --enable-pthreads --cc=gcc --host_cc=gcc --cxx=g++ --nm=nm --ar=ar --ranlib=ranlib --strip=strip --enable-gpl --enable-ffmpeg --disable-ffplay --disable-ffprobe --enable-avcodec --enable-avdevice --enable-avformat --enable-avfilter --enable-postproc --enable-swresample --enable-swscale --disable-alsa --disable-amf --disable-libaom --disable-libass --disable-avisynth --enable-bzlib --disable-libdav1d --disable-libfdk-aac --disable-libfontconfig --disable-libharfbuzz --disable-libfreetype --disable-libfribidi --disable-iconv --disable-libilbc --enable-lzma --disable-libmp3lame --disable-libmodplug --disable-cuda --disable-nvenc --disable-nvdec --disable-cuvid --disable-ffnvcodec --disable-opencl --disable-opengl --disable-libopenh264 --disable-libopenjpeg --disable-libopenmpt --disable-openssl --disable-libopus --disable-sdl2 --disable-libsnappy --disable-libsoxr --disable-libspeex --disable-libssh --disable-libtensorflow --disable-libtesseract --disable-libtheora --disable-libvorbis --disable-libvpx --disable-libwebp --enable-libx264 --disable-libx265 --disable-libxml2 --enable-zlib --disable-libsrt --disable-libmfx --enable-cross-compile --pkg-config=/bin/pkg-config --pkg-config-flags=--static --enable-optimizations --extra-ldflags=-L/usr/local/src/cpp/cmq/vcpkg_installed/x64-linux-release/lib --arch=x86_64 --enable-asm --enable-x86asm
 libavutil 59. 8.100 / 59. 8.100
 libavcodec 61. 3.100 / 61. 3.100
 libavformat 61. 1.100 / 61. 1.100
 libavdevice 61. 1.100 / 61. 1.100
 libavfilter 10. 1.100 / 10. 1.100
 libswscale 8. 1.100 / 8. 1.100
 libswresample 5. 1.100 / 5. 1.100
 libpostproc 58. 1.100 / 58. 1.100
Devices:
 D. = Demuxing supported
 .E = Muxing supported
 ---
 D lavfi Libavfilter virtual input device
 DE oss OSS (Open Sound System) playback



-
How to add subtitles using FFmpeg-kit ?
17 novembre 2024, par Mohammed BekeleI'm running a Flutter app with Ffmpeg-kit package to burn a subtitle on a video. I have a words list with the timings and map that to generate an srt and ass file, but when executing this it didn't work.


Firstly, here is how I generated the Ass file.


Future<string> _createAssFile() async {
 String filePath = await getAssOutputFilePath();

 final file = File(filePath);
 final buffer = StringBuffer();

 // Write ASS headers
 buffer.writeln('[Script Info]');
 buffer.writeln('Title: Generated ASS');
 buffer.writeln('ScriptType: v4.00+');
 buffer.writeln('Collisions: Normal');
 buffer.writeln('PlayDepth: 0');
 buffer.writeln('Timer: 100,0000');
 buffer.writeln('[V4+ Styles]');
 buffer.writeln(
 'Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding');
 buffer.writeln(
 'Style: Default,Arial,40,&H00FFFFFF,&H000000FF,&H00000000,&H80000000,1,1,1,1,100,100,0,0,1,1,1,2,10,10,10,1');
 buffer.writeln('[Events]');
 buffer.writeln(
 'Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text');

 // Write events (subtitles)
 for (int i = 0; i < widget.words.length; i++) {
 final word = widget.words[i];
 final startTime = _formatAssTime(word['startTime'].toDouble());
 final endTime = _formatAssTime(word['endTime'].toDouble());
 final text = word['word'];

 buffer.writeln('Dialogue: 0,$startTime,$endTime,Default,,0,0,0,,$text');
 }

 await file.writeAsString(buffer.toString());
 return filePath;
 }

 String _formatAssTime(double seconds) {
 final int hours = seconds ~/ 3600;
 final int minutes = ((seconds % 3600) ~/ 60);
 final int secs = (seconds % 60).toInt();
 final int millis = ((seconds - secs) * 1000).toInt() % 1000;

 return '${hours.toString().padLeft(1, '0')}:${minutes.toString().padLeft(2, '0')}:${secs.toString().padLeft(2, '0')}.${(millis ~/ 10).toString().padLeft(2, '0')}';
 }
</string>


Then I used this command which was the official way of adding ass file to a video.


String newCmd = "-i $videoPath -vf ass=$assFilePath -c:a copy $_outputPath";



Yet when executing this command it did not work. However I changed it to this command


String newCmd = "-i $videoPath -i $assFilePath $_outputPath";



Well, that code works but the styling is not being applied. So I tried yet another command to filter and position the ass file.


String newCmd = "-i $videoPath -i $assFilePath -filter_complex \"[0:v][1:s]ass=\\an5:text='%{event.text}',scale=iw*0.8:ih*0.8,setdar=16/9[outv]\" -map [outv] -c:a copy $_outputPath";



This made it even worse, because the app crashed when I ran this. Also there is a log for this command before crashing


F/libc (19624): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x19 in tid 21314 (pool-4-thread-7), pid 19624 (ple.caption_app)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/a15nsxx/a15:14/UP1A.231005.007/A155FXXU1AWKA:user/release-keys'
Revision: '5'
ABI: 'arm64'
Processor: '7'
Timestamp: 2024-07-10 19:27:40.812476860+0300
Process uptime: 1746s
Cmdline: com.example.caption_app
pid: 19624, tid: 21314, name: pool-4-thread-7 >>> com.example.caption_app <<<
uid: 10377
tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000019
Cause: null pointer dereference
 x0 0000000000000001 x1 b400006ec98d8660 x2 0000000000000000 x3 0000000000000002
 x4 0000006f62d1ea12 x5 b400006e04f745ea x6 352f35372f64352f x7 7f7f7f7f7f7f7f7f
 x8 632ace36577a905e x9 632ace36577a905e x10 0000006e191378c0 x11 0000000000000001
 x12 0000000000000001 x13 0000000000000000 x14 0000000000000004 x15 0000000000000008
 x16 0000006e27ffa358 x17 0000006e27dbfb00 x18 0000006e00d48000 x19 0000006f62d1f0e8
 x20 0000006f62d24000 x21 0000006e27ffc5d0 x22 0000006e27ffc5f0 x23 0000000000000000
 x24 b400006f3f089248 x25 0000006f62d1f220 x26 b400006f3f057b20 x27 0000000000000002
 x28 0000000000000088 x29 0000006f62d1f100
 lr 0000006e27dbfb0c sp 0000006f62d1f0a0 pc 0000006e27dbfb10 pst 0000000060001000
1 total frames
backtrace:
 #00 pc 0000000000121b10 /data/app/~~oWqjrGA2indQhuEw6u_J2A==/com.example.caption_app-u2Ofk54FVtMc5D-i3SLC6g==/base.apk!libavfilter.so (offset 0x10a46000) (avfilter_inout_free+16) 
Lost connection to device.



I tried the normal command in my local machine on Windows, and this is what I used


ffmpeg -i F:\ffmpeg\video.avi -vf subtitles='F\:\\ffmpeg\\caption.srt':force_style='Fontsize=24' F:\ffmpeg\new.mp4



As you can see above when subtitles are used it had an extra backslashes for each path and a pre backslash after the partition letter. But I don't know if this does apply for android devices. How can I make sense of this ?