
Recherche avancée
Médias (3)
-
MediaSPIP Simple : futur thème graphique par défaut ?
26 septembre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Video
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
-
GetID3 - Boutons supplémentaires
9 avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (91)
-
Organiser par catégorie
17 mai 2013, parDans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...) -
Récupération d’informations sur le site maître à l’installation d’une instance
26 novembre 2010, parUtilité
Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...) -
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 (6911)
-
ffmpeg export without color loss
27 décembre 2020, par serI'm trying to add a watermark to a video through ffmpeg, but all the exports result in loss of color information. I would like to retain the same color information as the original video, how do I do that ?


Currently, I use this code :


./ffmpeg -i input.MOV -loop 1 -i logo.png -codec:v libx264 -crf 18 -preset medium -filter_complex "



I realised the only way to not lose the color information is to set -crf to 0 and -preset to veryslow, but it results in a really large file size. (2 times the size of original video, which is not effective)


I also get this error when I run ffpmeg :


[swscaler @ 0x117577000] deprecated pixel format used, make sure you did set range correctly



See Image comparison here — the blacks on the export were not as "black" as original


ffprobe -show_streams for Original File


ffprobe version 4.3.1-tessus https://evermeet.cx/ffmpeg/ Copyright (c) 2007-2020 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-libwavpack --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 56. 51.100 / 56. 51.100
 libavcodec 58. 91.100 / 58. 91.100
 libavformat 58. 45.100 / 58. 45.100
 libavdevice 58. 10.100 / 58. 10.100
 libavfilter 7. 85.100 / 7. 85.100
 libswscale 5. 7.100 / 5. 7.100
 libswresample 3. 7.100 / 3. 7.100
 libpostproc 55. 7.100 / 55. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'IMG_0930-BenjaminWong.mov':
 Metadata:
 major_brand : qt 
 minor_version : 0
 compatible_brands: qt 
 creation_time : 2020-12-22T11:31:49.000000Z
 Duration: 00:00:30.00, start: 0.000000, bitrate: 14688 kb/s
 Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 252 kb/s (default)
 Metadata:
 creation_time : 2020-12-22T11:31:49.000000Z
 handler_name : Core Media Audio
 Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 1080x1920, 14430 kb/s, 30 fps, 30 tbr, 600 tbn, 1200 tbc (default)
 Metadata:
 creation_time : 2020-12-22T11:31:49.000000Z
 handler_name : Core Media Video
 encoder : H.264
[STREAM]
index=0
codec_name=aac
codec_long_name=AAC (Advanced Audio Coding)
profile=LC
codec_type=audio
codec_time_base=1/44100
codec_tag_string=mp4a
codec_tag=0x6134706d
sample_fmt=fltp
sample_rate=44100
channels=2
channel_layout=stereo
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/44100
start_pts=0
start_time=0.000000
duration_ts=1321751
duration=29.971678
bit_rate=252820
max_bit_rate=256000
bits_per_raw_sample=N/A
nb_frames=1293
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:creation_time=2020-12-22T11:31:49.000000Z
TAG:language=und
TAG:handler_name=Core Media Audio
[/STREAM]
[STREAM]
index=1
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1/60
codec_tag_string=avc1
codec_tag=0x31637661
width=1080
height=1920
coded_width=1088
coded_height=1920
closed_captions=0
has_b_frames=1
sample_aspect_ratio=N/A
display_aspect_ratio=N/A
pix_fmt=yuvj420p
level=40
color_range=pc
color_space=bt709
color_transfer=bt709
color_primaries=bt709
chroma_location=left
field_order=unknown
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=30/1
avg_frame_rate=30/1
time_base=1/600
start_pts=0
start_time=0.000000
duration_ts=18000
duration=30.000000
bit_rate=14430480
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=900
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:creation_time=2020-12-22T11:31:49.000000Z
TAG:language=und
TAG:handler_name=Core Media Video
TAG:encoder=H.264
[/STREAM]



ffprobe -show_streams for Exported File (added filter & watermark)


ffprobe version 4.3.1-tessus https://evermeet.cx/ffmpeg/ Copyright (c) 2007-2020 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-libwavpack --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 56. 51.100 / 56. 51.100
 libavcodec 58. 91.100 / 58. 91.100
 libavformat 58. 45.100 / 58. 45.100
 libavdevice 58. 10.100 / 58. 10.100
 libavfilter 7. 85.100 / 7. 85.100
 libswscale 5. 7.100 / 5. 7.100
 libswresample 3. 7.100 / 3. 7.100
 libpostproc 55. 7.100 / 55. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'IMG_0930-BenjaminWong_watermarked_1080h264-5.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.45.100
 Duration: 00:00:30.00, start: 0.000000, bitrate: 5141 kb/s
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc), 1080x1080, 5003 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
 Metadata:
 handler_name : VideoHandler
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
 Metadata:
 handler_name : Core Media Audio
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1/60
codec_tag_string=avc1
codec_tag=0x31637661
width=1080
height=1080
coded_width=1088
coded_height=1088
closed_captions=0
has_b_frames=2
sample_aspect_ratio=N/A
display_aspect_ratio=N/A
pix_fmt=yuvj420p
level=32
color_range=pc
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=left
field_order=unknown
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=30/1
avg_frame_rate=30/1
time_base=1/15360
start_pts=0
start_time=0.000000
duration_ts=460800
duration=30.000000
bit_rate=5003599
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=900
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=und
TAG:handler_name=VideoHandler
[/STREAM]
[STREAM]
index=1
codec_name=aac
codec_long_name=AAC (Advanced Audio Coding)
profile=LC
codec_type=audio
codec_time_base=1/44100
codec_tag_string=mp4a
codec_tag=0x6134706d
sample_fmt=fltp
sample_rate=44100
channels=2
channel_layout=stereo
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/44100
start_pts=0
start_time=0.000000
duration_ts=1321898
duration=29.975011
bit_rate=128780
max_bit_rate=128780
bits_per_raw_sample=N/A
nb_frames=1292
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=und
TAG:handler_name=Core Media Audio
[/STREAM]



