PDA

View Full Version : ffmpeg: using libavcodec and libavformat


sturm
16th November 2008, 11:05
hey guys.
i need to write a program that will transcode MPEG-2 into MPEG-4 using ffmpeg libraries.

The problem is i cant find any information about how to use libavcodec and libavformat libraries.. no documentation no nothing (except one demo code that writes down 5 first frames of the film)

If you have any links, resources or anything that could help me - could you please give me a hand?

Thank You

Kurtnoise
16th November 2008, 13:44
http://www.inb.uni-luebeck.de/~boehme/using_libavcodec.html

https://lists.mplayerhq.hu/mailman/listinfo/libav-user/

sturm
16th November 2008, 15:51
ok thats the 5 frame program code i was talking about and its not enough im afraid.. isnt there rly anything else?


btw the second link doesnt work

neuron2
16th November 2008, 16:13
its not enough im afraid In what way is it not enough for you? I was able to use that information to learn everything I needed to know to make DGAVCDec.

Sharktooth
16th November 2008, 16:16
... and the second link DOES work ...

sturm
16th November 2008, 16:28
well i need to make a mpeg-2 to mpeg-4 transcoder so i need to know how to code mpeg-4 and not like in this example decode it.

sorry about the second link - somehow firefox was blocking it but it works under IE.
Thanks.

If you guys know any other links please post them here - i need all the help i can get.

LoRd_MuldeR
16th November 2008, 16:29
... and the second link DOES work ...

Well, it's a HTTPS link but their certificate is invalid. So you will have to put that invalid certificate to your browser's exception list.

lists.mplayerhq.hu uses an invalid security certificate.
The certificate is not trusted because it is self signed.
(Error code: sec_error_ca_cert_invalid)

Up-to-date browsers make it much harder for the user to accept invalid certificates, which generally is a good idea!

But in the case of mplayerhq.hu you can safely trust them ;)


sorry about the second link - somehow firefox was blocking it but it works under IE.

No. Obviously Firefox detected and rejected the invalid certificate (as any browser should do), but IE didn't give a damn :p

clsid
16th November 2008, 16:54
The mplayerhq.hu domain also has unstable dns servers. That's why they are migrating to ffmpeg.org domain.

neuron2
16th November 2008, 17:11
The ffmpeg distribution (in the top directory) contains a file called output_example.c, which can do transcoding.

CruNcher
16th November 2008, 18:13
well i need to make a mpeg-2 to mpeg-4 transcoder so i need to know how to code mpeg-4 and not like in this example decode it.

sorry about the second link - somehow firefox was blocking it but it works under IE.
Thanks.

If you guys know any other links please post them here - i need all the help i can get.

For what another of these useless commercial converter Guis where there allready 1000th of them :P
allways funny most hire a coder endup asking stuff on doom9 :D
though maybe im just a little to suspicious here then forget what i wrote, but really you should find all the info you need reading the source :)

sturm
16th November 2008, 18:28
ok guys it works under IE so its not a problem anymore :)

and why do i need to write it? Thesis....

ill take a look at what you guys linked and if you have more - hit it ;] - thanks for your help

pcordes
18th November 2008, 23:33
ok guys it works under IE so its not a problem anymore :)

and why do i need to write it? Thesis....

What's your thesis topic? and why do you want to write your own program instead of starting with the code for the ffmpeg cli (or mencoder). They're both Free software, so you could modify them to add whatever new twist you want to research.

Or maybe ffmpeg's libraries do make it easy enough that a simpler framework would be easier to deal with. I know mplayer/mencoder has a lot of code to support all the special cases of different platforms and different ao/vo drivers that clutters things up... But I've only ever looked at very small corners of mplayer's code (e.g. fixing the channel order in multichannel ao pcm2:file=foo.wav).

sturm
22nd November 2008, 14:05
its "Video Transcoding from Mpeg-2 to Mpeg-4" - basicly its just about writing a program that does that... thats why i cant just put some random program from the net into my work

nm
22nd November 2008, 15:55
its "Video Transcoding from Mpeg-2 to Mpeg-4" - basicly its just about writing a program that does that... thats why i cant just put some random program from the net into my work
Transcoding and re-encoding are quite different things. From Wikipedia (http://en.wikipedia.org/wiki/Transcoding):
In true transcoding, the bitstream format of one file is changed from one to another without its undergoing another complete decoding and encoding process. This usually is possible if the source and target codecs are sufficiently similar. However, support for this process very much depends on the case.
Re-encoding can be accomplished with any decoder-encoder pair, and there are already countless tools that do it. Your thesis topic is more likely about true transcoding where the MPEG-2 stream is only partially decoded and some of the coded information is reused when encoding to MPEG-4. To accomplish this, you'll need to combine an MPEG-2 decoder and MPEG-4 encoder at a very low level, partially rewriting the codecs themselves. I don't mean to discourage you, but this is a very difficult task. Figuring out how to use libavcodec is a walk in the park compared to understanding how an encoder works and changing it.

If you are still going through with this topic, targeting MPEG-4 AVC (H.264) instead of MPEG-4 ASP would be much more useful (although harder).

pcordes
23rd November 2008, 00:51
its "Video Transcoding from Mpeg-2 to Mpeg-4" - basicly its just about writing a program that does that

What are you going to do differently from existing Free software? (In my experience thesis topics had to be new research, or at least something new.) So what am I missing here that makes this different from just re-implementing ffmpeg's CLI. :confused: A better user interface? might work if you're studying human-computer interaction...

I hope I'm not being rude, but what you're describing doesn't sound very novel, at least not the way you're describing it.

scott1256ca
1st December 2008, 08:11
you could try
http://www.irisa.fr/texmex/people/dufouil/ffmpegdoxy/index.html
you can also try
http://www.dranger.com/ffmpeg/ffmpeg.html
Warning though, the source for the last hasn't been updated in a while, and while the libavxxx related code seems fine, the SDL is outdated, and some doesn't work.
You may also have version issues, and if you do try to follow the install from here
http://ffmpeg.arrozcru.org/wiki/index.php?title=Main_Page

Also, please do elaborate on what you plan to do that is different than what has been done before. I'm interested in knowing what you have planned. If it is worth a thesis, it should be worth a 15 min. explanation :)