
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (35)
-
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 (...) -
L’agrémenter visuellement
10 avril 2011MediaSPIP est basé sur un système de thèmes et de squelettes. Les squelettes définissent le placement des informations dans la page, définissant un usage spécifique de la plateforme, et les thèmes l’habillage graphique général.
Chacun peut proposer un nouveau thème graphique ou un squelette et le mettre à disposition de la communauté. -
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 (7658)
-
ffmpeg "Time code of first frame" not making sense [closed]
23 janvier, par Kevin VaskoI can't seem to make sense of where ffmpeg is coming up with the "Time code of first frame" value.


My original file that I am using.


This video has the general timestamps of the original encoding date (aka the start time of the video the way I understanding it) and a duration of 8 min and 52s


$ mediainfo GL0100002_output.mp4 
General
Complete name : GL0100002_output.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 93.7 MiB
Duration : 8 min 52 s
Overall bit rate : 1 476 kb/s
Encoded date : UTC 2022-02-23 15:18:42
Tagged date : UTC 2022-02-23 15:18:42
Writing application : Lavf58.29.100

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 8 min 52 s
Bit rate : 1 342 kb/s
Width : 848 pixels
Height : 480 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.138
Stream size : 85.2 MiB (91%)
Title : GoPro AVC 
Writing library : x264 core 155 r2917 0a84d98
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / 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=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language : English
Encoded date : UTC 2022-02-23 15:18:42
Tagged date : UTC 2022-02-23 15:18:42
Color range : Full
Codec configuration box : avcC

Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 8 min 52 s
Bit rate mode : Constant
Bit rate : 129 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 8.16 MiB (9%)
Title : GoPro AAC 
Language : English
Default : Yes
Alternate group : 1
Encoded date : UTC 2022-02-23 15:18:42
Tagged date : UTC 2022-02-23 15:18:42

Other
ID : 3
Type : Time code
Format : QuickTime TC
Duration : 8 min 52 s
Frame rate : 23.976 (24000/1001) FPS
Time code of first frame : 15:57:41:15
Time code, striped : Yes
Title : GoPro AVC 
Language : English
Default : No
Encoded date : UTC 2022-02-23 15:18:42
Tagged date : UTC 2022-02-23 15:18:42



Now if I run


ffmpeg -y -nostdin -v error -ss 00:00:00.042 -i GL0100002_output.mp4 -t 00:00:25.192 -map 0 -map -0:d -c:v libx264 -preset fast -crf 21 -c:a aac -sn GL0100002_test.DSME_0001.mp4


I get the following mediainfo


$ mediainfo GL0100002_test.DSME_0001.mp4 
General
Complete name : GL0100002_test.DSME_0001.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 4.54 MiB
Duration : 25 s 234 ms
Overall bit rate : 1 510 kb/s
Writing application : Lavf58.29.100

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 25 s 234 ms
Bit rate : 1 376 kb/s
Width : 848 pixels
Height : 480 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.141
Stream size : 4.14 MiB (91%)
Title : GoPro AVC 
Writing library : x264 core 155 r2917 0a84d98
Encoding settings : cabac=1 / ref=2 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / 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=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=30 / rc=crf / mbtree=1 / crf=21.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language : English
Color range : Full
Codec configuration box : avcC

Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 25 s 214 ms
Duration_LastFrame : -3 ms
Bit rate mode : Constant
Bit rate : 129 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 398 KiB (9%)
Title : GoPro AAC 
Language : English
Default : Yes
Alternate group : 1

Other
ID : 3
Type : Time code
Format : QuickTime TC
Duration : 25 s 234 ms
Frame rate : 23.976 (24000/1001) FPS
Time code of first frame : 15:57:41:15
Time code, striped : Yes
Title : GoPro AVC 
Language : English
Default : No



But what I don't understand is where
Time code of first frame
is coming from. I would expect it would be00:00:00.042
or evenUTC 2022-02-23 15:18:42
+ .042 but appear to be.

Time code of first frame : 15:57:41:15



Is this potentially clobbering together something to get this time that isn't obvious ?


-
Why my ffmpeg video encode codes does not work on other computer ?
10 avril 2022, par Object UnknownI'm writing code to encode some cv::Mat images to a MP4 video. The program can run successfully in my computer which I developed it, but when I copied it (and all dlls it needs) to an other computer, it stopped work.


The function which reporting error : (I got it from StackOverflow, and added some changes)


int uns::VideoWriter::Remux()
{
 AVFormatContext* ifmt_ctx = NULL, * ofmt_ctx = NULL;
 int err = 0, ret = 0;
 int64_t ts = 0;
 AVStream* inVideoStream = NULL;
 AVStream* outVideoStream = NULL;
 if ((err = avformat_open_input(&ifmt_ctx, VIDEO_TMP_FILE.c_str(), 0, 0)) < 0)
 {
 if(callback != nullptr) 
 callback("[uns::VideoWriter/Remux] Failed to open input file for remuxing", err);
 ret = -1;
 goto end;
 }
 if ((err = avformat_find_stream_info(ifmt_ctx, 0)) < 0) 
 {
 if(callback != nullptr) 
 callback("[uns::VideoWriter/Remux] Failed to retrieve input stream information", err);
 ret = -2;
 goto end;
 }
 if ((err = avformat_alloc_output_context2(&ofmt_ctx, NULL, NULL, FINAL_FILE_NAME.c_str())))
 {
 if(callback != nullptr) 
 callback("[uns::VideoWriter/Remux] Failed to allocate output context", err);
 ret = -3;
 goto end;
 }
 inVideoStream = ifmt_ctx->streams[0];
 outVideoStream = avformat_new_stream(ofmt_ctx, NULL);
 if (!outVideoStream) 
 {
 if(callback != nullptr) 
 callback("[uns::VideoWriter/Remux] Failed to allocate output video stream", 0);
 ret = -4;
 goto end;
 }
 outVideoStream->time_base = { 1, fps };
 if ((err = avcodec_parameters_copy(outVideoStream->codecpar, inVideoStream->codecpar)) < 0)
 {
 if (callback != nullptr)
 callback("[uns::VideoWriter/Remux] Failed to copy stream information", err);
 return -4;
 goto end;
 }
 outVideoStream->codecpar->codec_tag = 0;
 if (!(ofmt_ctx->oformat->flags & AVFMT_NOFILE)) 
 {
 if ((err = avio_open(&ofmt_ctx->pb, FINAL_FILE_NAME.c_str(), AVIO_FLAG_WRITE)) < 0)
 {
 if(callback != nullptr) 
 callback("[uns::VideoWriter/Remux] Failed to open output file", err);
 ret = -5;
 goto end;
 }
 }
 ofmt_ctx->streams[0]->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
 ofmt_ctx->streams[0]->time_base.num = 1;
 ofmt_ctx->streams[0]->time_base.den = fps;
 if ((err = avformat_write_header(ofmt_ctx, 0)) < 0) 
 {
 if(callback != nullptr) 
 callback("[uns::VideoWriter/Remux] Failed to write header to output file", err);
 ret = -6;
 goto end;
 }
 AVPacket videoPkt;
 while (true) 
 {
 if ((err = av_read_frame(ifmt_ctx, &videoPkt)) < 0) 
 {
 break;
 }
 videoPkt.stream_index = outVideoStream->index;
 videoPkt.pts = ts;
 videoPkt.dts = ts;
 videoPkt.duration = av_rescale_q(videoPkt.duration, inVideoStream->time_base, outVideoStream->time_base);
 ts += videoPkt.duration;
 videoPkt.pos = -1;
 if ((err = av_interleaved_write_frame(ofmt_ctx, &videoPkt)) < 0) 
 {
 if(callback != nullptr) 
 callback("[uns::VideoWriter/Remux] Failed to mux packet", err);
 av_packet_unref(&videoPkt);
 break;
 }
 av_packet_unref(&videoPkt);
 }
 av_write_trailer(ofmt_ctx);
end:
 if (ifmt_ctx) 
 {
 avformat_close_input(&ifmt_ctx);
 }
 if (ofmt_ctx && !(ofmt_ctx->oformat->flags & AVFMT_NOFILE)) 
 {
 avio_closep(&ofmt_ctx->pb);
 }
 if (ofmt_ctx) 
 {
 avformat_free_context(ofmt_ctx);
 }
 return ret;
}



Notes :




callback
is a function which prints error messsage and error code.
The error I recived is
[uns::VideoWriter/Remux] Failed to write header to output file, error code: -22




I want to know what is causing this and how to resolve it please.


Other Informations :




Developing Env :




OS : Windows 11 Professional Workstation build 22593.ni_release

IDE : Visual Studio 2022

ffmpeg : 4.4.1

Installed ffmpeg library :
ffmpeg[avcodec],ffmpeg[avdevice],ffmpeg[avfilter],ffmpeg[avfilter],ffmpeg[avformat],ffmpeg[openh264],ffmpeg[swresample],ffmpeg[swscale]

Compile Settings : x64 Release







Running Env which causing error :




OS : Windows Server 2019 DataCenter

With all dlls VS2022 copied to release folder





-
Two character glob pattern
18 octobre 2022, par eSlavkoI have camera capturing image every 10 seconds and store in folder with image name as timestamp like

/2022-05-10_19:11:50.jpg

Each week is stored in separate folder.
Now I want to make video from that images using ffmpeg.
It works with images declared as-pattern_type glob -i "*.jpg"
Now I want to make video from images captured only in daytime. For example from images/2022-05-10_XX:11:50.jpg
whereXX
is in range from 05, 06, 07 .. 20, 21. I try with glob patterns but seems that it can work only over single digit.