-
Low processing for conversation of .MOV file to .mp4 using ffmpeg [closed]
4 janvier 2021, par zain raufI am using the below CMD for converting .mov file to .mp4 with following resolution options


ffmpeg -y -i 'Aws s3 video link of .mov file' -vcodec h264 -acodec acc -vf scale=1080:1920,setsar=1:1 -q:a 10 -q:v 3 -preset ultrafast -r 25 -f mp4 -c:a copy tmp/filename-resize.mp4


Issue is that it works very slow when i am using input file as a AWS s3 video link


-
FFMpeg muxing h264 to mp4 resultant file is not running
11 mars 2016, par M.TahaI am writing code to mux h264 file into mp4 by using latest FFMPEG 3.0. Muxing is working but the resultant mp4 file is not showing vedio, only the time is running when i play the resultant mp4 file. Kindly try to help to solve this. Please tell me what i am missing. Here is my code :
int main()
{
avcodec_register_all();
av_register_all();
// define AVOutputFormat
AVOutputFormat *avoutputFormat = NULL;
avoutputFormat = av_guess_format("mp4", NULL, NULL);
if (!avoutputFormat) {
fprintf(stderr, "Could not find suitable output format\n");
return 1;
}
AVFormatContext *avoutFmtCtx = NULL;
/*Below initialize AVFormatContext.*/
avformat_alloc_output_context2(&avoutFmtCtx, avoutputFormat, NULL, NULL);
avoutFmtCtx->oformat = avoutputFormat;
sprintf_s(avoutFmtCtx->filename, "%s", "Out.mp4"); /*Filling output file name..*/
if (avoutputFormat->video_codec == AV_CODEC_ID_NONE)
printf("\n Unsupported format...");
AVStream * avoutStrm = avformat_new_stream(avoutFmtCtx, 0);
if (!avoutStrm) {
_tcprintf(_T("FFMPEG: Could not alloc video stream\n"));
}
AVCodecContext *c = avoutStrm->codec;
c->codec_id = avoutputFormat->video_codec;
c->codec_type = AVMEDIA_TYPE_VIDEO;
c->bit_rate = 2000*1000;
c->width = 1920;
c->height = 1080;
AVRational avr;
avr.den = 30;
avr.num = 1;
avoutStrm->time_base = c->time_base = av_add_q(avoutStrm->codec->time_base, avr);
// Some formats want stream headers to be separate
if(avoutFmtCtx->oformat->flags & AVFMT_GLOBALHEADER)
c->flags |= CODEC_FLAG_GLOBAL_HEADER;
// Open the output container file
if (avio_open(&avoutFmtCtx->pb, avoutFmtCtx->filename, AVIO_FLAG_WRITE) < 0)
{
_tcprintf(_T("FFMPEG: Could not open '%s'\n"), avoutFmtCtx->filename);
}
m_pExtDataBuffer = (uint8_t*)av_malloc(1000 + 1000);
if(!m_pExtDataBuffer) {
_tcprintf(_T("FFMPEG: could not allocate required buffer\n"));
}
uint8_t SPSbuf[1000];
uint8_t PPSbuf[1000];
memcpy(m_pExtDataBuffer, SPSbuf, 1000);
memcpy(m_pExtDataBuffer + 1000, PPSbuf, 1000);
/* Codec "extradata" conveys the H.264 stream SPS and PPS info (MPEG2: sequence header is housed in SPS buffer, PPS buffer is empty)*/
c->extradata = m_pExtDataBuffer;
c->extradata_size = 1000 + 1000;
if(avformat_write_header(avoutFmtCtx,NULL)) {
_tcprintf(_T("FFMPEG: avformat_write_header error!\n"));
}
/* Here do writing data in loop...*/
int m_nProcessedFramesNum = 0;
while(1)
{
++m_nProcessedFramesNum;
AVPacket pkt;
av_init_packet(&pkt);
AVCodecContext *c = avoutStrm->codec;
avoutStrm->pts.val = m_nProcessedFramesNum;
pkt.stream_index = avoutStrm->index;
pkt.data = /*Filling h.264 data from here... This is valid h264 data*/
pkt.size = /*Filling valid h264 data size here...*/
av_new_packet(&pkt,pkt.size);
pkt.pts = m_nProcessedFramesNum*512;
pkt.dts = m_nProcessedFramesNum*512;
pkt.duration = 512;
// Write the compressed frame in the media file
if (av_interleaved_write_frame(avoutFmtCtx, &pkt)) {
_tcprintf(_T("FFMPEG: Error while writing video frame\n"));
}/*End of loop.*/
av_free_packet(&pkt);
}
av_write_trailer(avoutFmtCtx);
avio_close(avoutFmtCtx->pb);
avformat_free_context(avoutFmtCtx);
}