Re: [FFmpeg-devel] [PATCH] avformat/movenc: implicitly enable negative CTS offsets for ismv

2018-07-28 Thread Jan Ekström
On Fri, Jul 27, 2018 at 1:30 AM, Michael Niedermayer
 wrote:
> breaks fate
>

fate-lavf-ismv seems to be all about the version identifier (0 is for
uintXX CTS offsets, and 1 is for intXX CTS offsets). F.ex. with the
first file:

diff --git a/old_1st.log b/new_1st.log
index f188075577..5100ff6710 100644
--- a/old_1st.log
+++ b/new_1st.log
@@ -267,7 +267,7 @@
 [trun: Track Fragment Run Box]
 position = 851
 size = 120
-version = 0
+version = 1
 flags = 0x000305
 data-offset-present
 first-sample-flags-present
@@ -350,7 +350,7 @@
 [trun: Track Fragment Run Box]
 position = 143053
 size = 120
-version = 0
+version = 1
 flags = 0x000305
 data-offset-present
 first-sample-flags-present
@@ -433,7 +433,7 @@
 [trun: Track Fragment Run Box]
 position = 284519
 size = 32
-version = 0
+version = 1
 flags = 0x000305
 data-offset-present
 first-sample-flags-present

Will send a new patch with that test updated.

Jan
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/movenc: implicitly enable negative CTS offsets for ismv

2018-07-26 Thread Michael Niedermayer
On Thu, Jul 26, 2018 at 02:51:38AM +0300, Jan Ekström wrote:
> ISMV lacks any sort of edit list support, as well as tfxd is
> effectively the PTS of the fragment for most intents and purposes.
> 
> Thus, if b-frames are requested without negative CTS offsets you
> end up with N frames' worth of delay (tfxd PTS plus the CTS offset
> of the first sample). Negative CTS offsets enable the first sample
> to have CTS=DTS, and thus a/v desync due to b-frame reorder delay
> is avoided.
> ---
>  doc/muxers.texi   | 2 ++
>  libavformat/movenc.c  | 2 +-
>  tests/ref/fate/movenc | 4 ++--
>  3 files changed, 5 insertions(+), 3 deletions(-)

breaks fate

TESTlavf-ismv
--- ./tests/ref/lavf/ismv   2018-07-20 13:20:28.137581113 +0200
+++ tests/data/fate/lavf-ismv   2018-07-27 00:29:48.709348455 +0200
@@ -1,9 +1,9 @@
-a9ccbb4cd1436d222ef4425567b4e03d *./tests/data/lavf/lavf.ismv
+96053075a3f60d271131fe2d0765c267 *./tests/data/lavf/lavf.ismv
 312542 ./tests/data/lavf/lavf.ismv
 ./tests/data/lavf/lavf.ismv CRC=0x9d9a638a
-440d85f9fd5b9f63c2676638782b5c15 *./tests/data/lavf/lavf.ismv
+7022701b4c693bc4ffe1e9f96dd82a02 *./tests/data/lavf/lavf.ismv
 321448 ./tests/data/lavf/lavf.ismv
 ./tests/data/lavf/lavf.ismv CRC=0xe8130120
-a9ccbb4cd1436d222ef4425567b4e03d *./tests/data/lavf/lavf.ismv
+96053075a3f60d271131fe2d0765c267 *./tests/data/lavf/lavf.ismv
 312542 ./tests/data/lavf/lavf.ismv
 ./tests/data/lavf/lavf.ismv CRC=0x9d9a638a
Test lavf-ismv failed. Look at tests/data/fate/lavf-ismv.err for details.
make: *** [fate-lavf-ismv] Error 1

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

You can kill me, but you cannot change the truth.


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avformat/movenc: implicitly enable negative CTS offsets for ismv

2018-07-25 Thread Jan Ekström
ISMV lacks any sort of edit list support, as well as tfxd is
effectively the PTS of the fragment for most intents and purposes.

Thus, if b-frames are requested without negative CTS offsets you
end up with N frames' worth of delay (tfxd PTS plus the CTS offset
of the first sample). Negative CTS offsets enable the first sample
to have CTS=DTS, and thus a/v desync due to b-frame reorder delay
is avoided.
---
 doc/muxers.texi   | 2 ++
 libavformat/movenc.c  | 2 +-
 tests/ref/fate/movenc | 4 ++--
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index 33f1f7bbaf..268c152023 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -1344,6 +1344,8 @@ be negative. This enables the initial sample to have 
DTS/CTS of zero, and
 reduces the need for edit lists for some cases such as video tracks with
 B-frames. Additionally, eases conformance with the DASH-IF interoperability
 guidelines.
+
+This option is implicitly set when writing ismv (Smooth Streaming) files.
 @item -write_prft
 Write producer time reference box (PRFT) with a specified time source for the
 NTP field in the PRFT box. Set value as @samp{wallclock} to specify timesource
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index d530f40cab..14f85eb2a7 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -6049,7 +6049,7 @@ static int mov_init(AVFormatContext *s)
 /* Set other implicit flags immediately */
 if (mov->mode == MODE_ISM)
 mov->flags |= FF_MOV_FLAG_EMPTY_MOOV | FF_MOV_FLAG_SEPARATE_MOOF |
-  FF_MOV_FLAG_FRAGMENT;
+  FF_MOV_FLAG_FRAGMENT | FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS;
 if (mov->flags & FF_MOV_FLAG_DASH)
 mov->flags |= FF_MOV_FLAG_FRAGMENT | FF_MOV_FLAG_EMPTY_MOOV |
   FF_MOV_FLAG_DEFAULT_BASE_MOOF;
diff --git a/tests/ref/fate/movenc b/tests/ref/fate/movenc
index 872796ebce..5e8f324ea3 100644
--- a/tests/ref/fate/movenc
+++ b/tests/ref/fate/movenc
@@ -17,10 +17,10 @@ write_data len 20, time nopts, type header atom ftyp
 write_data len 1171, time nopts, type header atom -
 write_data len 728, time 0, type sync atom moof
 write_data len 828, time nopts, type unknown atom -
-write_data len 728, time 1013106, type sync atom moof
+write_data len 728, time 1046439, type sync atom moof
 write_data len 812, time nopts, type unknown atom -
 write_data len 148, time nopts, type trailer atom -
-1f37c1a8e01651e8bebcd66f00b6a226 4435 ismv
+49bf122c4c732a344ef68b58acd19be5 4435 ismv
 write_data len 36, time nopts, type header atom ftyp
 write_data len 1123, time nopts, type header atom -
 write_data len 796, time 0, type sync atom moof
-- 
2.17.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel