Welcome Guest ( Log In | Register )

ogg vorbis encoding problem, output ogg files can't be plyed with VLC
post Oct 21 2013, 07:33
Post #1

Group: Members
Posts: 1
Joined: 21-October 13
Member No.: 111116

Hello, everybody! Could you help me, please?
I had a simple ogg file (about 2 seconds-length). I converted it just to a pcm file using "libvorbisfile". Then I tried to convert it to .ogg again.
So, first I used libvorbisenc to setup encoding. I took that pcm file that I had got after decoding and wrote each its 2 consequent bytes in short and then just transformed them to float:
short integerSample;
((char *)(&integerSample))[0] = pcmData[(i + j) * 2];
((char *)(&integerSample))[1] = pcmData[(i + j) * 2 + 1];
inputEncodingBuffer[j] = (float)integerSample;
Then I used libvorbis to encode these raw packets to ogg pages using ogg_stream_packetin() and ogg_stream_pageout(). (I also didn't forgot about three header packets at the beginning and also created ogg pages for them.) Then I output these ogg pages using fwrite() and got an ogg file of appropriate size. I tried to play it with VLC player. But it all failed. The player recognizes this file as ogg but does not play it. And when I look at file's properties all fileds like sapling rate, channel number are equal to zeros or no info. So I understand that i do something wrong. But i can't understand what exactly. I read all info on ogg vorbis official site. Looked through great deal of similar codes in the Interenet. But it seems like I didn't forgot anything. So I don't understand why my code does not work. By the way, when I change some parametres in vorbis_encode_init_vbr(), e.g. sampling rate or quality my output ogg files change. So this info about my music file affects encoding generally.
I understand that it's difficult to guess what's wrong only from what I've just written here. But maybe you could give me some hint.
I can write here more details about my workflow of course.
Every help will be very appreciated!
Thank you.
Go to the top of the page
+Quote Post

Posts in this topic
- JenyaKh   ogg vorbis encoding problem   Oct 21 2013, 07:33

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 29th March 2015 - 19:05