
Recherche avancée
Médias (91)
-
MediaSPIP Simple : futur thème graphique par défaut ?
26 septembre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Video
-
avec chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
sans chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
config chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
Autres articles (36)
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, 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 (...) -
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 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 (...)
Sur d’autres sites (4611)
-
lavc/vvc : Prevent overflow in chroma QP derivation
9 juin 2024, par Frank Plowmanlavc/vvc : Prevent overflow in chroma QP derivation
On the top of p. 112 in VVC (09/2023) :
It is a requirement of bitstream conformance that the values of
qpInVal[ i ][ j ] and qpOutVal[ i ][ j ] shall be in the range
of −QpBdOffset to 63, inclusive for i in the range of 0 to
numQpTables − 1, inclusive, and j in the range of 0 to
sps_num_points_in_qp_table_minus1[ i ] + 1, inclusive.Additionally, don't discard the return code from sps_chroma_qp_table.
Signed-off-by : Frank Plowman <post@frankplowman.com>
-
FFMPEG : FATAL error, file duration too long for timebase ?
26 février 2024, par clxI want to add a subtitle track on a ProRes files with ffmpeg command on Windows :


ffmpeg.exe -i "X:\Test\Tokyo01.mov" -i "X:\Test\SubtitleEN.srt" -f mov -c:v copy -c:a copy -c:s mov_text -map 0:v -map 0:a -map "1:0" "-metadata:s:s:0" "language=EN" "-metadata:s:s:0" "handler_name=English" "-metadata:s:s:0" "title=English" -y "X:\Test\Tokyo01_WithSub.mov" 



I have a fatal error at the end :


...
FATAL error, file duration too long for timebase, this file will not be1737.7kbits/s speed=0.979x
playable with QuickTime. Choose a different timebase with -video_track_timescale or a different container format
...



Source file looks good with FFProbe :



[STREAM]
index=0
codec_name=prores
codec_long_name=Apple ProRes (iCodec Pro)
profile=HQ
codec_type=video
codec_time_base=15139/363340
codec_tag_string=apch
codec_tag=0x68637061
width=3996
height=2160
coded_width=3996
coded_height=2160
closed_captions=0
has_b_frames=0
sample_aspect_ratio=N/A
display_aspect_ratio=N/A
pix_fmt=yuv422p10le
level=-99
color_range=tv
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=unspecified
field_order=unknown
timecode=N/A
refs=1
id=N/A
r_frame_rate=24/1
avg_frame_rate=363340/15139
time_base=1/90000
start_pts=0
start_time=0.000000
duration_ts=340627500
duration=3784.750000
bit_rate=656235296
max_bit_rate=N/A
bits_per_raw_sample=10
nb_frames=90835



The complete FFmpeg return console :


ffmpeg version 2023-09-04-git-f8503b4c33-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
 built with gcc 12.2.0 (Rev10, 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-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. 19.100 / 58. 19.100
 libavcodec 60. 25.100 / 60. 25.100
 libavformat 60. 11.100 / 60. 11.100
 libavdevice 60. 2.101 / 60. 2.101
 libavfilter 9. 11.100 / 9. 11.100
 libswscale 7. 3.100 / 7. 3.100
 libswresample 4. 11.100 / 4. 11.100
 libpostproc 57. 2.100 / 57. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'X:\Test\Tokyo01.mov':
 Metadata:
 major_brand : qt
 minor_version : 512
 compatible_brands: qt
 encoder : Lavf58.76.100
 Duration: 01:03:04.79, start: 0.000000, bitrate: 663143 kb/s
 Stream #0:0[0x1]: Video: prores (HQ) (apch / 0x68637061), yuv422p10le, 3996x2160, 656235 kb/s, 24 fps, 24 tbr, 90k tbn (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : FFMP
 Stream #0:1[0x2]: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 5.1, s32 (24 bit), 6912 kb/s (default)
 Metadata:
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]
[srt @ 000001bc0ec608c0] UTF16 is automatically converted to UTF8, do not specify a character encoding
Input #1, srt, from 'X:\Test\SubtitleEN.srt':
 Duration: N/A, bitrate: N/A
 Stream #1:0: Subtitle: subrip
