View Full Version : FLV2MPEG4 (more or less losslessy?)
Hyper Shinchan
21st November 2010, 21:55
I was searching for some tool capable of converting "losslessly" from FLV1 to H.263 even though I was fully aware that probably it isn't an easy task since Sorenson didn't simply change the bitstream but probably they've "tweaked" the coefficients as well.
Mainly I was hoping that there was a similar tool because there was one that could the same for M$ MPEG-4 to ISO MPEG-4 (and I suppose that the difference between Sorenson H.263 and ITU-T H.263 is similar)
I ended up finding a Japanese tool called flv2mpeg4; the site that was hosting the online based conversion tool doesn't exist any more (they've putted some advertisement on their home page) but I've found this website (http://www.geocities.jp/iconsetjp/flv2mpeg4-memo/index.html) (it's in Japanese) that host a compiled build for Windows (it's the "flv2mpeg4gui" at the end of the page).
There's also the source code in their sourceforge page (http://vixynet.svn.sourceforge.net/viewvc/vixynet/) if you'd like to build it for another platform.
I've tried it a little; the gui is really minimalistic and it only gives AVI as output, anyway if you use the cli you can output it to MP4 and MOV by simpling changing the extension (actually I think that the software is based on ffmpeg but it doesn't seem to support other outputs, it doesn't work if you use mkv).
For some reason it doesn't remux the audio stream so you'll have to demux it and remux it by yourself.
Their blog (that can be only accesed using archive.org (http://web.archive.org/web/20071130093437/http://vixy.net/blog/archives/42)) explains a little about the way it works.
The conversion isn't really lossless but it's indeed quite good both in term of speed and quality.
Well, I just wanted to share it since it could be useful for someone else as well.
PLAzmA247
26th November 2010, 13:40
Ok mate, there is another way and i think you will find it far easier ;)
Oh did i say no quality loss :)
see my Thread: http://forum.doom9.org/showthread.php?p=1460370#post1460370
nm
26th November 2010, 13:55
Ok mate, there is another way and i think you will find it far easier ;)
So you're simply remuxing whatever is in the FLV file to MKV, right? Hyper Shinchan wants to transcode FLV1 (Sorenson's variant of H.263) to standard H.263. Not the same goal at all.
PLAzmA247
26th November 2010, 14:00
So you're simply remuxing whatever is in the FLV file to MKV, right? Hyper Shinchan wants to transcode FLV1 (Sorenson's variant of H.263) to standard H.263. Not the same goal at all.
Sorry mate i miss understood the problem, however im not aware ive come across a Sorenson's variant of H.263 encoded file, can you point me to one ?
Everything ive re-containered this way has played fine, so im not sure why you would need to re-encode unless it wont play with a standard x263 codec, if thats the case i would like to have a look to see what i can archive and maybe write in a sub call into my script to include something like this if its a requirement.
PLAzmA247
26th November 2010, 18:09
So you're simply remuxing whatever is in the FLV file to MKV, right? Hyper Shinchan wants to transcode FLV1 (Sorenson's variant of H.263) to standard H.263. Not the same goal at all.
I managed to get hold of some FLV1 Videos and Sorensons vairiants by creating them using flash cs3.
What ive done is migrated the tool from this thread into my script, which now extracts x264 or x263 videos and should in theory work for pretty much any FLV container (duno what happens if you fire just audio at it (no video) might give that a whirl later.
Anyway cheif thanks for point out the diffirences and thanks to Hyper Shinchan for pointing out the tool.
http://forum.doom9.org/showthread.php?p=1460370#post1460370
Hyper Shinchan
8th December 2010, 01:55
Sorry guys if I didn't reply before; PLAzmA247's idea isn't bad, especially for the users who aren't familiar with cli programs (since the cli of that program is quite minimalistic and it'll only output AVI). If I may make suggestion, I'd say that it'd not be a bad idea to add a MP4 output (maybe by adding MP4Box in your script); MP3 in MP4 is perfectly fine but maybe some users may request an additional transcoding to AAC (unfortunately hardware players doesn't exactly like MP3 in MP4) which could be reached by adding some other programs in the queue (ffmpeg could be used if FAAC's encoding is enough, otherwise it'd be necessary to wrap Nero's AAC cli program).
Anyway I'd suggest to refrain from calling H.263 (or H.264) x263 (x264); x264 is an encoder, not the format and I think that an encoder called x263 doesn't even exist (I could be wrong but I never heard of one with this name).
Cheers.
PLAzmA247
8th December 2010, 02:47
Yeah it would be possible to build in a convertor to what ever formats you wanted.
yeah sorry about the whole x264 and h264 i do know the diffirence, lol doesnt stop me making the mistake tho haha.
h263 - http://wiki.multimedia.cx/index.php?title=H.263
However as the wiki page states the codec flag sometimes gets wirtten as x263.
But i guess its like refering to x86 and x32.... not exactly the same thing but both get mixed up fairly often as virtually amount to the same thing with modern machines.
Back to the script, it actually doesnt output AVI, its an MKV (BAH AVI is an old container that should have burned with the ark) and mkv is supported by most modern hardware players and over the years has become my container of choice.
The script currently makes use of various tools but its mkvmerge ultimately used at the end, however you could replace what ever you want as the recontainer prog and go into mp4 if you like :)
Largely as were dealing with h264 and aac which is currently the most popular combination for flash video i dont think you need to worry about having to re-encode anything, even with older flash videos your probably going to get h263 or xvid or something that will play in a hardware player, again should work with all modern hardware players as well.
Im not sure why your having issues with hardware players that have mp3 audio streams in an mp4 container... as mp4 is a container like mkv or avi and normally your going to find mp3 audio or aac in there (but technially it could be anything). However it would be more inclined to think it would have a problem with the aac than the mp3 stream.
http://en.wikipedia.org/wiki/MPEG-4_Part_14
But again, if you want it to all you need to do is drop a sub routine in to convert mp3 audio if its detected, although ive not built this in and would just sort of borrow the logic from the h263 detection which really just looks at the extension of the spat out video stream.. again i did have the idea that it would be able to do a more comprehensive detection on the stream to work out its exact requirement. But i realised at this point it doesnt really need it, but again this wouldnt be hard if it did and probably could just read part of the output already read for the the fps detect.
What i may do.. assuming i get board enough across xmas is to think about creating a drag and drop gui for it (even easier for novice users as no command line at all). However although this does make it easier for novice users i didnt really think about them at time of writing, it was purly to take all the ball ache out o trying to convert 20+ flv videos and having to do the same thing over and over again.
... although probably im going to write in a tweak so it can runs through sub folders as well (a recursive switch), so that way it can search recontainer and destroy any nasty flv's on an entire drive (not just a single folder) with one command :)
Oh and something to prevent the original flv from being deleted should for what ever reason the source mkv (output file) is not created.
Anyway peace and love.
PLAzmA
Hyper Shinchan
23rd January 2011, 18:37
Sorry, as usual I'm necro-posting as always...
Im not sure why your having issues with hardware players that have mp3 audio streams in an mp4 container... as mp4 is a container like mkv or avi and normally your going to find mp3 audio or aac in there (but technially it could be anything). However it would be more inclined to think it would have a problem with the aac than the mp3 stream.
That's because most MP4 enable players usually aspect to find only AAC audio and they don't expect to find MP3 audio, they will either play silence or in the worse case they'll try to play the stream assuming that it's AAC and they'll only play some noise (this is the case of the PSP for example; I have to test the PS3, maybe it works fine since it even supports AC-3 in MP4).
As you mentioned in your post most sites nowadays use AVC+AAC (either in FLV or directly in MP4) but some sites still use FLV so this program could still be of some limited use (most notably I think that megavideo still uses crappy FLV1).
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.