Re: [FFmpeg-devel] [PATCH 1/4] libavdevice/avfoundation: add framerate and video size options
Am 18.03.15 um 09:36 schrieb Matthieu Bouron: > On Sat, Mar 14, 2015 at 11:09 AM, Matthieu Bouron > wrote: > >> On Sat, Mar 14, 2015 at 11:01 AM, Matthieu Bouron < >> matthieu.bou...@gmail.com> wrote: >> >>> >>> >>> On Sat, Mar 14, 2015 at 8:31 AM, Carl Eugen Hoyos >>> wrote: >>> gmail.com> writes: > +for (NSObject *format in You may ignore this but I just changed the code to not mix declarations and statements to silence warnings when compiling with old gcc compilers... >>> >>> I don't have access to an older version of OSX which uses gcc. >>> I've updated the patch locally to separate declarations and statements. >>> >>> > +if (framerate == 0.0 Just asking: Does this really work? >>> >>> Nope it doesn't, it's just a glitch i forget to remove when i was not >>> using the AV_OPT_TYPE_IMAGE_SIZE for the framerate option (and the value >>> was defaulting to 0). >>> I've removed it locally. >>> >> >> New patch attached. >> >> > ping Am 18.03.15 um 09:36 schrieb Matthieu Bouron:> On Sat, Mar 14, 2015 at 11:11 AM, Matthieu Bouron > wrote: > >> >> >> On Sat, Mar 14, 2015 at 10:50 AM, Matthieu Bouron < >> matthieu.bou...@gmail.com> wrote: >> >>> >>> >>> On Sat, Mar 14, 2015 at 8:29 AM, Carl Eugen Hoyos >>> wrote: >>> gmail.com> writes: > +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 Please make this "#if !TARGET_OS_IPHONE && ..." to avoid warnings when compiling for iOS. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel >>> >>> Hello Carl, >>> >>> Both code blocks are already contained in the following blocks: >>> >>> #if !TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 >>> [...] >>> #endif >>> >>> Do you still want the #if !TARGET_OS_IPHONE for consistency ? >>> >> >> New patch attached with the #if !TARGET_OS_IPHONE condition. >> > > ping >From d581aaea69145a0fdd2ebc14dc11e0929e7f5252 Mon Sep 17 00:00:00 2001 From: Matthieu Bouron Date: Sat, 7 Mar 2015 21:26:52 +0100 Subject: [PATCH 1/4] libavdevice/avfoundation: add framerate and video size options Support framerate ands video size options on AVCaptureDevices for OSX >= 10.7 and iOS >= 7.0. For screen captures, only the framerate option is taken into account. --- libavdevice/avfoundation.m | 104 + 1 file changed, 104 insertions(+) diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m index e00cc3b..86e6578 100644 --- a/libavdevice/avfoundation.m +++ b/libavdevice/avfoundation.m @@ -33,6 +33,7 @@ #include "libavutil/avstring.h" #include "libavformat/internal.h" #include "libavutil/internal.h" +#include "libavutil/parseutils.h" #include "libavutil/time.h" #include "avdevice.h" @@ -90,6 +91,9 @@ typedef struct id avf_delegate; id avf_audio_delegate; +AVRational framerate; +int width, height; + int list_devices; int video_device_index; int video_stream_index; @@ -263,9 +267,77 @@ static void parse_device_name(AVFormatContext *s) } } +/* + * Configure the video device using a run-time approach to access properties + * since formats, activeFormat are available since iOS >= 7.0 or OSX >= 10.7 + * and activeVideoMaxFrameDuration is available since i0S >= 7.0 and OSX >= 10.9 + * + * The NSUndefinedKeyException must be handled by the caller of this function. + * + */ Please make it a short doxygen comment: /** +static int configure_video_device(AVFormatContext *s, AVCaptureDevice *video_device) +{ +AVFContext *ctx = (AVFContext*)s->priv_data; + +double framerate = av_q2d(ctx->framerate); +NSObject *format = nil, *range = nil; +NSObject *selected_format = nil, *selected_range = nil; Nit: Please split these in 4 lines. +for (format in [video_device valueForKey:@"formats"]) { +CMFormatDescriptionRef formatDescription; +CMVideoDimensions dimensions; + +formatDescription = (CMFormatDescriptionRef) [format performSelector:@selector(formatDescription)]; +dimensions = CMVideoFormatDescriptionGetDimensions(formatDescription); + +if ((ctx->width == 0 && ctx->height == 0) || +(dimensions.width == ctx->width && dimensions.height == ctx->height)) { + +selected_format = format; + +for (range in [format valueForKey:@"videoSupportedFrameRateRanges"]) { +double max_framerate; + +[[range valueForKey:@"maxFrameRate"] getValue:&max_framerate]; +if (abs (framerate - max_framerate) < 0.1) { + Unneeded blank line. +selected_range = range; +break; +} +} +} +} + +if (!selected_format)
Re: [FFmpeg-devel] [PATCH 2/4] libavdevice/avfoundation: add capture_screen_cursor option
Am 18.03.15 um 09:36 schrieb Matthieu Bouron: > On Sat, Mar 14, 2015 at 11:11 AM, Matthieu Bouron > wrote: > >> >> >> On Sat, Mar 14, 2015 at 10:50 AM, Matthieu Bouron < >> matthieu.bou...@gmail.com> wrote: >> >>> >>> >>> On Sat, Mar 14, 2015 at 8:29 AM, Carl Eugen Hoyos >>> wrote: >>> gmail.com> writes: > +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 Please make this "#if !TARGET_OS_IPHONE && ..." to avoid warnings when compiling for iOS. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel >>> >>> Hello Carl, >>> >>> Both code blocks are already contained in the following blocks: >>> >>> #if !TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 >>> [...] >>> #endif >>> >>> Do you still want the #if !TARGET_OS_IPHONE for consistency ? >>> >> >> New patch attached with the #if !TARGET_OS_IPHONE condition. >> > > ping >From 315a96b694702f2182264bb4b01d04fc7848f9a3 Mon Sep 17 00:00:00 2001 From: Matthieu Bouron Date: Sat, 7 Mar 2015 22:01:03 +0100 Subject: [PATCH 2/4] libavdevice/avfoundation: add capture_screen_cursor option Add support for cursor capturing while recording a screen for OSX >= 10.8. --- libavdevice/avfoundation.m | 19 +++ 1 file changed, 19 insertions(+) diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m index 86e6578..792dfa6 100644 --- a/libavdevice/avfoundation.m +++ b/libavdevice/avfoundation.m @@ -94,6 +94,8 @@ typedef struct AVRational framerate; int width, height; +int capture_screen_cursor; + int list_devices; int video_device_index; int video_stream_index; @@ -706,6 +708,14 @@ static int avf_read_header(AVFormatContext *s) capture_screen_input.minFrameDuration = CMTimeMake(ctx->framerate.den, ctx->framerate.num); } +#if !TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 +if (ctx->capture_screen_cursor) { +capture_screen_input.capturesCursor = YES; +} else { +capture_screen_input.capturesCursor = NO; +} +#endif + video_device = (AVCaptureDevice*) capture_screen_input; capture_screen = 1; #endif @@ -741,6 +751,14 @@ static int avf_read_header(AVFormatContext *s) if (ctx->framerate.num > 0) { capture_screen_input.minFrameDuration = CMTimeMake(ctx->framerate.den, ctx->framerate.num); } + +#if !TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 +if (ctx->capture_screen_cursor) { +capture_screen_input.capturesCursor = YES; +} else { +capture_screen_input.capturesCursor = NO; +} +#endif } } #endif @@ -957,6 +975,7 @@ static const AVOption options[] = { { "pixel_format", "set pixel format", offsetof(AVFContext, pixel_format), AV_OPT_TYPE_PIXEL_FMT, {.i64 = AV_PIX_FMT_YUV420P}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM}, { "framerate", "set frame rate", offsetof(AVFContext, framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "ntsc"}, 0, 0, AV_OPT_FLAG_DECODING_PARAM }, { "size", "set video size", offsetof(AVFContext, width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM }, +{ "capture_screen_cursor", "capture the screen cursor", offsetof(AVFContext, capture_screen_cursor), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM }, I suggest to rename the option to "capture_cursor"... _screen_ in it seems to be redundant. { NULL }, }; -- 1.9.3 (Apple Git-50) Ok otherwise. -Thilo ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/4] libavdevice/avfoundation: add capture_screen_mouse_clicks option
Am 18.03.15 um 09:37 schrieb Matthieu Bouron: > On Fri, Mar 13, 2015 at 8:16 PM, wrote: > >> From: Matthieu Bouron >> >> Support mouse clicks capture while recording a screen on OSX >= 10.7. >> --- >> libavdevice/avfoundation.m | 15 +++ >> 1 file changed, 15 insertions(+) >> >> diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m >> index e574518..8112229 100644 >> --- a/libavdevice/avfoundation.m >> +++ b/libavdevice/avfoundation.m >> @@ -95,6 +95,7 @@ typedef struct >> int width, height; >> >> int capture_screen_cursor; >> +int capture_screen_mouse_clicks; >> >> int list_devices; >> int video_device_index; >> @@ -715,6 +716,12 @@ static int avf_read_header(AVFormatContext *s) >> } >> #endif >> >> +if (ctx->capture_screen_mouse_clicks) { >> +capture_screen_input.capturesMouseClicks = YES; >> +} else { >> +capture_screen_input.capturesMouseClicks = NO; >> +} >> + >> video_device = (AVCaptureDevice*) capture_screen_input; >> capture_screen = 1; >> #endif >> @@ -758,6 +765,12 @@ static int avf_read_header(AVFormatContext *s) >> capture_screen_input.capturesCursor = NO; >> } >> #endif >> + >> +if (ctx->capture_screen_mouse_clicks) { >> +capture_screen_input.capturesMouseClicks = YES; >> +} else { >> +capture_screen_input.capturesMouseClicks = NO; >> +} >> } >> } >> #endif >> @@ -975,6 +988,8 @@ static const AVOption options[] = { >> { "framerate", "set frame rate", offsetof(AVFContext, framerate), >> AV_OPT_TYPE_VIDEO_RATE, {.str = "ntsc"}, 0, 0, AV_OPT_FLAG_DECODING_PARAM }, >> { "size", "set video size", offsetof(AVFContext, width), >> AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM }, >> { "capture_screen_cursor", "capture the screen cursor", >> offsetof(AVFContext, capture_screen_cursor), AV_OPT_TYPE_INT, {.i64=0}, 0, >> 1, AV_OPT_FLAG_DECODING_PARAM }, >> +{ "capture_screen_mouse_clicks", "capture the screen mouse clicks", >> offsetof(AVFContext, capture_screen_mouse_clicks), AV_OPT_TYPE_INT, >> {.i64=0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM }, >> + >> { NULL }, >> }; >> >> -- >> 2.3.2 >> >> > ping Ok if tested. -Thilo ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 4/4] libavdevice/avfoundation: use pts/dts provided by the CMSampleBuffer API
Am 18.03.15 um 09:37 schrieb Matthieu Bouron: > On Fri, Mar 13, 2015 at 8:16 PM, wrote: > >> From: Matthieu Bouron >> >> --- >> libavdevice/avfoundation.m | 21 +++-- >> 1 file changed, 15 insertions(+), 6 deletions(-) >> >> diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m >> index 8112229..5bcd6a4 100644 >> --- a/libavdevice/avfoundation.m >> +++ b/libavdevice/avfoundation.m >> @@ -881,9 +881,14 @@ static int avf_read_packet(AVFormatContext *s, >> AVPacket *pkt) >> return AVERROR(EIO); >> } >> >> -pkt->pts = pkt->dts = av_rescale_q(av_gettime() - >> ctx->first_pts, >> - AV_TIME_BASE_Q, >> - avf_time_base_q); >> +CMItemCount count; >> +CMSampleTimingInfo timing_info; >> + >> +if >> (CMSampleBufferGetOutputSampleTimingInfoArray(ctx->current_frame, 1, >> &timing_info, &count) == noErr) { >> +AVRational timebase_q = av_make_q(1, >> timing_info.presentationTimeStamp.timescale); >> +pkt->pts = pkt->dts = >> av_rescale_q(timing_info.presentationTimeStamp.value, timebase_q, >> avf_time_base_q); >> +} >> + >> pkt->stream_index = ctx->video_stream_index; >> pkt->flags|= AV_PKT_FLAG_KEY; >> >> @@ -911,9 +916,13 @@ static int avf_read_packet(AVFormatContext *s, >> AVPacket *pkt) >> return AVERROR(EIO); >> } >> >> -pkt->pts = pkt->dts = av_rescale_q(av_gettime() - >> ctx->first_audio_pts, >> - AV_TIME_BASE_Q, >> - avf_time_base_q); >> +CMItemCount count; >> +CMSampleTimingInfo timing_info; >> + >> +if >> (CMSampleBufferGetOutputSampleTimingInfoArray(ctx->current_audio_frame, 1, >> &timing_info, &count) == noErr) { >> +AVRational timebase_q = av_make_q(1, >> timing_info.presentationTimeStamp.timescale); >> +pkt->pts = pkt->dts = >> av_rescale_q(timing_info.presentationTimeStamp.value, timebase_q, >> avf_time_base_q); >> +} >> >> pkt->stream_index = ctx->audio_stream_index; >> pkt->flags|= AV_PKT_FLAG_KEY; >> -- >> 2.3.2 >> >> > ping Ok if tested. -Thilo ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/4] libavdevice/avfoundation: add capture_screen_mouse_clicks option
Am 21.03.15 um 18:42 schrieb Thilo Borgmann: > Am 18.03.15 um 09:37 schrieb Matthieu Bouron: >> On Fri, Mar 13, 2015 at 8:16 PM, wrote: >> >>> From: Matthieu Bouron >>> >>> Support mouse clicks capture while recording a screen on OSX >= 10.7. >>> --- >>> libavdevice/avfoundation.m | 15 +++ >>> 1 file changed, 15 insertions(+) >>> >>> diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m >>> index e574518..8112229 100644 >>> --- a/libavdevice/avfoundation.m >>> +++ b/libavdevice/avfoundation.m >>> @@ -95,6 +95,7 @@ typedef struct >>> int width, height; >>> >>> int capture_screen_cursor; >>> +int capture_screen_mouse_clicks; >>> >>> int list_devices; >>> int video_device_index; >>> @@ -715,6 +716,12 @@ static int avf_read_header(AVFormatContext *s) >>> } >>> #endif >>> >>> +if (ctx->capture_screen_mouse_clicks) { >>> +capture_screen_input.capturesMouseClicks = YES; >>> +} else { >>> +capture_screen_input.capturesMouseClicks = NO; >>> +} >>> + >>> video_device = (AVCaptureDevice*) capture_screen_input; >>> capture_screen = 1; >>> #endif >>> @@ -758,6 +765,12 @@ static int avf_read_header(AVFormatContext *s) >>> capture_screen_input.capturesCursor = NO; >>> } >>> #endif >>> + >>> +if (ctx->capture_screen_mouse_clicks) { >>> +capture_screen_input.capturesMouseClicks = YES; >>> +} else { >>> +capture_screen_input.capturesMouseClicks = NO; >>> +} >>> } >>> } >>> #endif >>> @@ -975,6 +988,8 @@ static const AVOption options[] = { >>> { "framerate", "set frame rate", offsetof(AVFContext, framerate), >>> AV_OPT_TYPE_VIDEO_RATE, {.str = "ntsc"}, 0, 0, AV_OPT_FLAG_DECODING_PARAM }, >>> { "size", "set video size", offsetof(AVFContext, width), >>> AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM }, >>> { "capture_screen_cursor", "capture the screen cursor", >>> offsetof(AVFContext, capture_screen_cursor), AV_OPT_TYPE_INT, {.i64=0}, 0, >>> 1, AV_OPT_FLAG_DECODING_PARAM }, >>> +{ "capture_screen_mouse_clicks", "capture the screen mouse clicks", Please rename to "capture_mouse_clicks". -Thilo ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] GSoC project proposal + qualification task
On Fri, 20 Mar 2015 02:51:31 +0100 Mariusz Szczepańczyk wrote: > Hello, > > my name is Mariusz Szczepańczyk and I am currently finishing my > bachelor's degree in Computer Science at the University of Warsaw in > Poland. I have written few patches for other open source projects, like > gif reading plugin for OpenImageIO, however I'm new to FFmpeg. > > I'd like to work on the "Browsing content on the server" task as > described on wiki extended by samba and possibly local zip archives if > it gets a good reception. And maybe having rename and delete methods > also could be nice. I reached out to Lukasz Marek, who is listed as > backup mentor and he pointed me to his last year's patches that add > directory listing api and implement some of the protocols. In a couple > of minutes I'll send these patches rebased against current master plus > my take on samba protocol. > > Any comments and ideas are appreciated. If the patches you posted (and which are not even your work, just rebased older patches from someone else) are the qualification task, then what's left for the "real" project work? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/pngenc: add supporting PAL8 pixel format for APNG demuxer
Hi On Thu, Mar 19, 2015 at 06:50:27PM +0300, Alexey Dolgavin wrote: > It addes support PAL8 pixel format for APNG-picture. > The picture is http://littlesvr.ca/apng/samples.html (clock) > It is a qualification task of GSoC 2015 (mentor is Paul B Mahol) > > --- > libavcodec/pngdec.c | 58 > + > 1 file changed, 36 insertions(+), 22 deletions(-) this does not seem to work, trying to decode "clock" shows heavy artifacts [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Into a blind darkness they enter who follow after the Ignorance, they as if into a greater darkness enter who devote themselves to the Knowledge alone. -- Isha Upanishad signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] vp9: make "above" buffer pointer 32-byte aligned.
--- libavcodec/vp9.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index 77e98f5..a5e36f5 100644 --- a/libavcodec/vp9.c +++ b/libavcodec/vp9.c @@ -2506,7 +2506,7 @@ static void intra_recon(AVCodecContext *ctx, ptrdiff_t y_off, ptrdiff_t uv_off) for (x = 0; x < end_x; x += uvstep1d, ptr += 4 * uvstep1d, ptr_r += 4 * uvstep1d, n += step) { int mode = b->uvmode; -uint8_t *a = &a_buf[16]; +uint8_t *a = &a_buf[32]; int eob = b->skip ? 0 : b->uvtx > TX_8X8 ? AV_RN16A(&s->uveob[p][n]) : s->uveob[p][n]; mode = check_intra_mode(s, mode, &a, ptr_r, -- 2.1.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] OpenExr Compression technique added -GSoc 15
New compression technique -B44 lossy compression for OpenExr >From d6da9dea16a5b8247aac60a0ce21cb56981e66ec Mon Sep 17 00:00:00 2001 From: greeshmab Date: Sun, 22 Mar 2015 01:09:53 +0530 Subject: [PATCH] new compression --- libavcodec/exr.c | 122 +++ 1 file changed, 122 insertions(+) diff --git a/libavcodec/exr.c b/libavcodec/exr.c index 6251fb7..077f33b 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -770,6 +770,125 @@ static int piz_uncompress(EXRContext *s, const uint8_t *src, int ssize, return 0; } + +static void B44_unpack14 ( GetByteContext *gb, uint16_t out[16]){ +uint16_t shift; +const uint8_t *r = gb->buffer; +av_assert0(r[2] != 0xfc); +out[0] = (r[0] << 8) | r[1]; +shift = (r[2] >> 2); +out[ 1] = out[ 0] + ((r[ 5] >> 2) << shift); +out[ 2] = out[ 1] + ((r[ 8] >> 2) << shift); +out[ 3] = out[ 2] + ((r[11] >> 2) << shift); +out[ 4] = out[ 0] + (((r[ 2] << 4) | (r[ 3] >> 4)) << shift); +out[ 5] = out[ 4] + (((r[ 5] << 4) | (r[ 6] >> 4)) << shift); +out[ 6] = out[ 5] + (((r[ 8] << 4) | (r[ 9] >> 4)) << shift); +out[ 7] = out[ 6] + (((r[11] << 4) | (r[12] >> 4)) << shift); +out[ 8] = out[ 4] + (((r[ 3] << 2) | (r[ 4] >> 6)) << shift); +out[ 9] = out[ 8] + (((r[ 6] << 2) | (r[ 7] >> 6)) << shift); +out[10] = out[ 9] + (((r[ 9] << 2) | (r[10] >> 6)) << shift); +out[11] = out[10] + (((r[12] << 2) | (r[13] >> 6)) << shift); +out[12] = out[ 8] + (r[ 4] << shift); +out[13] = out[12] + (r[ 7] << shift); +out[14] = out[13] + (r[10] << shift); +out[15] = out[14] + (r[13] << shift); +for (int i = 0; i < 16; ++i) { //if any out value exceeds 16bits +if (out[i] & 0x8000) +out[i] &= 0x7fff; +else +out[i] = ~out[i]; +} +} + + +static void B44_unpack3 ( GetByteContext *gb, uint16_t out[16]){ +const uint8_t *r = gb->buffer; //pixels have the same value +av_assert0(r[2] == 0xfc); +out[0] = (r[0] << 8) | r[1]; +if (out[0] & 0x8000) +out[0] &= 0x7fff; +else +out[0] = ~out[0]; +for (int i = 1; i < 16; ++i) +out[i] = out[0]; +} + + + +static int b44_uncompress(EXRContext *s, const uint8_t *src,int ssize, int dsize, EXRThreadData *td) + +{ +GetByteContext gb; +unsigned long dest_len = dsize; +uint8_t *out; +int i, j; +uint16_t *tmp = (uint16_t *)td->tmp; +out = td->uncompressed_data; +bytestream2_init(&gb, src, ssize); +if (uncompress(td->tmp, &dest_len, src, ssize) != Z_OK || dest_len != dsize) +return AVERROR_INVALIDDATA; +for (i = 0; i < s->nb_channels; i++) { +EXRChannel *channel = &s->channels[i]; +int size = channel->pixel_type; +int inSize = ssize; +if (channel->pixel_type != EXR_HALF) { // UINT or FLOAT channel. +int n = s->xdelta * s->ydelta * size * sizeof (*tmp); +memcpy (tmp, gb.buffer, n); +gb.buffer += n; +inSize -= n; +continue; +} else {//EXR_HALF Channel +for (int y=0; y < s->ydelta; y +=4 ) { +uint16_t *row0 = tmp + y * s->xdelta; +uint16_t *row1 = row0 + s->xdelta; +uint16_t *row2 = row1 + s->xdelta; +uint16_t *row3 = row2 + s->xdelta; +for (int x = 0; x < s->xdelta; x += 4) { +uint16_t out[16]; +int num = (x + 3 < s->xdelta)? 4 * sizeof (*out) : (s->xdelta - x) * sizeof (*out); +if (gb.buffer[2] == 0xfc) { +B44_unpack3 (&gb, out); +gb.buffer += 3; +inSize -= 3; +} else { +B44_unpack14 (&gb, out); +gb.buffer += 14; +inSize -= 14; +} + +if (y + 3 < s->ydelta) { +memcpy (row0, &out[ 0], num); +memcpy (row1, &out[ 4], num); +memcpy (row2, &out[ 8], num); +memcpy (row3, &out[12], num); +} else { +memcpy (row0, &out[ 0], num); +if (y + 1 < s->ydelta) +memcpy (row1, &out[ 4], num); +if (y + 2 < s->ydelta) +memcpy (row2, &out[ 8], num); +} +row0 += 4; +row1 += 4; +row2 += 4; +row3 += 4; +} +} +} +} +for (i = 0; i < s->ysize; i++) { +for (j = 0; j < s->nb_channels; j++) { +uint16_t *in = tmp + j * s->xdelta * s->ysize + i * s->xdelta; +memcpy(out, in, s->xdelta * 2); +out += s->xd
Re: [FFmpeg-devel] [PATCH] vp9: make "above" buffer pointer 32-byte aligned.
On 21/03/15 4:36 PM, Ronald S. Bultje wrote: > --- > libavcodec/vp9.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c > index 77e98f5..a5e36f5 100644 > --- a/libavcodec/vp9.c > +++ b/libavcodec/vp9.c > @@ -2506,7 +2506,7 @@ static void intra_recon(AVCodecContext *ctx, ptrdiff_t > y_off, ptrdiff_t uv_off) > for (x = 0; x < end_x; x += uvstep1d, ptr += 4 * uvstep1d, > ptr_r += 4 * uvstep1d, n += step) { > int mode = b->uvmode; > -uint8_t *a = &a_buf[16]; > +uint8_t *a = &a_buf[32]; > int eob = b->skip ? 0 : b->uvtx > TX_8X8 ? > AV_RN16A(&s->uveob[p][n]) : s->uveob[p][n]; > > mode = check_intra_mode(s, mode, &a, ptr_r, > Referenced ticket 4383 and applied. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [GSoC] Proof-of-concept HTTP Server
Hi, this is a patch for a proof-of-concept for an http server. Usage on the server side: ffmpeg -i test.mp3 -c copy -listen 1 -f mp3 http://0.0.0.0 Usage on the client side: ffplay http://localhost:8080 I looked at tls.c and tcp.c and copied parts of the code. Please comment. Regards, Stephan Holljes --- libavformat/http.c | 113 ++-- 1 file changed, 83 insertions(+), 30 deletions(-) diff --git a/libavformat/http.c b/libavformat/http.c index da3c9be..d61e4e2 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -96,8 +96,12 @@ typedef struct HTTPContext { int send_expect_100; char *method; int reconnect; +int listen; +int fd; +int header_sent; } HTTPContext; + #define OFFSET(x) offsetof(HTTPContext, x) #define D AV_OPT_FLAG_DECODING_PARAM #define E AV_OPT_FLAG_ENCODING_PARAM @@ -127,6 +131,7 @@ static const AVOption options[] = { { "end_offset", "try to limit the request to bytes preceding this offset", OFFSET(end_off), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, D }, { "method", "Override the HTTP method", OFFSET(method), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E }, { "reconnect", "auto reconnect after disconnect before EOF", OFFSET(reconnect), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, D }, +{ "listen", "listen on HTTP", OFFSET(listen), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, D }, { NULL } }; @@ -299,8 +304,10 @@ int ff_http_averror(int status_code, int default_averror) static int http_open(URLContext *h, const char *uri, int flags, AVDictionary **options) { +struct addrinfo hints = { 0 }, *ai; HTTPContext *s = h->priv_data; -int ret; +int ret = -1, fd; +char portstr[] = "8080"; // allow non-root users for now if( s->seekable == 1 ) h->is_streamed = 0; @@ -320,11 +327,39 @@ static int http_open(URLContext *h, const char *uri, int flags, av_log(h, AV_LOG_WARNING, "No trailing CRLF found in HTTP header.\n"); } +if (s->listen) { +hints.ai_family = AF_UNSPEC; +hints.ai_socktype = SOCK_STREAM; +hints.ai_flags |= AI_PASSIVE; +ret = getaddrinfo(NULL, portstr, &hints, &ai); +if (ret) { +av_log(h, AV_LOG_ERROR, "borked"); +return AVERROR(EIO); +} +fd = ff_socket(ai->ai_family, + ai->ai_socktype, + ai->ai_protocol); +if (fd < 0) { +ret = ff_neterrno(); +freeaddrinfo(ai); +return -1; +} -ret = http_open_cnx(h, options); -if (ret < 0) -av_dict_free(&s->chained_options); -return ret; +fd = ff_listen_bind(fd, ai->ai_addr, ai->ai_addrlen, -1, h); +if (fd < 0) { +freeaddrinfo(ai); +return fd; +} +h->is_streamed = 1; +s->fd = fd; +freeaddrinfo(ai); +return 0; +} else { +ret = http_open_cnx(h, options); +if (ret < 0) +av_dict_free(&s->chained_options); +return ret; +} } static int http_getc(HTTPContext *s) @@ -1102,25 +1137,40 @@ static int http_write(URLContext *h, const uint8_t *buf, int size) char temp[11] = ""; /* 32-bit hex + CRLF + nul */ int ret; char crlf[] = "\r\n"; +char header[] = "HTTP 200 OK\r\n\r\n"; HTTPContext *s = h->priv_data; +if (!s->listen) { +if (!s->chunked_post) { +/* non-chunked data is sent without any special encoding */ +return ffurl_write(s->hd, buf, size); +} -if (!s->chunked_post) { -/* non-chunked data is sent without any special encoding */ -return ffurl_write(s->hd, buf, size); -} - -/* silently ignore zero-size data since chunk encoding that would - * signal EOF */ -if (size > 0) { -/* upload data using chunked encoding */ -snprintf(temp, sizeof(temp), "%x\r\n", size); +/* silently ignore zero-size data since chunk encoding that would + * signal EOF */ +if (size > 0) { +/* upload data using chunked encoding */ +snprintf(temp, sizeof(temp), "%x\r\n", size); -if ((ret = ffurl_write(s->hd, temp, strlen(temp))) < 0 || -(ret = ffurl_write(s->hd, buf, size)) < 0 || -(ret = ffurl_write(s->hd, crlf, sizeof(crlf) - 1)) < 0) -return ret; +if ((ret = ffurl_write(s->hd, temp, strlen(temp))) < 0 || +(ret = ffurl_write(s->hd, buf, size)) < 0 || +(ret = ffurl_write(s->hd, crlf, sizeof(crlf) - 1)) < 0) +return ret; +} +return size; +} else { +if (!s->header_sent) { +ret = send(s->fd, header, sizeof(header), MSG_NOSIGNAL); +s->header_sent = 1; +return ret < 0 ? ff_neterrno() : ret; +} +if (size > 0) { +
Re: [FFmpeg-devel] OpenExr Compression technique added -GSoc 15
On Sun, Mar 22, 2015 at 01:12:57AM +0530, greeshma wrote: > New compression technique -B44 lossy compression for OpenExr > > From d6da9dea16a5b8247aac60a0ce21cb56981e66ec Mon Sep 17 00:00:00 2001 > From: greeshmab > Date: Sun, 22 Mar 2015 01:09:53 +0530 > Subject: [PATCH] new compression > [...] > exr.c | 122 > ++ > 1 file changed, 122 insertions(+) > 3a408b9625437f474632f0f9247f3bf5a86e6323 0001-new-compression.patch > From d6da9dea16a5b8247aac60a0ce21cb56981e66ec Mon Sep 17 00:00:00 2001 > From: greeshmab > Date: Sun, 22 Mar 2015 01:09:53 +0530 > Subject: [PATCH] new compression the commit message is too unclear/unspecific. it should explain what is added and why also it should mention where code is from if its based on some previously existing code > > --- > libavcodec/exr.c | 122 > +++ > 1 file changed, 122 insertions(+) this breaks make fate-exr TESTexr-slice-raw TESTexr-slice-rle TESTexr-slice-zip1 TESTexr-slice-zip16 TESTexr-slice-pxr24 --- ./tests/ref/fate/exr-slice-rle 2015-03-21 12:36:23.469794458 +0100 +++ tests/data/fate/exr-slice-rle 2015-03-22 00:17:20.670680485 +0100 @@ -1,2 +1,2 @@ #tb 0: 1/25 -0, 0, 0,1, 3169800, 0x6a356d0d +0, 0, 0,1, 3169800, 0x Test exr-slice-rle failed. Look at tests/data/fate/exr-slice-rle.err for details. make: *** [fate-exr-slice-rle] Error 1 make: *** Waiting for unfinished jobs you will need the fate samples to run the fate tests see https://ffmpeg.org/fate.html#Using-FATE-from-your-FFmpeg-source-directory [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Let us carefully observe those good qualities wherein our enemies excel us and endeavor to excel them, by avoiding what is faulty, and imitating what is excellent in them. -- Plutarch signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [GSoC] Proof-of-concept HTTP Server
On Sat, Mar 21, 2015 at 11:00:09PM +0100, Stephan Holljes wrote: > Hi, > > this is a patch for a proof-of-concept for an http server. > > Usage on the server side: > > ffmpeg -i test.mp3 -c copy -listen 1 -f mp3 http://0.0.0.0 > > Usage on the client side: > > ffplay http://localhost:8080 > > I looked at tls.c and tcp.c and copied parts of the code. > Please comment. > > Regards, > Stephan Holljes > > --- > libavformat/http.c | 113 > ++-- > 1 file changed, 83 insertions(+), 30 deletions(-) > > diff --git a/libavformat/http.c b/libavformat/http.c > index da3c9be..d61e4e2 100644 > --- a/libavformat/http.c > +++ b/libavformat/http.c > @@ -96,8 +96,12 @@ typedef struct HTTPContext { > int send_expect_100; > char *method; > int reconnect; > +int listen; > +int fd; > +int header_sent; > } HTTPContext; > > + > #define OFFSET(x) offsetof(HTTPContext, x) > #define D AV_OPT_FLAG_DECODING_PARAM > #define E AV_OPT_FLAG_ENCODING_PARAM > @@ -127,6 +131,7 @@ static const AVOption options[] = { > { "end_offset", "try to limit the request to bytes preceding this > offset", OFFSET(end_off), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, D > }, > { "method", "Override the HTTP method", OFFSET(method), > AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E }, > { "reconnect", "auto reconnect after disconnect before EOF", > OFFSET(reconnect), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, D }, > +{ "listen", "listen on HTTP", OFFSET(listen), AV_OPT_TYPE_INT, { .i64 > = 0 }, 0, 1, D }, it appears this patch has been corrupted by extra newlines from word/line wrap please resend as an attachment [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Breaking DRM is a little like attempting to break through a door even though the window is wide open and the only thing in the house is a bunch of things you dont want and which you would get tomorrow for free anyway signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [GSoC] Proof-of-concept HTTP Server
Hi, what would be the correct way to create patches that won't be corrupted? I merely tried to copy what I have seen on the mailing-list before, apparently I didn't do a very good job ;) Regards, Stephan Holljes On Sun, Mar 22, 2015 at 12:24 AM, Michael Niedermayer wrote: > On Sat, Mar 21, 2015 at 11:00:09PM +0100, Stephan Holljes wrote: > > Hi, > > > > this is a patch for a proof-of-concept for an http server. > > > > Usage on the server side: > > > > ffmpeg -i test.mp3 -c copy -listen 1 -f mp3 http://0.0.0.0 > > > > Usage on the client side: > > > > ffplay http://localhost:8080 > > > > I looked at tls.c and tcp.c and copied parts of the code. > > Please comment. > > > > Regards, > > Stephan Holljes > > > > --- > > libavformat/http.c | 113 > > ++-- > > 1 file changed, 83 insertions(+), 30 deletions(-) > > > > diff --git a/libavformat/http.c b/libavformat/http.c > > index da3c9be..d61e4e2 100644 > > --- a/libavformat/http.c > > +++ b/libavformat/http.c > > @@ -96,8 +96,12 @@ typedef struct HTTPContext { > > int send_expect_100; > > char *method; > > int reconnect; > > +int listen; > > +int fd; > > +int header_sent; > > } HTTPContext; > > > > + > > #define OFFSET(x) offsetof(HTTPContext, x) > > #define D AV_OPT_FLAG_DECODING_PARAM > > #define E AV_OPT_FLAG_ENCODING_PARAM > > @@ -127,6 +131,7 @@ static const AVOption options[] = { > > { "end_offset", "try to limit the request to bytes preceding this > > offset", OFFSET(end_off), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, > D > > }, > > { "method", "Override the HTTP method", OFFSET(method), > > AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E }, > > { "reconnect", "auto reconnect after disconnect before EOF", > > OFFSET(reconnect), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, D }, > > +{ "listen", "listen on HTTP", OFFSET(listen), AV_OPT_TYPE_INT, { > .i64 > > = 0 }, 0, 1, D }, > > it appears this patch has been corrupted by extra newlines from > word/line wrap > > please resend as an attachment > > [...] > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > Breaking DRM is a little like attempting to break through a door even > though the window is wide open and the only thing in the house is a bunch > of things you dont want and which you would get tomorrow for free anyway > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > diff --git a/libavformat/http.c b/libavformat/http.c index da3c9be..d61e4e2 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -96,8 +96,12 @@ typedef struct HTTPContext { int send_expect_100; char *method; int reconnect; +int listen; +int fd; +int header_sent; } HTTPContext; + #define OFFSET(x) offsetof(HTTPContext, x) #define D AV_OPT_FLAG_DECODING_PARAM #define E AV_OPT_FLAG_ENCODING_PARAM @@ -127,6 +131,7 @@ static const AVOption options[] = { { "end_offset", "try to limit the request to bytes preceding this offset", OFFSET(end_off), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, D }, { "method", "Override the HTTP method", OFFSET(method), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E }, { "reconnect", "auto reconnect after disconnect before EOF", OFFSET(reconnect), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, D }, +{ "listen", "listen on HTTP", OFFSET(listen), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, D }, { NULL } }; @@ -299,8 +304,10 @@ int ff_http_averror(int status_code, int default_averror) static int http_open(URLContext *h, const char *uri, int flags, AVDictionary **options) { +struct addrinfo hints = { 0 }, *ai; HTTPContext *s = h->priv_data; -int ret; +int ret = -1, fd; +char portstr[] = "8080"; // allow non-root users for now if( s->seekable == 1 ) h->is_streamed = 0; @@ -320,11 +327,39 @@ static int http_open(URLContext *h, const char *uri, int flags, av_log(h, AV_LOG_WARNING, "No trailing CRLF found in HTTP header.\n"); } +if (s->listen) { +hints.ai_family = AF_UNSPEC; +hints.ai_socktype = SOCK_STREAM; +hints.ai_flags |= AI_PASSIVE; +ret = getaddrinfo(NULL, portstr, &hints, &ai); +if (ret) { +av_log(h, AV_LOG_ERROR, "borked"); +return AVERROR(EIO); +} +fd = ff_socket(ai->ai_family, + ai->ai_socktype, + ai->ai_protocol); +if (fd < 0) { +ret = ff_neterrno(); +freeaddrinfo(ai); +return -1; +} -ret = http_open_cnx(h, options); -if (ret < 0) -av_dict_free(&s->chained_options); -return ret; +fd = ff_listen_bind(fd, ai->ai_addr, ai->ai_addrlen, -1, h); +if (fd < 0) { +freeaddrinfo(ai); +return fd; +}
[FFmpeg-devel] [PATCH 2/2] libavformat/mxfenc: add support for muxing mxf opatom audio
--- libavformat/mxfenc.c | 100 ++- 1 file changed, 83 insertions(+), 17 deletions(-) diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index ac60357..7483ddc 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -313,6 +313,7 @@ typedef struct MXFContext { uint8_t umid[16];///< unique material identifier int channel_count; uint32_t tagged_value_count; +AVRational audio_timecode_rate; } MXFContext; static const uint8_t uuid_base[]= { 0xAD,0xAB,0x44,0x24,0x2f,0x25,0x4d,0xc7,0x92,0xff,0x29,0xbd }; @@ -780,8 +781,14 @@ static void mxf_write_track(AVFormatContext *s, AVStream *st, enum MXFMetadataSe avio_write(pb, sc->track_essence_element_key + 12, 4); mxf_write_local_tag(pb, 8, 0x4B01); -avio_wb32(pb, mxf->time_base.den); -avio_wb32(pb, mxf->time_base.num); + +if (st == mxf->timecode_track && s->oformat == &ff_mxf_opatom_muxer){ +avio_wb32(pb, mxf->tc.rate.num); +avio_wb32(pb, mxf->tc.rate.den); +} else { +avio_wb32(pb, mxf->time_base.den); +avio_wb32(pb, mxf->time_base.num); +} // write origin mxf_write_local_tag(pb, 8, 0x4B02); @@ -810,7 +817,10 @@ static void mxf_write_common_fields(AVFormatContext *s, AVStream *st) // write duration mxf_write_local_tag(pb, 8, 0x0202); -avio_wb64(pb, mxf->duration); +if (st != mxf->timecode_track && s->oformat == &ff_mxf_opatom_muxer && st->codec->codec_type == AVMEDIA_TYPE_AUDIO) +avio_wb64(pb, mxf->body_offset / mxf->edit_unit_byte_count); +else +avio_wb64(pb, mxf->duration); } static void mxf_write_sequence(AVFormatContext *s, AVStream *st, enum MXFMetadataSetType type) @@ -1085,8 +1095,17 @@ static void mxf_write_generic_sound_common(AVFormatContext *s, AVStream *st, con AVIOContext *pb = s->pb; MXFContext *mxf = s->priv_data; int show_warnings = !mxf->footer_partition_offset; +int duration_size = 0; + +if (s->oformat == &ff_mxf_opatom_muxer) +duration_size = 12; -mxf_write_generic_desc(s, st, key, size+5+12+8+8); +mxf_write_generic_desc(s, st, key, size+duration_size+5+12+8+8); + +if (duration_size > 0){ +mxf_write_local_tag(pb, 8, 0x3002); +avio_wb64(pb, mxf->body_offset / mxf->edit_unit_byte_count); +} // audio locked mxf_write_local_tag(pb, 1, 0x3D02); @@ -1109,7 +1128,7 @@ static void mxf_write_generic_sound_common(AVFormatContext *s, AVStream *st, con av_log(s, AV_LOG_WARNING, "d10_channelcount shall be set to 4 or 8 : the output will not comply to MXF D-10 specs\n"); avio_wb32(pb, mxf->channel_count); } else { -if (show_warnings && mxf->channel_count != -1) +if (show_warnings && mxf->channel_count != -1 && s->oformat != &ff_mxf_opatom_muxer) av_log(s, AV_LOG_ERROR, "-d10_channelcount requires MXF D-10 and will be ignored\n"); avio_wb32(pb, st->codec->channels); } @@ -1958,6 +1977,19 @@ static void mxf_gen_umid(AVFormatContext *s) mxf->instance_number = seed & 0xFF; } +static int mxf_init_timecode(AVFormatContext *s, AVStream *st, AVRational rate) +{ +MXFContext *mxf = s->priv_data; +AVDictionaryEntry *tcr = av_dict_get(s->metadata, "timecode", NULL, 0); +if (!tcr) +tcr = av_dict_get(st->metadata, "timecode", NULL, 0); + +if (tcr) +return av_timecode_init_from_string(&mxf->tc, rate, tcr->value, s); +else +return av_timecode_init(&mxf->tc, rate, 0, 0, s); +} + static int mxf_write_header(AVFormatContext *s) { MXFContext *mxf = s->priv_data; @@ -1966,7 +1998,6 @@ static int mxf_write_header(AVFormatContext *s) const MXFSamplesPerFrame *spf = NULL; AVDictionaryEntry *t; int64_t timestamp = 0; -AVDictionaryEntry *tcr = av_dict_get(s->metadata, "timecode", NULL, 0); if (!s->nb_streams) return -1; @@ -1983,7 +2014,7 @@ static int mxf_write_header(AVFormatContext *s) return AVERROR(ENOMEM); st->priv_data = sc; -if ((i == 0) ^ (st->codec->codec_type == AVMEDIA_TYPE_VIDEO)) { +if (((i == 0) ^ (st->codec->codec_type == AVMEDIA_TYPE_VIDEO)) && s->oformat != &ff_mxf_opatom_muxer) { av_log(s, AV_LOG_ERROR, "there must be exactly one video stream and it must be the first one\n"); return -1; } @@ -2003,14 +2034,9 @@ static int mxf_write_header(AVFormatContext *s) mxf->time_base = spf->time_base; rate = av_inv_q(mxf->time_base); avpriv_set_pts_info(st, 64, mxf->time_base.num, mxf->time_base.den); -if (!tcr) -tcr = av_dict_get(st->metadata, "timecode", NULL, 0); -if (tcr) -ret = av_timecode_init_from_string(&mxf->tc, rate, tcr->value, s); -else -ret = av_timecode_init(&mxf->tc, rate, 0, 0, s); -
[FFmpeg-devel] [PATCH 1/2] libavformat/mxfenc: add container duration and package name to primer pack
--- libavformat/mxfenc.c | 2 ++ tests/ref/lavf/mxf | 6 ++--- tests/ref/lavf/mxf_d10 | 2 +- tests/ref/lavf/mxf_opatom | 4 ++-- tests/ref/seek/lavf-mxf_opatom | 54 +- 5 files changed, 35 insertions(+), 33 deletions(-) diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 0349e5d..ac60357 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -368,6 +368,7 @@ static const MXFLocalTagPair mxf_local_tag_batch[] = { { 0x4401, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x01,0x01,0x15,0x10,0x00,0x00,0x00,0x00}}, /* Package UID */ { 0x4405, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x10,0x01,0x03,0x00,0x00}}, /* Package Creation Date */ { 0x4404, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x10,0x02,0x05,0x00,0x00}}, /* Package Modified Date */ +{ 0x4402, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x01,0x03,0x03,0x02,0x01,0x00,0x00,0x00}}, /* Package Name */ { 0x4403, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x06,0x05,0x00,0x00}}, /* Tracks Strong reference array */ { 0x4406, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x03,0x02,0x01,0x02,0x0C,0x00,0x00,0x00}}, /* User Comments */ { 0x4701, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x02,0x03,0x00,0x00}}, /* Descriptor */ @@ -396,6 +397,7 @@ static const MXFLocalTagPair mxf_local_tag_batch[] = { { 0x3F01, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x06,0x01,0x01,0x04,0x06,0x0B,0x00,0x00}}, /* Sub Descriptors reference array */ { 0x3006, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x06,0x01,0x01,0x03,0x05,0x00,0x00,0x00}}, /* Linked Track ID */ { 0x3001, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x06,0x01,0x01,0x00,0x00,0x00,0x00}}, /* SampleRate */ +{ 0x3002, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x06,0x01,0x02,0x00,0x00,0x00,0x00}}, /* ContainerDuration */ { 0x3004, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x01,0x02,0x00,0x00}}, /* Essence Container */ // Generic Picture Essence Descriptor { 0x320C, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x03,0x01,0x04,0x00,0x00,0x00}}, /* Frame Layout */ diff --git a/tests/ref/lavf/mxf b/tests/ref/lavf/mxf index 71d8649..8ead434 100644 --- a/tests/ref/lavf/mxf +++ b/tests/ref/lavf/mxf @@ -1,9 +1,9 @@ -57d6a4992ab92f4c2c9385803962f466 *./tests/data/lavf/lavf.mxf +306708cc2ad2414def89fa2f3c0bfc5c *./tests/data/lavf/lavf.mxf 525369 ./tests/data/lavf/lavf.mxf ./tests/data/lavf/lavf.mxf CRC=0xdbfff6f1 -0d04b523972648406e506b26fbd63d23 *./tests/data/lavf/lavf.mxf +f465084f0c365926a81aab56fb6b945c *./tests/data/lavf/lavf.mxf 560697 ./tests/data/lavf/lavf.mxf ./tests/data/lavf/lavf.mxf CRC=0x11a6178e -10f4607a8db351854f3aeb3b1f2c89f9 *./tests/data/lavf/lavf.mxf +52fc707e1177c97232e2537168c232e6 *./tests/data/lavf/lavf.mxf 525369 ./tests/data/lavf/lavf.mxf ./tests/data/lavf/lavf.mxf CRC=0xdbfff6f1 diff --git a/tests/ref/lavf/mxf_d10 b/tests/ref/lavf/mxf_d10 index e920517..71707ca 100644 --- a/tests/ref/lavf/mxf_d10 +++ b/tests/ref/lavf/mxf_d10 @@ -1,3 +1,3 @@ -6ac315755a974f38796a90c80ac6737b *./tests/data/lavf/lavf.mxf_d10 +8f601d5b55a0665cc105a115dc8b3af0 *./tests/data/lavf/lavf.mxf_d10 5330989 ./tests/data/lavf/lavf.mxf_d10 ./tests/data/lavf/lavf.mxf_d10 CRC=0x6c74d488 diff --git a/tests/ref/lavf/mxf_opatom b/tests/ref/lavf/mxf_opatom index 453efc7..5529e5b 100644 --- a/tests/ref/lavf/mxf_opatom +++ b/tests/ref/lavf/mxf_opatom @@ -1,3 +1,3 @@ -e1264a5d716f1289473689b5a1245809 *./tests/data/lavf/lavf.mxf_opatom -4716601 ./tests/data/lavf/lavf.mxf_opatom +0f753a141424e2a1b44e6390f70172eb *./tests/data/lavf/lavf.mxf_opatom +4717113 ./tests/data/lavf/lavf.mxf_opatom ./tests/data/lavf/lavf.mxf_opatom CRC=0xbdd696b9 diff --git a/tests/ref/seek/lavf-mxf_opatom b/tests/ref/seek/lavf-mxf_opatom index db0d6a6..ca17ba7 100644 --- a/tests/ref/seek/lavf-mxf_opatom +++ b/tests/ref/seek/lavf-mxf_opatom @@ -1,53 +1,53 @@ -ret: 0 st: 0 flags:1 dts: 0.00 pts: 0.00 pos: 4633 size:188416 +ret: 0 st: 0 flags:1 dts: 0.00 pts: 0.00 pos: 5145 size:188416 ret: 0 st:-1 flags:0 ts:-1.00 -ret: 0 st: 0 flags:1 dts: 0.00 pts: 0.00 pos: 4633 size:188416 +ret: 0 st: 0 flags:1 dts: 0.00 pts: 0.00 pos: 5145 size:188416 ret: 0 st:-1 flags:1 ts: 1.894167 -ret: 0 st: 0 flags:1 dts: 0.96 pts: 0.96 pos:4526617 size:188416 +ret: 0 st: 0 flags:1 dts: 0.96 pts: 0.96 pos:4527129 size:188416 ret: 0 st: 0 flags:0 ts: 0.80 -ret: 0 st: 0 flags:1 dts: 0.80 pts: 0.80 pos:3772953 size:188416 +ret: 0 st: 0 flags:1 dts: 0.80 pts: 0.80 pos:3773465 size:188416 ret: 0 st: 0 flags:1 ts:-0.32 -ret: 0 st: 0 flags:1 dts: 0.00 pts: 0.00 pos: 4633 size:188416 +ret: 0 st: 0 flags:
[FFmpeg-devel] [PATCH 0/2] libavformat/mxfenc: add support for muxing mxf opatom audio
Hi, This patch series adds support for muxing mxf opatom audio files. The media generate is compatible with avid media composer, in my tests. The patches only adds support single channel 48kHz pcm_16/24le. Media composer also supports 32kHz and 44.1kHz, which I plan to add in a future patch. I’m still sorting out how multi channel works, media composer seems to always split the each channel to a separate file. I split it into 2 patches to make sure I didn’t break the other mxf formats. The first patch added the necessary tags to the primer pack, which require the tests to be updated. I also noticed the package_name tag was missing so I also took the opportunity to add it as well. example usage: ffmpeg -f lavfi -i "sine=frequency=1000:sample_rate=48000:duration=5" -f mxf_opatom out.mxf example with 23.97 timecode ffmpeg -f lavfi -i "sine=frequency=1000:sample_rate=48000:duration=5" -timecode "01:23:45:12" -mxf_audio_tcr 23.97 -f mxf_opatom out.mxf OPAtom can only contain a single stream of data. To get timecode to work mxf needs a video rate. Since there is no video stream to choose timecode rate from, a way is needed to determine what the timecode rate is. to get this to work I added a -mxf_audio_tcr option. If not supplied ffmpeg defaults to a timecode rate of 25fps. Mark Reid (2): libavformat/mxfenc: add container duration and package name to primer pack libavformat/mxfenc: add support for muxing mxf opatom audio libavformat/mxfenc.c | 102 ++--- tests/ref/lavf/mxf | 6 +-- tests/ref/lavf/mxf_d10 | 2 +- tests/ref/lavf/mxf_opatom | 4 +- tests/ref/seek/lavf-mxf_opatom | 54 +++--- 5 files changed, 118 insertions(+), 50 deletions(-) -- 2.2.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [GSoC] Proof-of-concept HTTP Server
On Sun, Mar 22, 2015 at 12:33:57AM +0100, Stephan Holljes wrote: > Hi, > > what would be the correct way to create patches that won't be corrupted? I > merely tried to copy what I have seen on the mailing-list before, > apparently I didn't do a very good job ;) git send-email -1 would send the most recent commit on the current branch, see the manual for exact usage or git format-patch -1 would create the git patch that can be attached about the patch itself i tried it with wget and firefox it seems to work but firefox failed to detect it as mp3, i guess some content type is missing [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [GSoC] Proof-of-concept HTTP Server
On Sun, Mar 22, 2015 at 2:34 AM, Michael Niedermayer wrote: > On Sun, Mar 22, 2015 at 12:33:57AM +0100, Stephan Holljes wrote: > > Hi, > > > > what would be the correct way to create patches that won't be corrupted? > I > > merely tried to copy what I have seen on the mailing-list before, > > apparently I didn't do a very good job ;) > > git send-email -1 > would send the most recent commit on the current branch, see the > manual for exact usage > > or > > git format-patch -1 > would create the git patch that can be attached > > about the patch itself i tried it with wget and firefox it seems to > work but firefox failed to detect it as mp3, i guess some content type > is missing > That would be my guess, too. I will look into that. > > [...] > > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] GSoC project proposal + qualification task
On 21.03.2015 19:01, wm4 wrote: On Fri, 20 Mar 2015 02:51:31 +0100 Mariusz Szczepańczyk wrote: Hello, my name is Mariusz Szczepańczyk and I am currently finishing my bachelor's degree in Computer Science at the University of Warsaw in Poland. I have written few patches for other open source projects, like gif reading plugin for OpenImageIO, however I'm new to FFmpeg. I'd like to work on the "Browsing content on the server" task as described on wiki extended by samba and possibly local zip archives if it gets a good reception. And maybe having rename and delete methods also could be nice. I reached out to Lukasz Marek, who is listed as backup mentor and he pointed me to his last year's patches that add directory listing api and implement some of the protocols. In a couple of minutes I'll send these patches rebased against current master plus my take on samba protocol. Any comments and ideas are appreciated. If the patches you posted (and which are not even your work, just rebased older patches from someone else) are the qualification task, then what's left for the "real" project work? Qualification task it to implement one protocol using provided API, so I don't understand your complaining as this requirement is met. "Real" project work is to implement this feature for HTTP (which is not standardized as far is i know) and for FTP LIST command fallback (which is not standardized neither), and handle some rare cases I surly didn't included in my patches. Also you may refer my previous mails about extending this project as some *easy* work is already done. Just comment from me; for people who participate in ffmpeg for some time, your comment is just like your comments are (rude, demotivating, and ofter useless), but for students who supposed to have some help and support here, your comment is just stupid. If you think this project is stupid, then you should've removed it from the project list before someone involved into it. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] Patches For 2.6 Branch
Hi, I had some code accepted on the master branch and I was wondering if they'd be suitable for inclusion in the 2.6 branch. I'd like them in the next version of xmbc. The commits were: c59654d67d1afde3fac24021ef0fd9d18cf38455 fca085187940a169b7a43d096009f7dac315f9ac 7859618affe574c9de7f240d2ddc016f917c37bd Assuming they make sense (I'd view them as fixes, not features), do I just merge them into the 2.6 branch and resubmit? -- "The mark of an immature man is that he wants to die nobly for a cause, while the mark of the mature man is that he wants to live humbly for one." --W. Stekel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel