
Recherche avancée
Autres articles (7)
-
Emballe médias : à quoi cela sert ?
4 février 2011, parCe 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" ; -
Déploiements possibles
31 janvier 2010, parDeux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
Version mono serveur
La version mono serveur consiste à n’utiliser qu’une (...) -
Menus personnalisés
14 novembre 2010, parMediaSPIP 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 (3768)
-
ffmepg why error :Failed to write core dump
9 juillet 2021, par dmouseI wang to implement a feature that allows me to save RTSP stram as a file,
use javacv implement a demo,but there's an error.
i debug the demo , execute 'recorder.record(frame) ;' error, "ulimit -c unlimited" is useless,the program still reports an error.
review of the source code did note find the problem principle.pleace give me a hand.


import org.bytedeco.javacpp.avcodec;
import org.bytedeco.javacv.FFmpegFrameGrabber;
import org.bytedeco.javacv.FFmpegFrameRecorder;
import org.bytedeco.javacv.Frame;

import java.io.File;
import java.io.IOException;

/**
 * @ClassName video
 * @Description TODO
 * @Author mouse
 * @Date 2021/7/9 11:13
 * @Version 1.0
 **/
public class Video {
 public static void main(String[] args) {
 String streamUrl = "rtsp://admin:12345678.@192.168.20.180:554/h265/ch1/main/av_stream";
 String filePath = "./video/hello.mp3";
 File outFile = new File(filePath);
 FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(streamUrl);
 if (!outFile.getParentFile().exists()) {
 outFile.getParentFile().mkdirs();
 }
 FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(filePath,1080,1440, 1);
 recorder.setVideoCodec(avcodec.AV_CODEC_ID_H265);
 recorder.setFormat("flv");
 recorder.setVideoBitrate(4000);
 try {
 grabber.start();
 recorder.start();
 Frame frame = grabber.grabFrame();
 while (frame!=null){
 recorder.record(frame);
 frame = grabber.grabFrame();
 }
 recorder.record(frame);
 recorder.stop();
 grabber.stop();

 } catch (FFmpegFrameGrabber.Exception e) {
 e.printStackTrace();
 } catch (IOException e) {
 e.printStackTrace();
 } finally {
 try {
 if (recorder != null) {
 recorder.stop();
 }
 if (grabber != null) {
 grabber.stop();
 }
 } catch (FFmpegFrameRecorder.Exception | FFmpegFrameGrabber.Exception e) {
 e.printStackTrace();
 }
 }
 }
}




log error


#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x0000000131fef233, pid=50498, tid=0x0000000000001003
#
# JRE version: Java(TM) SE Runtime Environment (8.0_281-b09) (build 1.8.0_281-b09)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.281-b09 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C [libavformat.57.dylib+0xbf233] av_write_frame+0x993
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#



pom :


<dependency>
 <groupid>org.bytedeco</groupid>
 <artifactid>javacv</artifactid>
 <version>1.4.3</version>
 </dependency>
 <dependency>
 <groupid>org.bytedeco.javacpp-presets</groupid>
 <artifactid>ffmpeg-platform</artifactid>
 <version>4.0.2-1.4.3</version>
 </dependency>



My os : macOS Bgi Sur 11.4 ;

JDK : 1.8.0_281

execute 'recorder.record(frame) ;' error,
"ulimit -c unlimited" is useless,the program still reports an error .

-
MKV video playback shows a black picture and audio plays good
24 mars 2023, par gbriones.gdlI have an MKV video file that has something wrong, every time I start my player, the video shows full black picture and the audio starts playing good, if I use the seek bar to position the playback anywhere in the time, then the video shows correct picture but audio stops playing, eventually (it takes several seconds) audio starts playing again in sync with video.


The player I am using is the one in Kodi 20.1.0, I have tried enabling/disabling HW acceleration without success.


I also tried VLC 3.0.16, which has a simmilar behavior with the exception that video starts showing from the very begining when opening the file, just when seeking the audio stops for several seconds.


I also tried using ffmpeg to reencode the video with different codecs without success, I have tried multiple video and audio codec combinations, and also tried changing the pixel format.


Then eventually I managed to fix the video by extracting streams into separate files, then merge them again, without reencoding, I thought that maybe something could be wrong with the metadata of the video, so I copied the same metadata and final output file still works fine. My question is how can I fix my video without having to split and merge streams ?


Here is the info about my input file :


