How get file size using gstreamer queries elements
trinitonadam
trinitonadam at gmail.com
Wed Jul 10 08:25:16 PDT 2013
I use gst_element_query_position to get size of encoded file in bytes:
gin64 val;
if (gst_element_query_position (pipeline, GST_FORMAT_BYTES, &val)) {
gchar *file_size = g_format_size_full (val, G_FORMAT_SIZE_LONG_FORMAT);
gtk_label_set_text (GTK_LABEL (file_size_label), file_size);
g_free (file_size);
}
when convert 10 secs stream in lossless format (FLAC) output is precise:
685.8 kB (685,799 bytes)
<http://gstreamer-devel.966125.n4.nabble.com/file/n4660970/FLAC.png>
when convert 10 secs stream in lossy format (OGG) output is wrong:
10.1 GB (10,418,503,401 bytes)
<http://gstreamer-devel.966125.n4.nabble.com/file/n4660970/OGG.png>
Any help to solve this is welcome.
Thanks
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-get-file-size-using-gstreamer-queries-elements-tp4660952p4660970.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list