
Recherche avancée
Médias (1)
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
Autres articles (68)
-
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Le profil des utilisateurs
12 avril 2011, parChaque 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 (...)
Sur d’autres sites (3862)
-
RTMP server with OpenCV (python)
12 février 2024, par OvernoutI'm trying to process an RTMP stream in Python, using OpenCV2 but I'm not able to get OpenCV to capture it (i.e. act as RTMP server).


I can run FFmpeg/FFplay from the command line and receive the stream successfully.
What could cause OpenCV to fail opening the stream in listening mode ?


Here is my code :


import cv2

cap = cv2.VideoCapture("rtmp://0.0.0.0:8000/live", cv2.CAP_FFMPEG)

if not cap.isOpened():
 print("Cannot open video source")
 exit()



And the output :


[tcp @ 00000192c490d640] Connection to tcp://0.0.0.0:8000 failed: Error number -138 occurred
[rtmp @ 00000192c490d580] Cannot open connection tcp://0.0.0.0:8000 
Cannot open video source



edit2 : Output with debug logging turned on :


output of the python script with debug logging on:
[DEBUG:0@0.017] global videoio_registry.cpp:218 cv::`anonymous-namespace'::VideoBackendRegistry::VideoBackendRegistry VIDEOIO: Builtin backends(9): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); MSMF(970); DSHOW(960); CV_IMAGES(950); CV_MJPEG(940); UEYE(930); OBSENSOR(920)
[DEBUG:0@0.026] global videoio_registry.cpp:242 cv::`anonymous-namespace'::VideoBackendRegistry::VideoBackendRegistry VIDEOIO: Available backends(9): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); MSMF(970); DSHOW(960); CV_IMAGES(950); CV_MJPEG(940); UEYE(930); OBSENSOR(920)
[ INFO:0@0.031] global videoio_registry.cpp:244 cv::`anonymous-namespace'::VideoBackendRegistry::VideoBackendRegistry VIDEOIO: Enabled backends(9, sorted by priority): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); MSMF(970); DSHOW(960); CV_IMAGES(950); CV_MJPEG(940); UEYE(930); OBSENSOR(920)
[ WARN:0@0.037] global cap.cpp:132 cv::VideoCapture::open VIDEOIO(FFMPEG): trying capture filename='rtmp://192.168.254.101:8000/live' ...
[ INFO:0@0.040] global backend_plugin.cpp:383 cv::impl::getPluginCandidates Found 2 plugin(s) for FFMPEG
[ INFO:0@0.043] global plugin_loader.impl.hpp:67 cv::plugin::impl::DynamicLib::libraryLoad load C:\Users\me\src\opencv\.venv\Lib\site-packages\cv2\opencv_videoio_ffmpeg490_64.dll => OK
[ INFO:0@0.047] global backend_plugin.cpp:50 cv::impl::PluginBackend::initCaptureAPI Found entry: 'opencv_videoio_capture_plugin_init_v1'
[ INFO:0@0.049] global backend_plugin.cpp:169 cv::impl::PluginBackend::checkCompatibility Video I/O: initialized 'FFmpeg OpenCV Video I/O Capture plugin': built with OpenCV 4.9 (ABI/API = 1/1), current OpenCV version is '4.9.0' (ABI/API = 1/1)
[ INFO:0@0.055] global backend_plugin.cpp:69 cv::impl::PluginBackend::initCaptureAPI Video I/O: plugin is ready to use 'FFmpeg OpenCV Video I/O Capture plugin'
[ INFO:0@0.058] global backend_plugin.cpp:84 cv::impl::PluginBackend::initWriterAPI Found entry: 'opencv_videoio_writer_plugin_init_v1'
[ INFO:0@0.061] global backend_plugin.cpp:169 cv::impl::PluginBackend::checkCompatibility Video I/O: initialized 'FFmpeg OpenCV Video I/O Writer plugin': built with OpenCV 4.9 (ABI/API = 1/1), current OpenCV version is '4.9.0' (ABI/API = 1/1)
[ INFO:0@0.065] global backend_plugin.cpp:103 cv::impl::PluginBackend::initWriterAPI Video I/O: plugin is ready to use 'FFmpeg OpenCV Video I/O Writer plugin'
[tcp @ 00000266b2f0d0c0] Connection to tcp://192.168.254.101:8000 failed: Error number -138 occurred
[rtmp @ 00000266b2f0cfc0] Cannot open connection tcp://192.168.254.101:8000
[ WARN:0@5.630] global cap.cpp:155 cv::VideoCapture::open VIDEOIO(FFMPEG): can't create capture
[DEBUG:0@5.632] global cap.cpp:225 cv::VideoCapture::open VIDEOIO: choosen backend does not work or wrong. Please make sure that your computer support chosen backend and OpenCV built with right flags.
Cannot open video source
[ INFO:1@5.661] global plugin_loader.impl.hpp:74 cv::plugin::impl::DynamicLib::libraryRelease unload C:\Users\me\src\opencv\.venv\Lib\site-packages\cv2\opencv_videoio_ffmpeg490_64.dll



Here is the output of cv2.getBuildInformation()


General configuration for OpenCV 4.9.0 =====================================
 Version control: 4.9.0

 Platform:
 Timestamp: 2023-12-31T11:21:12Z
 Host: Windows 10.0.17763 AMD64
 CMake: 3.24.2
 CMake generator: Visual Studio 14 2015
 CMake build tool: MSBuild.exe
 MSVC: 1900
 Configuration: Debug Release

 CPU/HW features:
 Baseline: SSE SSE2 SSE3
 requested: SSE3
 Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2
 requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
 SSE4_1 (16 files): + SSSE3 SSE4_1
 SSE4_2 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2
 FP16 (0 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
 AVX (8 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
 AVX2 (36 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2

 C/C++:
 Built as dynamic libs?: NO
 C++ standard: 11
 C++ Compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe (ver 19.0.24247.2)
 C++ flags (Release): /DWIN32 /D_WINDOWS /W4 /GR /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /wd4819 /MP /O2 /Ob2 /DNDEBUG 
 C++ flags (Debug): /DWIN32 /D_WINDOWS /W4 /GR /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /wd4819 /MP /Zi /Ob0 /Od /RTC1 
 C Compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
 C flags (Release): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /MP /O2 /Ob2 /DNDEBUG 
 C flags (Debug): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /MP /Zi /Ob0 /Od /RTC1 
 Linker flags (Release): /machine:x64 /NODEFAULTLIB:atlthunk.lib /INCREMENTAL:NO /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:libcpmtd.lib /NODEFAULTLIB:msvcrtd.lib
 Linker flags (Debug): /machine:x64 /NODEFAULTLIB:atlthunk.lib /debug /INCREMENTAL /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcpmt.lib /NODEFAULTLIB:msvcrt.lib
 ccache: NO
 Precompiled headers: YES
 Extra dependencies: wsock32 comctl32 gdi32 ole32 setupapi ws2_32
 3rdparty dependencies: libprotobuf ade ittnotify libjpeg-turbo libwebp libpng libtiff libopenjp2 IlmImf zlib ippiw ippicv

 OpenCV modules:
 To be built: calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo python3 stitching video videoio
 Disabled: java world
 Disabled by dependency: -
 Unavailable: python2 ts
 Applications: -
 Documentation: NO
 Non-free algorithms: NO

 Windows RT support: NO

 GUI: WIN32UI
 Win32 UI: YES
 VTK support: NO

 Media I/O: 
 ZLib: build (ver 1.3)
 JPEG: build-libjpeg-turbo (ver 2.1.3-62)
 SIMD Support Request: YES
 SIMD Support: NO
 WEBP: build (ver encoder: 0x020f)
 PNG: build (ver 1.6.37)
 TIFF: build (ver 42 - 4.2.0)
 JPEG 2000: build (ver 2.5.0)
 OpenEXR: build (ver 2.3.0)
 HDR: YES
 SUNRASTER: YES
 PXM: YES
 PFM: YES

 Video I/O:
 DC1394: NO
 FFMPEG: YES (prebuilt binaries)
 avcodec: YES (58.134.100)
 avformat: YES (58.76.100)
 avutil: YES (56.70.100)
 swscale: YES (5.9.100)
 avresample: YES (4.0.0)
 GStreamer: NO
 DirectShow: YES
 Media Foundation: YES
 DXVA: YES

 Parallel framework: Concurrency

 Trace: YES (with Intel ITT)

 Other third-party libraries:
 Intel IPP: 2021.11.0 [2021.11.0]
 at: D:/a/opencv-python/opencv-python/_skbuild/win-amd64-3.7/cmake-build/3rdparty/ippicv/ippicv_win/icv
 Intel IPP IW: sources (2021.11.0)
 at: D:/a/opencv-python/opencv-python/_skbuild/win-amd64-3.7/cmake-build/3rdparty/ippicv/ippicv_win/iw
 Lapack: NO
 Eigen: NO
 Custom HAL: NO
 Protobuf: build (3.19.1)
 Flatbuffers: builtin/3rdparty (23.5.9)

 OpenCL: YES (NVD3D11)
 Include path: D:/a/opencv-python/opencv-python/opencv/3rdparty/include/opencl/1.2
 Link libraries: Dynamic load

 Python 3:
 Interpreter: C:/hostedtoolcache/windows/Python/3.7.9/x64/python.exe (ver 3.7.9)
 Libraries: C:/hostedtoolcache/windows/Python/3.7.9/x64/libs/python37.lib (ver 3.7.9)
 numpy: C:/hostedtoolcache/windows/Python/3.7.9/x64/lib/site-packages/numpy/core/include (ver 1.17.0)
 install path: python/cv2/python-3

 Python (for build): C:\hostedtoolcache\windows\Python\3.7.9\x64\python.exe

 Java: 
 ant: NO
 Java: YES (ver 1.8.0.392)
 JNI: C:/hostedtoolcache/windows/Java_Temurin-Hotspot_jdk/8.0.392-8/x64/include C:/hostedtoolcache/windows/Java_Temurin-Hotspot_jdk/8.0.392-8/x64/include/win32 C:/hostedtoolcache/windows/Java_Temurin-Hotspot_jdk/8.0.392-8/x64/include
 Java wrappers: NO
 Java tests: NO

 Install to: D:/a/opencv-python/opencv-python/_skbuild/win-amd64-3.7/cmake-install
-----------------------------------------------------------------



edit : Receiving the stream with ffplay from command line :


>ffplay.exe -i "rtmp://0.0.0.0:8000/live" -listen 1 -f flv
ffplay version 2024-02-04-git-7375a6ca7b-full_build-www.gyan.dev Copyright (c) 2003-2024 the FFmpeg developers
 built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
 configuration: --enable-gpl --enable-version3 --enable-static --pkg-config=pkgconf --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
 libavutil 58. 36.101 / 58. 36.101
 libavcodec 60. 38.100 / 60. 38.100
 libavformat 60. 20.100 / 60. 20.100
 libavdevice 60. 4.100 / 60. 4.100
 libavfilter 9. 17.100 / 9. 17.100
 libswscale 7. 6.100 / 7. 6.100
 libswresample 4. 13.100 / 4. 13.100
 libpostproc 57. 4.100 / 57. 4.100
[rtmp @ 0000018a564ed340] Unexpected stream , expecting livef=0/0
 Last message repeated 1 times
Input #0, flv, from 'rtmp://0.0.0.0:8000/live':KB sq= 0B f=0/0
 Metadata:
 fileSize : 0
 audiochannels : 2
 2.1 : false
 3.1 : false
 4.0 : false
 4.1 : false
 5.1 : false
 7.1 : false
 encoder : obs-output module (libobs version 30.0.2)
 Duration: 00:00:00.00, start: 0.000000, bitrate: N/A
 Stream #0:0: Audio: aac (LC), 48000 Hz, stereo, fltp, 163 kb/s
 Stream #0:1: Video: h264 (Constrained Baseline), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 2560 kb/s, 30 fps, 30 tbr, 1k tbn
 7.54 A-V: -0.024 fd= 18 aq= 24KB vq= 498KB sq= 0B f=0/0



-
FFmpeg Could not write header (incorrect codec parameters ?) : Invalid data found when processing input [closed]
14 juillet 2024, par cookieThe command


ffmpeg -v verbose -i in.mkv -c copy -y out.mkv



produces the following error :


ffmpeg version 7.0.1-full_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developers
 built with gcc 13.2.0 (Rev5, Built by MSYS2 project)
 configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libxevd --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxeve --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d12va --enable-ffnvcodec --enable-libvpl --enable-nvdec --enable-nvenc --enable-vaapi --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
 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
[hevc @ 00000133b5bb5040] Invalid default display window
Input #0, matroska,webm, from 'in.mkv':
 Metadata:
 encoder : libebml v1.3.0 + libmatroska v1.4.1
 creation_time : 2015-03-20T14:07:27.000000Z
 Duration: 00:24:11.75, start: 0.000000, bitrate: 5185 kb/s
 Chapters:
 Chapter #0:0: start 0.000000, end 48.047000
 Metadata:
 title : Chapter 01
 Chapter #0:1: start 48.047000, end 137.846000
 Metadata:
 title : Chapter 02
 Chapter #0:2: start 137.846000, end 535.868000
 Metadata:
 title : Chapter 03
 Chapter #0:3: start 535.868000, end 1330.871000
 Metadata:
 title : Chapter 04
 Chapter #0:4: start 1330.871000, end 1420.877000
 Metadata:
 title : Chapter 05
 Chapter #0:5: start 1420.877000, end 1451.741000
 Metadata:
 title : Chapter 06
 Chapter #0:6: start 1451.741000, end 1451.745000
 Metadata:
 title : Chapter 07
 Stream #0:0: Video: hevc (Main 10), 1 reference frame, yuv420p10le(tv, left), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn (default)
 Metadata:
 _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 32bit built on Jun 9 2014 15:08:34
 _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 32bit built on Jun 9 2014 15:08:34
 _STATISTICS_WRITING_DATE_UTC: 2015-03-20 14:07:27
 _STATISTICS_WRITING_DATE_UTC-eng: 2015-03-20 14:07:27
 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
 _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
 BPS : 3754023
 BPS-eng : 3754023
 DURATION : 00:24:11.742000000
 DURATION-eng : 00:24:11.742000000
 NUMBER_OF_FRAMES: 34807
 NUMBER_OF_FRAMES-eng: 34807
 NUMBER_OF_BYTES : 681234123
 NUMBER_OF_BYTES-eng: 681234123
 Stream #0:1(jpn): Audio: flac, 48000 Hz, stereo, s32 (24 bit) (default)
 Metadata:
 _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 32bit built on Jun 9 2014 15:08:34
 _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 32bit built on Jun 9 2014 15:08:34
 _STATISTICS_WRITING_DATE_UTC: 2015-03-20 14:07:27
 _STATISTICS_WRITING_DATE_UTC-eng: 2015-03-20 14:07:27
 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
 _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
 BPS : 1429414
 BPS-eng : 1429414
 DURATION : 00:24:11.745000000
 DURATION-eng : 00:24:11.745000000
 NUMBER_OF_FRAMES: 17013
 NUMBER_OF_FRAMES-eng: 17013
 NUMBER_OF_BYTES : 259393130
 NUMBER_OF_BYTES-eng: 259393130
[out#0/matroska @ 00000133b5bb5a40] No explicit maps, mapping streams automatically...
[vost#0:0/copy @ 00000133b5c2f580] Created video stream from input stream 0:0
[aost#0:1/copy @ 00000133b5bf1680] Created audio stream from input stream 0:1
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
 Stream #0:1 -> #0:1 (copy)
[out#0/matroska @ 00000133b5bb5a40] Could not write header (incorrect codec parameters ?): Invalid data found when processing input
[AVIOContext @ 00000133b5c27940] Statistics: 291 bytes written, 0 seeks, 1 writeouts
[AVIOContext @ 00000133b5b97980] Statistics: 66432 bytes read, 2 seeks
Conversion failed!



Originally, I was trying to add a subtitle to
in.mkv
, but I keep encountering this error. When I add the subtitle to another MKV file, it works fine, so I believe the problem lies within.mkv
.

Troubleshooting


Output only video stream produce the same error :


ffmpeg -i in.mkv -map 0:v:0 -c copy out.mkv



Output only audio stream works fine :


ffmpeg -i in.mkv -map 0:a:0 -c copy out.mkv



Output as mp4 got no error, but the output file is unplayable :


ffmpeg -i in.mkv -c copy -strict -2 out.mp4



Re-encoding works fine :


ffmpeg -i in.mkv -c:v libx265 -c:a copy out.mkv



How can I fix the video stream in
in.mkv
so that I can add a subtitle stream and remux the file without re-encoding the video ? Any insights or suggestions on handling this error would be greatly appreciated.

-
A Primer to Ethical Marketing : How to Build Trust in a Privacy-First World
Imagine a marketing landscape where transparency replaces tactics, where consumer privacy is prioritised over exploitation, and where authentic value builds genuine relationships.
This isn’t just an ideal—it’s the future of marketing. And it starts with ethical marketing practices.
76% of consumers refuse to buy from companies they do not trust with their data. Ethical marketing has become essential for business survival. As privacy regulations tighten and third-party cookies phase out, marketers face a critical question : how can they balance effective, personalised campaigns whilst respecting privacy ?
This comprehensive guide explores what ethical marketing is, the key principles behind ethical marketing practices, and practical strategies to implement an ethical approach that builds trust while driving growth.
What is ethical marketing ? A comprehensive definition
Ethical marketing places respect for consumer boundaries at its core whilst delivering genuine value. It prioritises transparent practices, honest communication, and fair value exchange with consumers. This approach represents a significant shift from traditional marketing, which often relied on collecting vast amounts of user data through invasive tracking methods and obscure policies.
The modern approach to ethical marketing creates a foundation built on three key pillars :
- User Control : Giving people genuine choice and agency over their data
- Fair Value : Providing clear benefits in exchange for any data shared
- Transparency : Being honest about how data is collected, used, and protected
Key principles of ethical marketing
Transparency
Transparency means being clear and forthright about your marketing practices, data collection policies, and business operations. It involves :
- Using plain language to explain how you collect and use customer data
- Being upfront about pricing, product limitations, and terms of service
- Disclosing sponsored content and affiliate relationships
- Making privacy policies accessible and understandable
When Matomo surveyed 2,000 consumers, 81% said they believe an organisation’s data practices reflect their overall treatment of customers. Transparency isn’t just about compliance—it’s about demonstrating respect.
Honesty
While similar to transparency, honesty focuses specifically on truthfulness in communications :
- Avoiding misleading claims or exaggerations about products and services
- Not manipulating statistics or research findings to support marketing narratives
- Representing products accurately in advertisements and marketing materials
- Acknowledging mistakes and taking responsibility when things go wrong
Social responsibility
Ethical marketing requires consideration of a brand’s impact on society as a whole :
- Considering environmental impacts of marketing campaigns and business practices
- Promoting diversity and inclusion in marketing representations
- Supporting social causes authentically rather than through “purpose-washing”
- Ensuring marketing activities don’t promote harmful stereotypes or behaviours
Ethical marketing dilemmas : Navigating complex business decisions
Data privacy concerns
The digital marketing landscape has been transformed by increasing awareness of data privacy issues and stricter regulations like GDPR, CCPA, and upcoming legislation. Key challenges include :
- The phase-out of third-party cookies, impacting targeting and measurement
- Growing consumer resistance to invasive tracking technologies
- Balancing personalisation with privacy (71% of consumers expect personalised experiences, yet demand privacy)
- Ensuring compliance across different jurisdictional requirements
Cultural sensitivity
Global brands must navigate complex cultural landscapes :
- Avoiding cultural appropriation in marketing campaigns
- Understanding varied cultural expectations around privacy
- Respecting local customs and values in international marketing
- Adapting messaging appropriately for diverse audiences
Environmental sustainability
The environmental impact of marketing activities is under increasing scrutiny :
- Digital carbon footprints from ad serving and website hosting
- Waste generated from physical marketing materials
- Promoting sustainable products honestly without greenwashing
- Aligning marketing messages with actual business practices
The benefits of ethical marketing
For years, digital marketing has relied on third-party data collection and broad-scale tracking. However, new regulations such as GDPR, CCPA, and the end of third-party cookies are pushing brands to adopt ethical data practices.
Increased customer loyalty
Ethical marketing fosters deeper relationships with customers by building trust. Research consistently shows that consumers are more loyal to brands they trust, with 71% indicating they would stop buying from a brand if trust is broken.
These trust-based relationships are more resilient during business challenges. When customers believe in a company’s integrity, they’re more likely to give the benefit of the doubt during controversies or service issues. They’re also more likely to provide constructive feedback rather than simply leaving for competitors.
Perhaps most importantly, loyal customers become advocates, sharing positive experiences with others and defending the brand against criticism. This organic advocacy is far more powerful than paid promotions and reduces customer acquisition costs significantly over time.
Enhanced brand reputation
A strong ethical stance improves overall brand perception across multiple dimensions. Media outlets are increasingly focused on corporate behaviour, providing positive coverage for ethical practices that extends a brand’s reach organically.
Social conversations about ethical brands tend to be more positive, with consumers sharing experiences and values rather than just discussing products. This creates a halo effect that benefits all aspects of the business.
This enhanced reputation also provides resilience during public relations challenges. Organisations with strong ethical foundations find it easier to navigate controversies because they’ve built a reservoir of goodwill with customers, employees, and other stakeholders.
Competitive advantage
Ethical marketing provides several distinct competitive advantages in modern markets. It helps brands access privacy-conscious consumer segments that actively avoid companies with questionable data practices. These segments often include higher-income, educated consumers who are valuable long-term customers.
Ethical approaches also reduce vulnerability to regulatory changes and potential penalties. As privacy laws continue to evolve globally, organisations with strong ethical foundations find compliance easier and less disruptive than those scrambling to meet minimum requirements.
Perhaps most significantly, ethical marketing supports more sustainable growth trajectories. While manipulative tactics might drive short-term results, they typically lead to higher churn rates and increasing acquisition costs. Ethical approaches build foundations for long-term success and stable growth.
For a detailed roadmap, download the Ethical Marketing Guide.
Case studies : Ethical marketing in action
Patagonia : Purpose-driven marketing
Patagonia integrates sustainability into its marketing, reinforcing its commitment to ethical business practices. By aligning with social causes, the brand strengthens customer loyalty.
Apple : Privacy as a competitive advantage
Apple positions itself as a leader in consumer privacy, ensuring data protection remains central to its marketing strategy. This commitment has become a key differentiator in the tech industry.
Matomo : The ethical analytics tool
Matomo offers privacy-first analytics that prioritise data ownership and compliance. Businesses using Matomo benefit from accurate insights while respecting user privacy.
These companies demonstrate that ethical marketing is not just a compliance requirement—it is a long-term competitive advantage.
Strategies for implementing ethical marketing
Aligning marketing efforts with brand values
Consistency between values and actions is essential for ethical marketing. This alignment starts with a clear understanding of what your organisation truly stands for—not just aspirational statements, but genuine commitments that inform daily decisions.
Implementing this alignment requires cross-functional collaboration. Marketing teams need to work closely with product development, customer service, and leadership to ensure consistency across all touchpoints. When different departments send contradictory messages about company values, trust erodes quickly.
Clear guidelines help marketing teams apply values in practical decisions, from campaign concepts to media placements. Regular ethical reviews of marketing plans can identify potential issues before campaigns launch, avoiding reactive corrections that damage credibility.
Privacy-first data strategies
Developing robust approaches to customer data is fundamental to ethical marketing. This starts with prioritising first-party data (collected directly from your own channels) and zero-party data (actively shared by customers through preference centres, surveys, and similar mechanisms).
Measuring success doesn’t have to come at the expense of privacy. Ethical analytics provide accurate insights while protecting user data, ensuring compliance, and enhancing customer trust.
Ethical personalisation approaches focus on using aggregated or anonymised data rather than individual tracking. This allows for relevant experiences without the invasive feeling that erodes trust when consumers feel watched across the internet.
Most importantly, ethical data strategies create transparent value exchanges where users clearly understand what benefits they receive in return for sharing information. This reciprocity transforms data collection from exploitation to fair exchange.
Measuring success ethically
Traditional marketing measurement often relies on individual-level tracking across sites and platforms. Ethical approaches require adapting these frameworks to respect privacy while still demonstrating impact.
Focusing on aggregate patterns rather than individual behaviour provides valuable insights without privacy invasions. For example, understanding that 30% of visitors to a specific page subsequently make purchases is actionable intelligence that doesn’t require tracking specific people.
Incrementality testing measures campaign impact by comparing outcomes between exposed and control groups at an aggregate level. This provides more accurate attribution than traditional last-click models while respecting privacy boundaries.
Server-side conversion tracking offers another ethical measurement approach, collecting necessary data on your servers rather than through client-side scripts vulnerable to blocking. This improves data accuracy while reducing reliance on cookies and browser storage.
Implementing ethical marketing strategies : A practical framework
1. Align marketing with brand values – Ensure campaigns reflect transparency and trust
2. Leverage first-party data – Collect insights directly from consumers with clear consent
3. Respect privacy and consent – Give users control over their data and clearly communicate its use
4. Create value-driven content – Offer educational and relevant resources instead of relying solely on advertising
5. Use privacy-compliant analytics – Switch to ethical platforms such as Matomo for responsible performance measurement
For a step-by-step guide to implementing ethical marketing strategies, download the full report here.
The future of ethical marketing
With the decline of third-party cookies and the rise of privacy regulations, ethical marketing is no longer optional. Brands that adopt privacy-first practices now will gain a sustainable competitive edge in the long term. The future of marketing belongs to brands that earn consumer trust, not those that exploit it.
Key trends shaping the future of marketing include :
- Privacy-first analytics to replace invasive tracking
- First-party and zero-party data strategies for direct consumer engagement
- Consent-driven personalisation to balance relevance and privacy
- Greater emphasis on corporate social responsibility in marketing initiatives
Companies that proactively address these changes will build stronger customer relationships, enhance brand reputation, and ensure long-term success.
Take the next step
Ready to transform your marketing approach for 2025 and beyond ?
Download Matomo’s comprehensive “2025 Ethical Marketing Field Guide” to get practical frameworks, implementation strategies, and real-world case studies that will help you build trust while driving growth.
With detailed guidance on first-party data activation, consent-based personalisation techniques, and privacy-preserving analytics methods, this guide provides everything you need to future-proof your marketing strategy in a privacy-first world.
Download the ethical marketing guide now to start building stronger, more trusted relationships with your customers through ethical marketing practices.