#5976 closed defect (fixed)
flv encoding for live stream no longer usable
Reported by: | jyavenard | Owned by: | Steven Liu |
---|---|---|---|
Priority: | important | Component: | avformat |
Version: | git-master | Keywords: | flv regression |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
How to reproduce:
% ffmpeg -i input ... output ffmpeg version built on ...
Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.
http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=5702416c57afb2bb062eb69d60fc42c31c91b674
introduced a regression.
If the stream isn't seekable, it no longer update the duration / file size.
This assumed that the file size / duration could only be determined by seeking to the end of the file.
But this is an invalid assumption. Continuously reading the stream will automatically update the value returned by ftell. From that we can deduct what the new duration and file size is.
This introduced a mythtv regression https://code.mythtv.org/trac/ticket/12936
This commit should be reverted, or modified so that it can still attempt to estimate the current filesize/duration even when the stream isn't seekable.
Change History (10)
comment:1 by , 8 years ago
Component: | undetermined → avformat |
---|---|
Version: | unspecified → git-master |
comment:2 by , 8 years ago
comment:3 by , 8 years ago
Owner: | set to |
---|---|
Status: | new → open |
comment:4 by , 8 years ago
Owner: | set to |
---|---|
Status: | new → open |
comment:5 by , 8 years ago
I have sent a new patch to maillist, you can try it.
[PATCH] avformat/flvenc: fix ticket 5976 and use old commit
follow-up: 7 comment:6 by , 8 years ago
Thank you for the quick fix.
So by default, the old behavior is back.
@@ -844,7 +846,7 @@ end: avio_seek(pb, flv->datasize_offset, SEEK_SET); put_amf_double(pb, flv->datasize); } - if (pb->seekable) { + if (!(flv->flags & FLV_NO_DURATION_FILESIZE)) { /* update information */
why not use if (write_duration_filesize) ?
comment:7 by , 8 years ago
Replying to jyavenard:
Thank you for the quick fix.
So by default, the old behavior is back.
@@ -844,7 +846,7 @@ end: avio_seek(pb, flv->datasize_offset, SEEK_SET); put_amf_double(pb, flv->datasize); } - if (pb->seekable) { + if (!(flv->flags & FLV_NO_DURATION_FILESIZE)) { /* update information */why not use if (write_duration_filesize) ?
Because this is in flv_write_trailer and only be used once, so don't need use other variable to make it simple.
comment:8 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | open → closed |
fixed in: ee24c8ad011272ffd1a6daaf3f0128ace8663c18
comment:10 by , 8 years ago
Keywords: | flv regression added |
---|---|
Priority: | normal → important |
If the rtmp isn't seekable, ffmpeg cannot update the metadata. and ffmpeg will give you a warning message,
there have many flv living stream have no metadata, then the server will modify, add or fix it.
of course, if you think non-seekable don't update(NOT no) duration and filesize is a better way, i think ffmpeg need a patch to add option for choose by users, because there have many server and player reading the duration and filesize first, if no the duration and filesize use stream mode. when the filesize and duration error when it is 0, That's a fetal error.