Output #0, mov, to 'X:\Test\Tokyo01_WithSub.mov':
 Metadata:
 major_brand : qt
 minor_version : 512
 compatible_brands: qt
 encoder : Lavf60.11.100
 Stream #0:0: Video: prores (HQ) (apch / 0x68637061), yuv422p10le, 3996x2160, q=2-31, 656235 kb/s, 24 fps, 24 tbr, 90k tbn (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : FFMP
 Stream #0:1: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 5.1, s32 (24 bit), 6912 kb/s (default)
 Metadata:
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]
 Stream #0:2(EN): Subtitle: mov_text (text / 0x74786574)
 Metadata:
 handler_name : English
 title : English
 encoder : Lavc60.25.100 mov_text
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
 Stream #0:1 -> #0:1 (copy)
 Stream #1:0 -> #0:2 (subrip (srt) -> mov_text (native))
Press [q] to stop, [?] for help
FATAL error, file duration too long for timebase, this file will not be1737.7kbits/s speed=0.979x
playable with QuickTime. Choose a different timebase with -video_track_timescale or a different container format
[out#0/mov @ 000001bc0e847340] video:303184287kB audio:3193418kB subtitle:9kB other streams:0kB global headers:0kB muxing overhead: 0.000585%
frame=90834 fps= 23 q=-1.0 Lsize=306379507kB time=01:03:04.77 bitrate=663147.3kbits/s speed=0.979x




I don't find documentation for mentionned command "-video_track_timescale" to change timescale (here 1/90000 ).
I don't understand the problem ??


-
FFMPEG C Library : Encoding h264 stream into Matroska .mkv container creates corrupt files
16 mars 2024, par Marvin KillingI want to use the FFMPEG C Library to create a Matroska Video .mkv file with only an h264 stream, but the resulting .mkv file comes out corrupt.


The file cannot be played back with Windows Media Player, ffplay, or VLC, and when I try to
ffprobe
the resulting file, these are the error messages :

[h264 @ 0000015060d8f5c0] No start code is found.
 Last message repeated 1 times
[h264 @ 0000015060d8f5c0] non-existing PPS 0 referenced
 Last message repeated 1 times
[h264 @ 0000015060d8f5c0] decode_slice_header error
[h264 @ 0000015060d8f5c0] no frame!
[h264 @ 0000015060d8f5c0] non-existing PPS 0 referenced
 Last message repeated 1 times
[h264 @ 0000015060d8f5c0] decode_slice_header error
[h264 @ 0000015060d8f5c0] no frame!
[h264 @ 0000015060d8f5c0] non-existing PPS 0 referenced
 Last message repeated 1 times
# [...]
# this continues for a long time



I have followed the other troubleshooting steps for encoding h264 into Matroska, but none of them seemed to have done the trick for me :


- 

- Setting
AV_CODEC_FLAG_GLOBAL_HEADER
: Invalid data when creating mkv container with h264 stream because extradata is null - Allocating some space for extradata : Initializing an output file for muxing mkv with FFmpeg






This is my C code :


#include 
#include <libavutil></libavutil>opt.h>
#include <libavutil></libavutil>imgutils.h>
#include <libavcodec></libavcodec>avcodec.h>
#include <libavformat></libavformat>avformat.h>

int main(void) {
 char *out_file_path = "./video.mkv";
 AVFormatContext *format_context;
 AVStream *video_stream;
 AVCodecContext *codec_context;

 avformat_alloc_output_context2(&format_context, NULL, NULL, out_file_path);

 const AVCodec *codec = avcodec_find_encoder(AV_CODEC_ID_H264);
 video_stream = avformat_new_stream(format_context, NULL);

 codec_context = avcodec_alloc_context3(codec);
 av_opt_set(codec_context->priv_data, "preset", "superfast", 0);
 av_opt_set(codec_context->priv_data, "crf", "22", 0);

 codec_context->width = 1920;
 codec_context->height = 1080;
 codec_context->time_base = av_make_q(1, 30);
 codec_context->pix_fmt = AV_PIX_FMT_YUV420P;

 if (strncmp("./video.mkv", out_file_path, 11) == 0) {
 printf("Writing .mkv...\n");
 codec_context->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
 codec_context->extradata = (uint8_t*)av_mallocz(1024 * 1024);
 codec_context->extradata_size = 1024 * 1024;
 } else {
 printf("Writing .mp4...\n");
 }

 // XXX avcodec_parameters_from_context is potentially superfluous (?)
 int ret = avcodec_parameters_from_context(video_stream->codecpar, codec_context);

 ret = avcodec_open2(codec_context, codec, NULL);

 avio_open(&format_context->pb, out_file_path, AVIO_FLAG_WRITE);

 ret = avformat_write_header(format_context, NULL);

 // create a black input frame
 AVFrame *input_frame = av_frame_alloc();
 input_frame->width = 1920;
 input_frame->height = 1080;
 input_frame->format = AV_PIX_FMT_YUV420P;
 ret = av_image_alloc(input_frame->data, input_frame->linesize, input_frame->width, input_frame->height, input_frame->format, 32);
 ptrdiff_t linesize[4] = { input_frame->linesize[0], input_frame->linesize[1], input_frame->linesize[2], input_frame->linesize[3] };
 ret = av_image_fill_black(input_frame->data, linesize, input_frame->format, 0, 1920, 1080);

 // write 2 seconds of video, all black
 for (size_t current_pts = 0; current_pts < 60; current_pts++) {
 input_frame->pts = av_rescale_q(current_pts, av_make_q(1, 30), codec_context->time_base);;

 ret = avcodec_send_frame(codec_context, input_frame);

 AVPacket* packet = av_packet_alloc();

 while (1) {
 ret = avcodec_receive_packet(codec_context, packet);
 if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {
 break;
 } else if (ret < 0) {
 printf("avcodec_receive_packet failed");
 } else {
 av_packet_rescale_ts(packet, codec_context->time_base, video_stream->time_base);
 ret = av_interleaved_write_frame(format_context, packet);
 }
 }

 av_packet_free(&packet);
 }

 av_frame_free(&input_frame);

 // flush encoder
 avcodec_send_frame(codec_context, NULL);
 AVPacket *flush_packet = av_packet_alloc();
 while (avcodec_receive_packet(codec_context, flush_packet) != AVERROR_EOF) {
 //int ret = av_interleaved_write_frame(format_context_, packet);
 av_packet_rescale_ts(flush_packet, codec_context->time_base, video_stream->time_base);
 ret = av_write_frame(format_context, flush_packet);
 }
 av_packet_free(&flush_packet);

 ret = av_write_trailer(format_context);
 ret = avio_close(format_context->pb);

 return 0;
}



The error handling is stripped out, but it does not raise any errors.


This code works when I write into an mp4 file, but creates a corrupt file when writing into .mkv. You can change the output container format to mp4 by setting

char *out_file_path = "./video.mp4";


You can compile this by running


clang -I$(FFMPEG_DIR)/include -L$(FFMPEG_DIR)/lib -lavformat -lavcodec -lavutil main.c -o makemkv



The output I’m getting while the above code is running :


Writing .mkv...
[libx264 @ 0x139804c40] using cpu capabilities: ARMv8 NEON
[libx264 @ 0x139804c40] profile High, level 4.0, 4:2:0, 8-bit
[libx264 @ 0x139804c40] 264 - core 164 r3108 31e19f9 - H.264/MPEG-4 AVC codec - Copyleft 2003-2023 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x3 me=dia subme=1 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=15 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc=crf mbtree=0 crf=22.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 pb_ratio=1.30 aq=1:1.00



When I use the ffmpeg CLI, I can create a working .mkv from my working .mp4 like this :


ffmpeg -i video.mp4 -c:v copy created-with-ffmpeg-cli.mkv



I have uploaded the resulting video files here : https://drive.google.com/drive/folders/1FS-0fBAwKBbO-tyxC0VrFqcCyyqd0BR_?usp=sharing


- Setting