From topspoiler at gmail.com Fri Feb 3 03:53:39 2023 From: topspoiler at gmail.com (Sunwook Park) Date: Fri, 3 Feb 2023 10:53:39 +0900 Subject: [Libav-user] Driver provided AI Video Super Resolution for D3D11VA Message-ID: Chromium has implemented AI video super resolution for both Intel and Nvidia GPUs. https://github.com/chromium/chromium/commit/eab34e6417c78846fd3c185879269cdac17bd68b https://github.com/chromium/chromium/commit/46f000a1de9e77a90f6ef3c9b6be72f86752304b The code seems very simple that just tells the driver to use it through calling ID3D11VideoContext::VideoProcessorSetStreamExtension. Supported driver for Nvidia GPUs is expected to be released next week. Intel doesn't promote this feature at all, so no idea if or when they will support it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From magichand555 at gmail.com Sun Feb 12 19:56:06 2023 From: magichand555 at gmail.com (Alessandro Doria) Date: Sun, 12 Feb 2023 18:56:06 +0100 Subject: [Libav-user] H265 Mv Message-ID: Hi, I want to print the motiom vectors on H265 so, presuming that the Mv table is HEVCContext.tab_mvf_pool, my question are: - how to get the number of Mvs ? - how to get the table boundaries ? (first and last element) - how to match the Mv with the corresponding CTB ? Thank you in advance, best regards. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mohamednmn28105 at gmail.com Sun Feb 12 22:18:49 2023 From: mohamednmn28105 at gmail.com (mr N) Date: Sun, 12 Feb 2023 21:18:49 +0100 Subject: [Libav-user] hello world Message-ID: Hi, i try to learn how to use ffmpeg with c++ i need a c++ example of how to record and save a video or audio using ffmpeg -------------- next part -------------- An HTML attachment was scrubbed... URL: From randrianasulu at gmail.com Sun Feb 12 22:27:18 2023 From: randrianasulu at gmail.com (Andrew Randrianasulu) Date: Sun, 12 Feb 2023 23:27:18 +0300 Subject: [Libav-user] hello world In-Reply-To: References: Message-ID: ??, 12 ????. 2023 ?., 23:19 mr N : > Hi, i try to learn how to use ffmpeg with c++ i need a c++ example of how > to record and save a video or audio using ffmpeg > probably not simplest example, but some branches of Cinelerra (written in c++) use ffmpeg/libav* https://github.com/vanakala/cinelerra-cve/blob/master/cinelerra/fileavlibs.C https://git.cinelerra-gg.org/git/?p=goodguy/cinelerra.git;a=blob;f=cinelerra-5.1/cinelerra/ffmpeg.C;h=e9fa85ede4c8668368927b74048dc049a6f3e339;hb=HEAD > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > https://ffmpeg.org/mailman/listinfo/libav-user > > To unsubscribe, visit link above, or email > libav-user-request at ffmpeg.org with subject "unsubscribe". > -------------- next part -------------- An HTML attachment was scrubbed... URL: From martinwguy at gmail.com Tue Feb 14 04:47:43 2023 From: martinwguy at gmail.com (Martin Guy) Date: Tue, 14 Feb 2023 03:47:43 +0100 Subject: [Libav-user] Some first questions using libav for audio decoding Message-ID: Greetings, all. I'm trying to get libav to do sample-accurate seeking in audio files and have a couple of questions: The audio streams's start_time found by: fmt_ctx->streams[audio_stream_index]->start_time where audio_stream_index = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &dec, 0) is 0 for Ogg files and 324870 (0.0230208 seconds) for an MP3 file created by lame, but for a WAV file created by "sox synth" it is -9223372036854775808, which is 0x8000000000000000, the same as the averror code for "Success", At present I'm checking for this value and setting it to 0 if so, but that seems bizarre so I wonder if I'm missing something here. The second query is a suggestion to improve a minor point in the documentation: AVFrame's pts field is said to be the "Presentation timestamp in time_base units" but AVFrame doesn't have a time_base field. While searching for other time_bases I spotted that AVCodecContext's time_base's docs say "This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented." and it is 1/48000 which gives the right results, while there are also AVStream's time_base of 1/14112000 and AV_TIME_BASE of 1000000 Can I suggest updating AVFrame's documentation to say that its pts and friends are measured in the AVCodecContext's time_base to save other noobs trying to decode frames my confusion? Thanks and sorry for the noise M From martinwguy at gmail.com Tue Feb 14 04:53:59 2023 From: martinwguy at gmail.com (Martin Guy) Date: Tue, 14 Feb 2023 03:53:59 +0100 Subject: [Libav-user] Some first questions using libav for audio decoding In-Reply-To: References: Message-ID: On 14/02/2023, Martin Guy wrote: > The audio streams's start_time > for a WAV file created by "sox synth" it > is -9223372036854775808, which is 0x8000000000000000, the same as the > averror code for "Success", Sorry, I just spotted this a minute after writing: #define AV_NOPTS_VALUE ((int64_t)UINT64_C(0x8000000000000000)) on the same page as AV_TIME_BASE Again, it might be worth mentioning this in the place where new users are looking, i.e. the AVFrame pts paragraph Cheers M From martinwguy at gmail.com Tue Feb 14 05:08:20 2023 From: martinwguy at gmail.com (Martin Guy) Date: Tue, 14 Feb 2023 04:08:20 +0100 Subject: [Libav-user] Some first questions using libav for audio decoding In-Reply-To: References: Message-ID: On 14/02/2023, Martin Guy wrote: > AVCodecContext's > time_base's docs say "This is the fundamental unit of time (in > seconds) in terms of which frame timestamps are represented." It turns out that AVStream's time_base's docs also say "This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented." but they are different for an audio-only file: 1/48000 and 1/14112000 respectively. Which applies to timestamps is AVFrames, and when? Wishing I'd seen all this before writing to avoid looking a fool... M From wolverin82 at mail.ru Wed Feb 15 07:54:03 2023 From: wolverin82 at mail.ru (=?UTF-8?B?d29sdmVyaW4=?=) Date: Wed, 15 Feb 2023 08:54:03 +0300 Subject: [Libav-user] =?utf-8?q?RTSP_and_duration_limitation?= Message-ID: <1676440443.636887607@f490.i.mail.ru> Hello, maybe someone has encountered ??I?transcoding from MJPEG to H264 and streaming RTSP publication to the server, everything works well for exactly 13 hours and 15 minutes, then the pts/dts timestamps on the server suddenly start coming from scratch, therefore the online video goes down, I don't have timestamps reset in the code and don't set the duration for online stream. where can the duration of the stream be set or what can affect it??? ? ? ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From monakov.y at gmail.com Wed Feb 15 22:04:06 2023 From: monakov.y at gmail.com (Yurii Monakov) Date: Wed, 15 Feb 2023 23:04:06 +0300 Subject: [Libav-user] RTSP and duration limitation In-Reply-To: <1676440443.636887607@f490.i.mail.ru> References: <1676440443.636887607@f490.i.mail.ru> Message-ID: Hello If you are using ffmpeg on the client too, this is a strange feature of core demuxer. RTP timestamp wraps at 2^32/(90000*3600) ~= 13 hours 15 minutes. RTP decoder correctly unwraps RTP timestamps to 64-bit values. But later, in demux.c, they are treated as 32-bit and incorrectly unwrapped twice, producing negative timestamp deltas. You can set correct_ts_overflow ffmpeg parameter on the client to fix this. If you are not using ffmpeg as RTSP client, you can look at finalize_packet function in libavformat/rtpdec.c to write your own unwrap code. Yurii ??, 15 ????. 2023 ?. ? 08:54, wolverin via Libav-user : > Hello, maybe someone has encountered ? I transcoding from MJPEG to H264 > and streaming RTSP publication to the server, everything works well for > exactly 13 hours and 15 minutes, then the pts/dts timestamps on the server > suddenly start coming from scratch, therefore the online video goes down, I > don't have timestamps reset in the code and don't set the duration for > online stream. > where can the duration of the stream be set or what can affect it??? > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > https://ffmpeg.org/mailman/listinfo/libav-user > > To unsubscribe, visit link above, or email > libav-user-request at ffmpeg.org with subject "unsubscribe". > -------------- next part -------------- An HTML attachment was scrubbed... URL: From monakov.y at gmail.com Wed Feb 15 22:07:34 2023 From: monakov.y at gmail.com (Yurii Monakov) Date: Wed, 15 Feb 2023 23:07:34 +0300 Subject: [Libav-user] RTSP and duration limitation In-Reply-To: References: <1676440443.636887607@f490.i.mail.ru> Message-ID: > You can set correct_ts_overflow ffmpeg parameter on the client to fix this. One important note: you should set this parameter 0. ??, 15 ????. 2023 ?. ? 23:04, Yurii Monakov : > Hello > > If you are using ffmpeg on the client too, this is a strange feature of > core demuxer. RTP timestamp wraps > at 2^32/(90000*3600) ~= 13 hours 15 minutes. RTP decoder correctly unwraps > RTP timestamps to 64-bit > values. But later, in demux.c, they are treated as 32-bit and incorrectly > unwrapped twice, producing negative > timestamp deltas. > > You can set correct_ts_overflow ffmpeg parameter on the client to fix this. > > If you are not using ffmpeg as RTSP client, you can look at finalize_packet > function in libavformat/rtpdec.c > to write your own unwrap code. > > Yurii > > ??, 15 ????. 2023 ?. ? 08:54, wolverin via Libav-user < > libav-user at ffmpeg.org>: > >> Hello, maybe someone has encountered ? I transcoding from MJPEG to H264 >> and streaming RTSP publication to the server, everything works well for >> exactly 13 hours and 15 minutes, then the pts/dts timestamps on the server >> suddenly start coming from scratch, therefore the online video goes down, I >> don't have timestamps reset in the code and don't set the duration for >> online stream. >> where can the duration of the stream be set or what can affect it??? >> >> >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> https://ffmpeg.org/mailman/listinfo/libav-user >> >> To unsubscribe, visit link above, or email >> libav-user-request at ffmpeg.org with subject "unsubscribe". >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wolverin82 at mail.ru Sat Feb 18 04:49:28 2023 From: wolverin82 at mail.ru (=?UTF-8?B?d29sdmVyaW4=?=) Date: Sat, 18 Feb 2023 05:49:28 +0300 Subject: [Libav-user] =?utf-8?q?RTSP_and_duration_limitation?= In-Reply-To: References: <1676440443.636887607@f490.i.mail.ru> Message-ID: <1676688568.916046640@f405.i.mail.ru> >> You can set correct_ts_overflow ffmpeg parameter on the client to fix this. >One important note: you should set this parameter 0 ? thank you, you helped me a lot! -------------- next part -------------- An HTML attachment was scrubbed... URL: From jimfcarroll at gmail.com Tue Feb 21 03:26:36 2023 From: jimfcarroll at gmail.com (Jim Carroll) Date: Mon, 20 Feb 2023 20:26:36 -0500 Subject: [Libav-user] Remuxing an MP4 to an AVI Message-ID: I'm getting an error when remuxing an mp4 to an avi file. I'm dropping all packets except those coming from the first video stream from the input and writing the output with the following code: https://github.com/KognitionAI/pilecv4j/blob/master/native-ffmpeg/src/main/cpp/api/Muxer.cpp#L61 The writeFinalPacket is just an av_interleaved_write_frame with error handling. I can remux to mp4 or mpegts with this code but when I try to remux to an avi I get a series of message like: "[avi @ 0x7fae085a9b80] H.264 bitstream error, startcode missing, size 4343 data 000010F3" The final file kinda-plays but starts gray, then after some frames play, turns gray again. The command line works fine: ffmpeg -i input.mp4 -map 0:v -c:v copy output.avi Any suggestions for correcting this and more robust muxing in general? Thanks in advance. Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: From Zed_Zhang at comcast.com Wed Feb 22 22:21:05 2023 From: Zed_Zhang at comcast.com (Zhang, Zed) Date: Wed, 22 Feb 2023 20:21:05 +0000 Subject: [Libav-user] Question on AVIOContext / FFIOContext - master branch Message-ID: I am using the master branch for stream transcoding, reading from memory and sending the transcoded packets to the memory. To accomplish that, I use two AVIOContext variables to feed into input and output AVFormatContext. I ran into a memory leak after I free all the things I allocated. I traced further, and noticed this in the aviobuf.c. Note the avio_alloc_context actually allocates the superceding struct FFIOContext, and only returns an element (&s->pub) from FFIOContext. The question naturally is how am I going to free FFIOContext, not just AVIOConect to plug the memory leak here? AVIOContext *avio_alloc_context( unsigned char *buffer, int buffer_size, int write_flag, void *opaque, int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), int64_t (*seek)(void *opaque, int64_t offset, int whence)) { FFIOContext *s = av_malloc(sizeof(*s)); if (!s) return NULL; ffio_init_context(s, buffer, buffer_size, write_flag, opaque, read_packet, write_packet, seek); return &s->pub; } Thanks, Zed Zhang -------------- next part -------------- An HTML attachment was scrubbed... URL: