GNOME Bugzilla – Bug 168406
asfdemux always uses 25fps
Last modified: 2005-04-18 09:59:20 UTC
Assuming I have done an mms dump, for example gst-launch-0.8 mmssrc location=mms://213.200.75.252/antenne1$livestream.wma ! filesink location=dump.asf then playback works fine with ffdemux_asf like this: gst-launch-0.8 filesrc location=dump.asf ! ffdemux_asf ! ffdec_wmav2 ! alsasink but with asfdemux, like this: gst-launch-0.8 filesrc location=dump.asf ! asfdemux ! ffdec_wmav2 ! alsasink execution always stops after only 2 Iterations. ==================== Output with ffdemux_asf ==================== FÃHRE Leitung AUS ... GST_STATES(16829) gstelement.c(2825):gst_element_set_state_func:<pipeline0> setting state from NULL to PLAYING GST_STATES(16829) gstelement.c(2825):gst_element_set_state_func:<filesrc0> setting state from NULL to READY GST_STATES(16829) gstelement.c(2825):gst_element_set_state_func:<ffdemux_asf0> setting state from NULL to READY GST_STATES(16829) gstelement.c(2825):gst_element_set_state_func:<filesrc0> setting state from READY to PAUSED filesrc(16829) gstfilesrc.c(771):gst_filesrc_open_file:<filesrc0> opening file file2.dump GST_STATES(16829) gstelement.c(2825):gst_element_set_state_func:<ffdemux_asf0> setting state from READY to PAUSED GST_STATES(16829) gstelement.c(2825):gst_element_set_state_func:<filesrc0> setting state from PAUSED to PLAYING GST_STATES(16829) gstelement.c(2825):gst_element_set_state_func:<ffdemux_asf0> setting state from PAUSED to PLAYING scheduler(16829) gstoptimalscheduler.c(1690):gst_opt_scheduler_state_transition: setting scheduler state to running GST_EVENT(16829) gstevent.c(175):gst_event_new: creating new event type 4: 0x8068248 GST_EVENT(16829) gstevent.c(96):_gst_event_free: freeing event 0x8068248 GST_EVENT(16829) gstevent.c(175):gst_event_new: creating new event type 7: 0x8068248 GST_EVENT(16829) gstevent.c(96):_gst_event_free: freeing event 0x8068248 GST_EVENT(16829) gstevent.c(175):gst_event_new: creating new event type 2: 0x8068248 GST_EVENT(16829) gstevent.c(175):gst_event_new: creating new event type 4: 0x8068190 GST_EVENT(16829) gstevent.c(96):_gst_event_free: freeing event 0x8068190 GST_ELEMENT_PADS(16829) gstelement.c(1175):gst_element_add_pad:<ffdemux_asf0> adding pad 'audio_00' GST_PIPELINE(16829) ./grammar.y(344):gst_parse_found_pad: trying delayed linking ffdemux_asf0:(null) to ffdec_wmav20:(null) GST_ELEMENT_PADS(16829) gstelement.c(1893):gst_element_link_pads_filtered: trying to link element ffdemux_asf0:(any) to element ffdec_wmav20:(any) GST_PADS(16829) gstpad.c(1693):gst_pad_can_link_filtered: trying to link ffdemux_asf0:audio_00 and ffdec_wmav20:sink GST_PADS(16829) gstpad.c(1814):gst_pad_link_filtered: trying to link ffdemux_asf0:audio_00 and ffdec_wmav20:sink scheduler(16829) gstoptimalscheduler.c(2123):gst_opt_scheduler_pad_link: scheduling link between ffdemux_asf0:audio_00 and ffdec_wmav20:sink GST_PADS(16829) gstpad.c(1908):gst_pad_link_filtered: linked ffdemux_asf0:audio_00 and ffdec_wmav20:sink, successful GST_STATES(16829) gstelement.c(2825):gst_element_set_state_func:<ffdec_wmav20> setting state from NULL to PLAYING GST_STATES(16829) gstelement.c(2825):gst_element_set_state_func:<alsasink0> setting state from NULL to PLAYING alsa(16829) gstalsa.c(1581):gst_alsa_open_audio: Opening alsa device "default"... GST_CAPS(16829) gstpad.c(1334):gst_pad_link_call_link_functions:<ffdec_wmav20:src> pad doesn't accept caps audio/x-raw-int, signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16, rate=(int)44100, channels=(int)2 GST_EVENT(16829) gstevent.c(175):gst_event_new: creating new event type 4: 0x8068190 WARN (0x80508f0 - 308127:06:50.692738000) GST_SCHEDULING(16829) gstpad.c(3218):_invent_event: needed to invent a DISCONT 0x8068190 (time 2872391589243000) for ffdemux_asf0:audio_00 => ffdec_wmav20:sink GST_PADS(16829) gstpad.c(4045):gst_pad_event_default_dispatch:<ffdec_wmav20:sink> Sending event 0x8068190 to all internally linked pads GST_CAPS(16829) gstpad.c(1533):gst_pad_try_set_caps:<ffdec_wmav20:src> caps audio/x-raw-int, rate=(int)32000, channels=(int)2, signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16 alsa(16829) gstalsa.c(1659):gst_alsa_probe_hw_params: Probing format: S16_LE 32000Hz, 2 channels alsa(16829) gstalsa.c(1727):gst_alsa_set_hw_params: Preparing format: S16_LE 32000Hz, 2 channels GST_EVENT(16829) gstevent.c(96):_gst_event_free: freeing event 0x8068190 Execution ended after 16 iterations (sum 1698391000 ns, average 106149437 ns, min 43000 ns, max 257769000 ns). Caught interrupt. ==================== Output with asfdemux ==================== FÃHRE Leitung AUS ... GST_STATES(16833) gstelement.c(2825):gst_element_set_state_func:<pipeline0> setting state from NULL to PLAYING GST_STATES(16833) gstelement.c(2825):gst_element_set_state_func:<filesrc0> setting state from NULL to READY GST_STATES(16833) gstelement.c(2825):gst_element_set_state_func:<asfdemux0> setting state from NULL to READY GST_STATES(16833) gstelement.c(2825):gst_element_set_state_func:<filesrc0> setting state from READY to PAUSED filesrc(16833) gstfilesrc.c(771):gst_filesrc_open_file:<filesrc0> opening file file2.dump GST_STATES(16833) gstelement.c(2825):gst_element_set_state_func:<asfdemux0> setting state from READY to PAUSED GST_STATES(16833) gstelement.c(2825):gst_element_set_state_func:<filesrc0> setting state from PAUSED to PLAYING GST_STATES(16833) gstelement.c(2825):gst_element_set_state_func:<asfdemux0> setting state from PAUSED to PLAYING scheduler(16833) gstoptimalscheduler.c(1690):gst_opt_scheduler_state_transition: setting scheduler state to running GST_EVENT(16833) gstevent.c(175):gst_event_new: creating new event type 4: 0x8068248 GST_EVENT(16833) gstevent.c(96):_gst_event_free: freeing event 0x8068248 asfdemux(16833) gstasfdemux.c(1076):gst_asf_demux_process_object: Found object 4 with size 2429 asfdemux(16833) gstasfdemux.c(629):gst_asf_demux_process_header: Object is a header with 7 parts asfdemux(16833) gstasfdemux.c(1076):gst_asf_demux_process_object: Found object 6 with size 110 asfdemux(16833) gstasfdemux.c(552):gst_asf_demux_process_comment: Object is a comment. GST_EVENT(16833) gstevent.c(175):gst_event_new: creating new event type 16: 0x8068248 GST_EVENT(16833) gstevent.c(96):_gst_event_free: freeing event 0x8068248 asfdemux(16833) gstasfdemux.c(1076):gst_asf_demux_process_object: Found object 13 with size 32 asfdemux(16833) gstasfdemux.c(524):gst_asf_demux_process_bitrate_props_object: Object is a bitrate properties object with 1 streams. asfdemux(16833) gstasfdemux.c(1076):gst_asf_demux_process_object: Found object 3 with size 104 asfdemux(16833) gstasfdemux.c(506):gst_asf_demux_process_file: Object is a file with 4294967295 data packets asfdemux(16833) gstasfdemux.c(1076):gst_asf_demux_process_object: Found object 10 with size 1707 asfdemux(16833) gstasfdemux.c(651):gst_asf_demux_process_header_ext: Object is an extended header with a size of 1661 bytes asfdemux(16833) gstasfdemux.c(1076):gst_asf_demux_process_object: Found object 16 with size 33 asfdemux(16833) gstasfdemux.c(1030):gst_asf_demux_skip_object: Skipping object... asfdemux(16833) gstasfdemux.c(1076):gst_asf_demux_process_object: Found object 18 with size 88 asfdemux(16833) gstasfdemux.c(1030):gst_asf_demux_skip_object: Skipping object... WARN asfdemux(16833) gstasfdemux.c(1054):_read_object_header:<asfdemux0> Could not identify object (0x26f18b5d/0x47ec4584/0x650e5f9f/0xc952041f) with size=26 asfdemux(16833) gstasfdemux.c(1076):gst_asf_demux_process_object: Found object 0 with size 26 asfdemux(16833) gstasfdemux.c(1030):gst_asf_demux_skip_object: Skipping object... asfdemux(16833) gstasfdemux.c(1076):gst_asf_demux_process_object: Found object 17 with size 122 asfdemux(16833) gstasfdemux.c(1030):gst_asf_demux_skip_object: Skipping object... asfdemux(16833) gstasfdemux.c(1076):gst_asf_demux_process_object: Found object 12 with size 1392 asfdemux(16833) gstasfdemux.c(1030):gst_asf_demux_skip_object: Skipping object... asfdemux(16833) gstasfdemux.c(1076):gst_asf_demux_process_object: Found object 1 with size 114 asfdemux(16833) gstasfdemux.c(960):gst_asf_demux_process_stream: Object is an audio stream with 10 bytes of additional data. WARN asfdemux(16833) gstasfdemux.c(1580):gst_asf_demux_add_audio_stream:<asfdemux0> asfdemux: Audio header contains 10 bytes of codec specific data asfdemux(16833) gstasfdemux.c(1599):gst_asf_demux_add_audio_stream: Adding audio stream 0 codec 353 (0x161) asfdemux(16833) gstasfdemux.c(1674):gst_asf_demux_setup_pad: Adding pad for stream 0 GST_ELEMENT_PADS(16833) gstelement.c(1175):gst_element_add_pad:<asfdemux0> adding pad 'audio_00' GST_PIPELINE(16833) ./grammar.y(344):gst_parse_found_pad: trying delayed linking asfdemux0:(null) to ffdec_wmav20:(null) GST_ELEMENT_PADS(16833) gstelement.c(1893):gst_element_link_pads_filtered: trying to link element asfdemux0:(any) to element ffdec_wmav20:(any) GST_PADS(16833) gstpad.c(1693):gst_pad_can_link_filtered: trying to link asfdemux0:audio_00 and ffdec_wmav20:sink GST_PADS(16833) gstpad.c(1814):gst_pad_link_filtered: trying to link asfdemux0:audio_00 and ffdec_wmav20:sink scheduler(16833) gstoptimalscheduler.c(2123):gst_opt_scheduler_pad_link: scheduling link between asfdemux0:audio_00 and ffdec_wmav20:sink GST_PADS(16833) gstpad.c(1908):gst_pad_link_filtered: linked asfdemux0:audio_00 and ffdec_wmav20:sink, successful GST_STATES(16833) gstelement.c(2825):gst_element_set_state_func:<ffdec_wmav20> setting state from NULL to PLAYING GST_STATES(16833) gstelement.c(2825):gst_element_set_state_func:<alsasink0> setting state from NULL to PLAYING alsa(16833) gstalsa.c(1581):gst_alsa_open_audio: Opening alsa device "default"... GST_CAPS(16833) gstpad.c(1334):gst_pad_link_call_link_functions:<ffdec_wmav20:src> pad doesn't accept caps audio/x-raw-int, signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16, rate=(int)44100, channels=(int)2 asfdemux(16833) gstasfdemux.c(967):gst_asf_demux_process_stream: Using error correction asfdemux(16833) gstasfdemux.c(1076):gst_asf_demux_process_object: Found object 14 with size 162 asfdemux(16833) gstasfdemux.c(1030):gst_asf_demux_skip_object: Skipping object... asfdemux(16833) gstasfdemux.c(1076):gst_asf_demux_process_object: Found object 7 with size 170 asfdemux(16833) gstasfdemux.c(1030):gst_asf_demux_skip_object: Skipping object... asfdemux(16833) gstasfdemux.c(1076):gst_asf_demux_process_object: Found object 2 with size 50 asfdemux(16833) gstasfdemux.c(784):gst_asf_demux_process_data: Object is data with 0 packets asfdemux(16833) gstasfdemux.c(840):gst_asf_demux_handle_data: Process packet GST_STATES(16833) gstelement.c(2825):gst_element_set_state_func:<filesrc0> setting state from PLAYING to PAUSED Versions: gstreamer-0.8.9 gst-plugins-0.8.7 gst-ffmpeg-0.8.3
Created attachment 37903 [details] The sample asf-dump captured by mmssrc This is the dump file that the above output was generated with
Reproduceable.
Created attachment 38291 [details] [review] fix num_packets=0, so we EOS straight away. This patch fixes it.
It still doesn't show video. The file has two video streams and the second one contains data. We don't handle that correctly. I've seen similar issues with some .mov files. Also, the file has a fairly low framerate, but we always set 25fps, which makes playback too fast between keyframes, and it hangs on the next keyframe until we re-sync up. That's a bug in asfdemux that someone needs to fix at some point.
Created attachment 45289 [details] [review] first try So, the attached patch implements rude FPS detection, which works OK for some movies. However, for others, it doesn't work at all. Reason is timestamps in ASF: Time: 0:00:29.666000000 Time: 0:00:29.733000000 Time: 0:00:29.800000000 Time: 0:00:29.866000000 Time: 0:00:29.933000000 Time: 0:00:30.000000000 Time: 0:00:30.066000000 Time: 0:00:30.133000000 Time: 0:00:30.200000000 Time: 0:00:28.352000000 Time: 0:00:30.333000000 Time: 0:00:30.400000000 Time: 0:00:30.466000000 Time: 0:00:30.533000000 Time: 0:00:30.600000000 Time: 0:00:30.666000000 Time: 0:00:28.928000000 Time: 0:00:30.800000000 Time: 0:00:30.866000000 I don't know how come, but video is way ahead of audio. Also, it's very choppy, probably for the same reason (i.e. sometimes it processes 10 frames in a snap, sometimes it hangs for a second). Apparently, the early timestamps are I-frames, and are wrong, but because they are I-frames, ffmpeg uses them as base for timestamping. I'll need to see how other apps solve this issue.
Created attachment 45294 [details] [review] second try This seems to work better, and my test movies are all in sync now. It basically prevents timestamps from jumping back. Slightly hacky, but it works nicely in practice.
applied.