Re: [FFmpeg-devel] [PATCH 02/12] avformat/mxfenc: write index delta entry array needed by sony vegas pro 11
On Sun, Oct 14, 2018 at 03:05:38PM -0700, Baptiste Coudurier wrote: > On Sat, Oct 13, 2018 at 7:13 PM Michael Niedermayer > wrote: > > > On Sat, Oct 13, 2018 at 06:24:52PM +0200, Martin Vignali wrote: > > > > > > > > Applied > > > > > > > > > > > Seems like fate-mxf-reel_name doesn't pass after your patchs > > > make fate-mxf-reel_name SAMPLES=fate-suite > > > > this also broke 2 other fate tests: > > make: *** [fate-mxf-reel_name] Error 1 > > make: *** [fate-copy-trac4914] Error 1 > > make: *** [fate-time_base] Error 1 > > > > i would look at it but i just now noticed and i need to go to bed :( > > > > also when testing i needed a "rm tests/data/fate/time_base.out", this seemd > > not to be removed (thats unrelated to the commit i assume, iam just saying > > so noone wastes time debuging a mysterious long standing failure) > > > > Seems like all these tests generate mxf files, which would change after > this patch. > I'm looking and will fix them. ive already pushed a patch to update the tests earlier today [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No snowflake in an avalanche ever feels responsible. -- Voltaire signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 02/12] avformat/mxfenc: write index delta entry array needed by sony vegas pro 11
On Sat, Oct 13, 2018 at 7:13 PM Michael Niedermayer wrote: > On Sat, Oct 13, 2018 at 06:24:52PM +0200, Martin Vignali wrote: > > > > > > Applied > > > > > > > > Seems like fate-mxf-reel_name doesn't pass after your patchs > > make fate-mxf-reel_name SAMPLES=fate-suite > > this also broke 2 other fate tests: > make: *** [fate-mxf-reel_name] Error 1 > make: *** [fate-copy-trac4914] Error 1 > make: *** [fate-time_base] Error 1 > > i would look at it but i just now noticed and i need to go to bed :( > > also when testing i needed a "rm tests/data/fate/time_base.out", this seemd > not to be removed (thats unrelated to the commit i assume, iam just saying > so noone wastes time debuging a mysterious long standing failure) > Seems like all these tests generate mxf files, which would change after this patch. I'm looking and will fix them. -- Baptiste Coudurier ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 02/12] avformat/mxfenc: write index delta entry array needed by sony vegas pro 11
On Sat, Oct 13, 2018 at 06:24:52PM +0200, Martin Vignali wrote: > > > > Applied > > > > > Seems like fate-mxf-reel_name doesn't pass after your patchs > make fate-mxf-reel_name SAMPLES=fate-suite this also broke 2 other fate tests: make: *** [fate-mxf-reel_name] Error 1 make: *** [fate-copy-trac4914] Error 1 make: *** [fate-time_base] Error 1 i would look at it but i just now noticed and i need to go to bed :( also when testing i needed a "rm tests/data/fate/time_base.out", this seemd not to be removed (thats unrelated to the commit i assume, iam just saying so noone wastes time debuging a mysterious long standing failure) [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB During times of universal deceit, telling the truth becomes a revolutionary act. -- George Orwell signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 02/12] avformat/mxfenc: write index delta entry array needed by sony vegas pro 11
> > Applied > > Seems like fate-mxf-reel_name doesn't pass after your patchs make fate-mxf-reel_name SAMPLES=fate-suite Martin ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 02/12] avformat/mxfenc: write index delta entry array needed by sony vegas pro 11
On Fri, Oct 12, 2018 at 12:16 PM Baptiste Coudurier < baptiste.coudur...@gmail.com> wrote: > On Thu, Jul 12, 2018 at 12:44 PM Baptiste Coudurier < > baptiste.coudur...@gmail.com> wrote: > >> Hey Thomas, >> >> On Thu, Jul 12, 2018 at 12:29 PM, Tomas Härdin >> wrote: >> >>> Is this the latest/correct patch series for these things? I saw some >>> other patches conflicted with Marton's work >>> >> >> Yes, the conflicts were on the demuxer side >> > > Will apply. > Applied -- Baptiste Coudurier ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 02/12] avformat/mxfenc: write index delta entry array needed by sony vegas pro 11
On Thu, Jul 12, 2018 at 12:44 PM Baptiste Coudurier < baptiste.coudur...@gmail.com> wrote: > Hey Thomas, > > On Thu, Jul 12, 2018 at 12:29 PM, Tomas Härdin wrote: > >> Is this the latest/correct patch series for these things? I saw some >> other patches conflicted with Marton's work >> > > Yes, the conflicts were on the demuxer side > Will apply. -- Baptiste Coudurier ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 02/12] avformat/mxfenc: write index delta entry array needed by sony vegas pro 11
Hey Thomas, On Thu, Jul 12, 2018 at 12:29 PM, Tomas Härdin wrote: > Is this the latest/correct patch series for these things? I saw some > other patches conflicted with Marton's work > Yes, the conflicts were on the demuxer side -- Baptiste ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 02/12] avformat/mxfenc: write index delta entry array needed by sony vegas pro 11
Is this the latest/correct patch series for these things? I saw some other patches conflicted with Marton's work /Tomas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 02/12] avformat/mxfenc: write index delta entry array needed by sony vegas pro 11
--- libavformat/mxfenc.c| 208 ++-- tests/ref/lavf/mxf | 6 +- tests/ref/lavf/mxf_d10 | 2 +- tests/ref/lavf/mxf_dv25 | 2 +- tests/ref/lavf/mxf_dvcpro50 | 2 +- tests/ref/lavf/mxf_opatom | 2 +- tests/ref/lavf/mxf_opatom_audio | 2 +- 7 files changed, 101 insertions(+), 123 deletions(-) diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index b98d234f03..8c1e38353c 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -93,6 +93,8 @@ typedef struct MXFStreamContext { AVRational aspect_ratio; ///< display aspect ratio int closed_gop; ///< gop is closed, used in mpeg-2 frame parsing int video_bit_rate; +int slice_offset; +int frame_size; ///< frame size in bytes } MXFStreamContext; typedef struct MXFContainerEssenceEntry { @@ -389,6 +391,7 @@ typedef struct MXFContext { AVRational audio_edit_rate; int store_user_comments; int track_instance_count; // used to generate MXFTrack uuids +int cbr_index; ///< use a constant bitrate index } MXFContext; static const uint8_t uuid_base[]= { 0xAD,0xAB,0x44,0x24,0x2f,0x25,0x4d,0xc7,0x92,0xff,0x29,0xbd }; @@ -1696,6 +1699,7 @@ static void mxf_write_index_table_segment(AVFormatContext *s) AVIOContext *pb = s->pb; int i, j, temporal_reordering = 0; int key_index = mxf->last_key_index; +int64_t pos; av_log(s, AV_LOG_DEBUG, "edit units count %d\n", mxf->edit_units_count); @@ -1704,12 +1708,8 @@ static void mxf_write_index_table_segment(AVFormatContext *s) avio_write(pb, index_table_segment_key, 16); -if (mxf->edit_unit_byte_count) { -klv_encode_ber_length(pb, 80); -} else { -klv_encode_ber_length(pb, 85 + 12+(s->nb_streams+1LL)*6 + - 12+mxf->edit_units_count*(11+mxf->slice_count*4LL)); -} +klv_encode_ber4_length(pb, 0); +pos = avio_tell(pb); // instance id mxf_write_local_tag(pb, 16, 0x3C0A); @@ -1743,39 +1743,43 @@ static void mxf_write_index_table_segment(AVFormatContext *s) mxf_write_local_tag(pb, 4, 0x3F07); avio_wb32(pb, 1); -if (!mxf->edit_unit_byte_count) { -// real slice count - 1 -mxf_write_local_tag(pb, 1, 0x3F08); -avio_w8(pb, mxf->slice_count); - -// delta entry array -mxf_write_local_tag(pb, 8 + (s->nb_streams+1)*6, 0x3F09); -avio_wb32(pb, s->nb_streams+1); // num of entries -avio_wb32(pb, 6); // size of one entry -// write system item delta entry -avio_w8(pb, 0); -avio_w8(pb, 0); // slice entry -avio_wb32(pb, 0); // element delta -for (i = 0; i < s->nb_streams; i++) { -AVStream *st = s->streams[i]; -MXFStreamContext *sc = st->priv_data; -avio_w8(pb, sc->temporal_reordering); -if (sc->temporal_reordering) -temporal_reordering = 1; -if (i == 0) { // video track -avio_w8(pb, 0); // slice number -avio_wb32(pb, KAG_SIZE); // system item size including klv fill -} else { // audio track -unsigned audio_frame_size = sc->aic.samples[0]*sc->aic.sample_size; -audio_frame_size += klv_fill_size(audio_frame_size); -avio_w8(pb, 1); -avio_wb32(pb, (i-1)*audio_frame_size); // element delta -} +// real slice count - 1 +mxf_write_local_tag(pb, 1, 0x3F08); +avio_w8(pb, !mxf->edit_unit_byte_count); // only one slice for CBR + +// delta entry array +mxf_write_local_tag(pb, 8 + (s->nb_streams+1)*6, 0x3F09); +avio_wb32(pb, s->nb_streams+1); // num of entries +avio_wb32(pb, 6); // size of one entry +// write system item delta entry +avio_w8(pb, 0); +avio_w8(pb, 0); // slice entry +avio_wb32(pb, 0); // element delta +// write each stream delta entry +for (i = 0; i < s->nb_streams; i++) { +AVStream *st = s->streams[i]; +MXFStreamContext *sc = st->priv_data; +avio_w8(pb, sc->temporal_reordering); +if (sc->temporal_reordering) +temporal_reordering = 1; +if (mxf->edit_unit_byte_count) { +avio_w8(pb, 0); // slice number +avio_wb32(pb, sc->slice_offset); +} else if (i == 0) { // video track +avio_w8(pb, 0); // slice number +avio_wb32(pb, KAG_SIZE); // system item size including klv fill +} else { // audio track +unsigned audio_frame_size = sc->aic.samples[0]*sc->aic.sample_size; +audio_frame_size += klv_fill_size(audio_frame_size); +avio_w8(pb, 1); +avio_wb32(pb, (i-1)*audio_frame_size); // element delta } +} -mxf_write_local_tag(pb, 8 + mxf->edit_units_count*(11+mxf->slice_count*4), 0x3F0A); +if (!mxf->edit_un