r13969 - trunk/libavformat/utils.c
Author: michael Date: Wed Jun 25 20:15:04 2008 New Revision: 13969 Log: We cannot calculate the duration of vorbis packets even if we do know the "minimal" frame_size. Modified: trunk/libavformat/utils.c Modified: trunk/libavformat/utils.c ============================================================================== --- trunk/libavformat/utils.c (original) +++ trunk/libavformat/utils.c Wed Jun 25 20:15:04 2008 @@ -538,12 +538,12 @@ static int get_audio_frame_size(AVCodecC { int frame_size; + if(enc->codec_id == CODEC_ID_VORBIS) + return -1; + if (enc->frame_size <= 1) { int bits_per_sample = av_get_bits_per_sample(enc->codec_id); - if(enc->codec_id == CODEC_ID_VORBIS) - return -1; - if (bits_per_sample) { if (enc->channels == 0) return -1;
Hi Michael, michael wrote:
Author: michael Date: Wed Jun 25 20:15:04 2008 New Revision: 13969
Log: We cannot calculate the duration of vorbis packets even if we do know the "minimal" frame_size.
I dunno why yet, but this broke our ogg with vorbis, ffplay play them very slowly, vlc stop playing them. ffmpeg -i <file> -vcodec vorbis test.ogg av_write_frame: pts2:0 dts2:0 [vorbis @ 0x85a4450]av_write_frame: pts:-9223372036854775808 dts:-9223372036854775808 cur_dts:0 b:0 size:207 st:0 av_write_frame: pts2:0 dts2:0 [vorbis @ 0x85a4450]av_write_frame: pts:-9223372036854775808 dts:-9223372036854775808 cur_dts:0 b:0 size:219 st:0 av_write_frame: pts2:0 dts2:0 [vorbis @ 0x85a4450]av_write_frame: pts:-9223372036854775808 dts:-9223372036854775808 cur_dts:0 b:0 size:213 st:0 av_write_frame: pts2:0 dts2:0 [vorbis @ 0x85a4450]av_write_frame: pts:-9223372036854775808 dts:-9223372036854775808 cur_dts:0 b:0 size:223 st:0 av_write_frame: pts2:0 dts2:0 [vorbis @ 0x85a4450]av_write_frame: pts:-9223372036854775808 dts:-9223372036854775808 cur_dts:0 b:0 size:235 st:0 av_write_frame: pts2:0 dts2:0 [vorbis @ 0x85a4450]av_write_frame: pts:-9223372036854775808 dts:-9223372036854775808 cur_dts:0 b:0 size:245 st:0 av_write_frame: pts2:0 dts2:0 It seems pts nor dts are set anymore. Before: [vorbis @ 0x85a4490]av_write_frame: pts:-9223372036854775808 dts:-9223372036854775808 cur_dts:319488 b:0 size:226 st:0 av_write_frame: pts2:320512 dts2:320512 [vorbis @ 0x85a4490]av_write_frame: pts:-9223372036854775808 dts:-9223372036854775808 cur_dts:320512 b:0 size:206 st:0 av_write_frame: pts2:321536 dts2:321536 [vorbis @ 0x85a4490]av_write_frame: pts:-9223372036854775808 dts:-9223372036854775808 cur_dts:321536 b:0 size:227 st:0 av_write_frame: pts2:322560 dts2:322560 [vorbis @ 0x85a4490]av_write_frame: pts:-9223372036854775808 dts:-9223372036854775808 cur_dts:322560 b:0 size:227 st:0 av_write_frame: pts2:323584 dts2:323584 [vorbis @ 0x85a4490]av_write_frame: pts:-9223372036854775808 dts:-9223372036854775808 cur_dts:323584 b:0 size:240 st:0 av_write_frame: pts2:324608 dts2:324608 [vorbis @ 0x85a4490]av_write_frame: pts:-9223372036854775808 dts:-9223372036854775808 cur_dts:324608 b:0 size:229 st:0 [...] -- Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA Smartjog USA Inc. http://www.smartjog.com Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
On Fri, Jun 27, 2008 at 11:57:56AM -0700, Baptiste Coudurier wrote:
Hi Michael,
michael wrote:
Author: michael Date: Wed Jun 25 20:15:04 2008 New Revision: 13969
Log: We cannot calculate the duration of vorbis packets even if we do know the "minimal" frame_size.
I dunno why yet, but this broke our ogg with vorbis, ffplay play them very slowly, vlc stop playing them.
ffmpeg -i <file> -vcodec vorbis test.ogg
Please provide the sample, the ogg vorbis i tried works fine here. [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I am the wisest man alive, for I know one thing, and that is that I know nothing. -- Socrates
2008/6/28 Michael Niedermayer <michaelni at gmx.at>:
On Fri, Jun 27, 2008 at 11:57:56AM -0700, Baptiste Coudurier wrote:
Hi Michael,
michael wrote:
Author: michael Date: Wed Jun 25 20:15:04 2008 New Revision: 13969
Log: We cannot calculate the duration of vorbis packets even if we do know the "minimal" frame_size.
I dunno why yet, but this broke our ogg with vorbis, ffplay play them very slowly, vlc stop playing them.
ffmpeg -i <file> -vcodec vorbis test.ogg
Please provide the sample, the ogg vorbis i tried works fine here.
Someone in #ffmpeg was complaining that when using vorbis + theora in ogg, before this commit it worked in various players (VLC included, I don't remember the others though he said the behaviour was consistent across them) but after this commit the players wouldn't play any video, only audio. I'll try to get a sample command line which allows the issue to be reproduced. Rob
Hi, Robert Swain wrote:
2008/6/28 Michael Niedermayer <michaelni at gmx.at>:
On Fri, Jun 27, 2008 at 11:57:56AM -0700, Baptiste Coudurier wrote:
Hi Michael,
michael wrote:
Author: michael Date: Wed Jun 25 20:15:04 2008 New Revision: 13969
Log: We cannot calculate the duration of vorbis packets even if we do know the "minimal" frame_size. I dunno why yet, but this broke our ogg with vorbis, ffplay play them very slowly, vlc stop playing them.
ffmpeg -i <file> -vcodec vorbis test.ogg Please provide the sample, the ogg vorbis i tried works fine here.
Someone in #ffmpeg was complaining that when using vorbis + theora in ogg, before this commit it worked in various players (VLC included, I don't remember the others though he said the behaviour was consistent across them) but after this commit the players wouldn't play any video, only audio. I'll try to get a sample command line which allows the issue to be reproduced.
It works fine with ffplay, yes. Vlc does not play the file however. I generated ogg file using: ffmpeg -i source_nots.mp2 -acodec vorbis nots.ogg Both mp2 and ogg files are on mplayerhq/incoming [ogg @ 0x859faf4]av_read_packet stream=0, pts=0, dts=-9223372036854775808, size=112, flags=0 [ogg @ 0x859faf4]av_read_frame_internal stream=0, pts=0, dts=0, size=112, flags=1 Input #0, ogg, from 'nots.ogg': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0.0, 1/48000: Audio: vorbis, 48000 Hz, stereo Output #0, null, to '/dev/null': Stream #0.0, 1/90000: Audio: pcm_s16le, 48000 Hz, stereo, 1536 kb/s Stream mapping: Stream #0.0 -> #0.0 Press [q] to stop encoding [ogg @ 0x859faf4]av_read_packet stream=0, pts=0, dts=-9223372036854775808, size=108, flags=0 [ogg @ 0x859faf4]av_read_frame_internal stream=0, pts=0, dts=0, size=108, flags=1 [ogg @ 0x859faf4]av_read_packet stream=0, pts=0, dts=-9223372036854775808, size=171, flags=0 [ogg @ 0x859faf4]av_read_frame_internal stream=0, pts=0, dts=0, size=171, flags=1 [ogg @ 0x859faf4]av_read_packet stream=0, pts=0, dts=-9223372036854775808, size=153, flags=0 [ogg @ 0x859faf4]av_read_frame_internal stream=0, pts=0, dts=0, size=153, flags=1 [ogg @ 0x859faf4]av_read_packet stream=0, pts=0, dts=-9223372036854775808, size=191, flags=0 [ogg @ 0x859faf4]av_read_frame_internal stream=0, pts=0, dts=0, size=191, flags=1 Seems all packet have dts 0. -- Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA Smartjog USA Inc. http://www.smartjog.com Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
On Sat, Jun 28, 2008 at 06:37:55PM -0700, Baptiste Coudurier wrote:
Hi,
Robert Swain wrote:
2008/6/28 Michael Niedermayer <michaelni at gmx.at>:
On Fri, Jun 27, 2008 at 11:57:56AM -0700, Baptiste Coudurier wrote:
Hi Michael,
michael wrote:
Author: michael Date: Wed Jun 25 20:15:04 2008 New Revision: 13969
Log: We cannot calculate the duration of vorbis packets even if we do know the "minimal" frame_size. I dunno why yet, but this broke our ogg with vorbis, ffplay play them very slowly, vlc stop playing them.
ffmpeg -i <file> -vcodec vorbis test.ogg Please provide the sample, the ogg vorbis i tried works fine here.
Someone in #ffmpeg was complaining that when using vorbis + theora in ogg, before this commit it worked in various players (VLC included, I don't remember the others though he said the behaviour was consistent across them) but after this commit the players wouldn't play any video, only audio. I'll try to get a sample command line which allows the issue to be reproduced.
It works fine with ffplay, yes. Vlc does not play the file however.
I generated ogg file using: ffmpeg -i source_nots.mp2 -acodec vorbis nots.ogg
Both mp2 and ogg files are on mplayerhq/incoming
[ogg @ 0x859faf4]av_read_packet stream=0, pts=0, dts=-9223372036854775808, size=112, flags=0 [ogg @ 0x859faf4]av_read_frame_internal stream=0, pts=0, dts=0, size=112, flags=1 Input #0, ogg, from 'nots.ogg': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0.0, 1/48000: Audio: vorbis, 48000 Hz, stereo Output #0, null, to '/dev/null': Stream #0.0, 1/90000: Audio: pcm_s16le, 48000 Hz, stereo, 1536 kb/s Stream mapping: Stream #0.0 -> #0.0 Press [q] to stop encoding [ogg @ 0x859faf4]av_read_packet stream=0, pts=0, dts=-9223372036854775808, size=108, flags=0 [ogg @ 0x859faf4]av_read_frame_internal stream=0, pts=0, dts=0, size=108, flags=1 [ogg @ 0x859faf4]av_read_packet stream=0, pts=0, dts=-9223372036854775808, size=171, flags=0 [ogg @ 0x859faf4]av_read_frame_internal stream=0, pts=0, dts=0, size=171, flags=1 [ogg @ 0x859faf4]av_read_packet stream=0, pts=0, dts=-9223372036854775808, size=153, flags=0 [ogg @ 0x859faf4]av_read_frame_internal stream=0, pts=0, dts=0, size=153, flags=1 [ogg @ 0x859faf4]av_read_packet stream=0, pts=0, dts=-9223372036854775808, size=191, flags=0 [ogg @ 0x859faf4]av_read_frame_internal stream=0, pts=0, dts=0, size=191, flags=1
Seems all packet have dts 0.
yes, i can confirm that It seems our vorbis encoder does not set coded_frame->pts while our libvorbis wraper does. Previously the missing timestamps were filled in by assuming constant bitrate or constant framesize, this was incorrect as neither assumtation is correct for vorbis. Fix is to set coded_frame->pts in vorbis_enc.c ffmpeg.c cannot know the timestamps accurately if the encoder doesnt set them. [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The misfortune of the wise is better than the prosperity of the fool. -- Epicurus
participants (4)
-
baptiste.coudurier@smartjog.com -
michaelni@gmx.at -
robert.swain@gmail.com -
subversion@mplayerhq.hu