$ ffmpeg -i S01E08.mkv 
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
 configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
 libavutil 56. 70.100 / 56. 70.100
 libavcodec 58.134.100 / 58.134.100
 libavformat 58. 76.100 / 58. 76.100
 libavdevice 58. 13.100 / 58. 13.100
 libavfilter 7.110.100 / 7.110.100
 libswscale 5. 9.100 / 5. 9.100
 libswresample 3. 9.100 / 3. 9.100
 libpostproc 55. 9.100 / 55. 9.100
Input #0, matroska,webm, from 'S01E08.mkv':
 Metadata:
 ENCODER : Lavf59.27.100
 Duration: 00:25:02.21, start: 0.000000, bitrate: 1382 kb/s
 Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt470bg/unknown/unknown, progressive), 1280x960, 59.94 fps, 59.94 tbr, 1k tbn, 59.94 tbc
 Metadata:
 ENCODER : Lavc59.37.100 libx265
 DURATION : 00:25:00.032000000
 Stream #0:1(spa): Audio: aac (HE-AAC), 48000 Hz, stereo, fltp (default)
 Metadata:
 title : Stereo
 DURATION : 00:25:02.207000000
 Stream #0:2(jpn): Audio: aac (HE-AAC), 48000 Hz, stereo, fltp
 Metadata:
 title : Stereo
 DURATION : 00:25:00.116000000
 Stream #0:3(spa): Subtitle: ass
 Metadata:
 ENCODER : Lavc59.37.100 ssa
 DURATION : 00:24:56.585000000
At least one output file must be specified



Here are the steps I followed to fix the video, I had to use mkv format for the outputs because other formats were no good at writing metadata :


ffmpeg -i S01E08.mkv -map 0:v:0 -c:v copy -map_metadata 0 video.mkv
ffmpeg -i S01E08.mkv -map 0:a:0 -c:a copy -map_metadata 0 audio1.mkv
ffmpeg -i S01E08.mkv -map 0:a:1 -c:a copy -map_metadata 0 audio2.mkv
ffmpeg -i S01E08.mkv -map 0:s -c:s copy -map_metadata 0 subs.mkv
ffmpeg -i video.mkv -i audio1.mkv -i audio2.mkv -i subs.mkv -map 0:v -map 1:a -map 2:a -map 3:s -c:v copy -c:a copy -c:s copy -map_metadata 0 -map_metadata 1 -map_metadata 2 -map_metadata 3 -disposition:s:0 0 -default_mode infer_no_subs video_audio.mkv



I had to compare both input and output files :


$ ffmpeg -i video_audio.mkv
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
 configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
 libavutil 56. 70.100 / 56. 70.100
 libavcodec 58.134.100 / 58.134.100
 libavformat 58. 76.100 / 58. 76.100
 libavdevice 58. 13.100 / 58. 13.100
 libavfilter 7.110.100 / 7.110.100
 libswscale 5. 9.100 / 5. 9.100
 libswresample 3. 9.100 / 3. 9.100
 libpostproc 55. 9.100 / 55. 9.100
Input #0, matroska,webm, from 'video_audio.mkv':
 Metadata:
 ENCODER : Lavf58.76.100
 Duration: 00:25:02.21, start: 0.000000, bitrate: 1382 kb/s
 Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt470bg/unknown/unknown, progressive), 1280x960, 59.94 fps, 59.94 tbr, 1k tbn, 59.94 tbc (default)
 Metadata:
 ENCODER : Lavc59.37.100 libx265
 DURATION : 00:25:00.031000000
 Stream #0:1(spa): Audio: aac (HE-AAC), 48000 Hz, stereo, fltp (default)
 Metadata:
 title : Stereo
 DURATION : 00:25:02.207000000
 Stream #0:2(jpn): Audio: aac (HE-AAC), 48000 Hz, stereo, fltp
 Metadata:
 title : Stereo
 DURATION : 00:25:00.116000000
 Stream #0:3(spa): Subtitle: ass
 Metadata:
 ENCODER : Lavc59.37.100 ssa
 DURATION : 00:24:56.585000000
At least one output file must be specified

$ ffprobe -show_streams S01E08.mkv > probe_bad.txt
$ ffprobe -show_streams video_audio.mkv > probe_good.txt
$ diff probe_bad.txt probe_good.txt 
32,33c32,33
< duration_ts=1502207
< duration=1502.207000
---
> duration_ts=N/A
> duration=N/A
40c40
< DISPOSITION:default=0
---
> DISPOSITION:default=1
53c53
< TAG:DURATION=00:25:00.032000000
---
> TAG:DURATION=00:25:00.031000000



Then I thought that maybe the disposition flag in the video stream was causing the error, so I ran ffmpeg to copy all streams from my input video S01E08.mkv and added the disposition flag with the following command :


ffmpeg -i S01E08.mkv -map 0:v -map 0:a:0 -map 0:a:1 -map 0:s -c:v copy -c:a copy -c:s copy -map_metadata 0 -disposition:v:0 default -disposition:s:0 0 -default_mode infer_no_subs test.mkv



Still no luck, test.mkv shows no video when opening the file, I had to double check that disposition flag was changed :


$ ffprobe -show_streams test.mkv > probe_bad2.txt
$ diff probe_bad.txt probe_bad2.txt 
40c40
< DISPOSITION:default=0
---
> DISPOSITION:default=1
53c53
< TAG:DURATION=00:25:00.032000000
---
> TAG:DURATION=00:25:00.031000000



In other words I have to focibly split and merge to make the file work correctly. May be I need to set the duration and duration_ts of the video stream to N/A but I don't know how to do this.


-
Lost video when converting from MKV to MP4 with FFMPEG
25 décembre 2022, par Francesco VirgaI'm trying to come up with a robust script to handle all MKV -> MP4 video conversions.


The classic example I've found is
ffmpeg -i input.mkv -codec copy output.mp4
. This works for most videos, but I find that the video stream gets lost for certain videos. Using-map 0
doesn't help, the examples I'm using only have one video stream and one audio stream.

If I only copy the audio codec, it seems to work fine, but takes much longer since video is re-encoded. For this I'm use
ffmpeg -i input.mkv -c:a copy output.mp4
. I'm fine to use this for certain videos, but am not sure how to determine whether video re-encoding is needed or not (since I want to avoid it when possible).

Here's the output I get when I run the first command and lose video :


% ffmpeg -i input.mkv -codec copy output.mp4

ffmpeg version N-103075-g4c694093be-tessus https://evermeet.cx/ffmpeg/ Copyright (c) 2000-2021 the FFmpeg developers
 built with Apple clang version 11.0.0 (clang-1100.0.33.17)
 configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
 libavutil 57. 2.100 / 57. 2.100
 libavcodec 59. 3.102 / 59. 3.102
 libavformat 59. 4.101 / 59. 4.101
 libavdevice 59. 0.100 / 59. 0.100
 libavfilter 8. 1.103 / 8. 1.103
 libswscale 6. 0.100 / 6. 0.100
 libswresample 4. 0.100 / 4. 0.100
 libpostproc 56. 0.100 / 56. 0.100
Input #0, matroska,webm, from 'input.mkv':
 Metadata:
 CREATION_TIME :
 ENCODER : Lavf55.12.0
 Duration: 00:59:15.97, start: 0.062000, bitrate: 1892 kb/s
 Stream #0:0: Video: hevc (Main), yuv420p(tv, bt709), 1912x1072 [SAR 1:1 DAR 239:134], 23.98 fps, 23.98 tbr, 1k tbn (default)
 Stream #0:1(eng): Audio: aac (LC), 48000 Hz, 5.1, fltp (default)
 Metadata:
 title : Surround
 LANGUAGE : eng
 Stream #0:2(eng): Subtitle: ass (default)
 Stream #0:3(eng): Subtitle: ass
Output #0, mp4, to 'output.mp4':
 Metadata:
 encoder : Lavf59.4.101
 Stream #0:0: Video: hevc (Main) (hev1 / 0x31766568), yuv420p(tv, bt709), 1912x1072 [SAR 1:1 DAR 239:134], q=2-31, 23.98 fps, 23.98 tbr, 16k tbn (default)
 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp (default)
 Metadata:
 title : Surround
 LANGUAGE : eng
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
 Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=32634 fps=0.0 q=-1.0 size= 295424kB time=00:22:41.04 bitrate=1778.1kbits/s speed=2.72e+03x frame=63776 fps=63775 q=-1.0 size= 611840kB time=00:44:19.94 bitrate=1884.3kbits/s speed=2.66e+03frame=85256 fps=62686 q=-1.0 Lsize= 822207kB time=00:59:15.83 bitrate=1894.2kbits/s speed=2.61e+03x
video:736136kB audio:83404kB subtitle:0kB other streams:0kB global headers:1kB muxing overhead: 0.325361%