- MC Tube
- FLV Dump tool
Actarus flv dump test: Benchmarking the getID3 library (Update 4)
As I posted to Zathras here, we can use the id3tag library php and apdapt it to retrieve information of flv. After playing a bit with it..I finally got results and I sumarized it as a table. I tooked for this benchmarking my video test files just to see if the getId3 lib can follow the stream of codecs. Before I comment the results, I want to thanks the getID3 author here for his code who was very intuitive and well pluged. This saved me a lot of time and worries to adapt the osfvplayer code who was lacking of the riff support. simply by guessing only two or three files needed to be added in the same directory to make it work!
History / Updates:
22.01.2011: I tooked the time to benchmark the getID3 library.
I wanted to know if size and more can be extracted to configure the player. Results are very promising but this depends on the codec and for flv/h264 tagging the video is THE SOLUTION.
See by yourself.
I have just discovered a cool ffmpeg bridge for php: ffmpeg-php to retrieve videos infos as well!
27.01.2011: I discovered yamdi and of course added to my hall of fame for FLV injectors. Without any doubts, this is the coolest FLV injector of the world: two reasons, it has a better tag injection as we will see and it's opensource. Well done Ingo Oppermann! I have however two requests:
the custom injection directly from xml file.. Why? for completing missing tags and setting own record signatures like G00gle does (flvmdi is the only tool that open the door thanks to xtradata).No more the one, a patch allows this!Sorry ladies and gentlemen, it ignores the tags too :(..- ID3 tags support for mp3 audio directly in flv. Why will be like a jump to sky to port this feature using the ID3 support from getID3...Of course at the end, it's the Heaven if all is inegrated in getID3!
28.01.2011: flv h264/mp3 tag issue solved! GetID3 read correctly ID3 tags stored in mp3 audio of flv if you use the latest ffmpeg
03.02.2011: I have built a dummy thumb generation using my flvinfo library. I have made usage of this to show nice thumbs according to the file properties in the *new* flvdump page updated today. This will be extended in my playlist too when thumbs will be handled into tubes config files. For those who want no to create thumbs by hand from images extracted previously from videos, there is phpthumbs.
07.02.2011: I decided to uniformize id3 tags between mp3 and flv, now it's easy to get any id3 tag thanks to the new getid3info() function \O_O/, see here. Moreover, I fixed the broken FLV1/H263 codec detection in getID3 since my yesterday discovery: my advice for flv1 generation (if you need to inject tags behind with flvtool2) is to avoid avidemux that does not generate correct sorenson spark (codec is good but the flv header is missing!). Use ffmpeg instead but I warn you, the id3 tag injection is broken (I lost my afternoon trying to inject id3tags ^^'). All this candies have been wrapped in the major release flvinfo-2.0.
09.02.2011: New flvinfo-2.1 ! Please stay stuned because I am forking flv4php ^^ and it's core is not a piece of cake at all. Of course, it will use flvinfo core for a better tag injection/detection in the metadata and integrate flvcuepoints. I played a bit with RichFLV which opens the cut feature of flvtool2 to the H264 world :). The bad news for videos keyframes declared in the metadata, is that no tool agree each other on their values, whose calculation is right, I am really wondering now. I've finally succeeded to inject ID3 tags into H263 with FLVTool2 since yesterday, I will explain all this as soon as possible.
16.02.2011: Two days means two new packages, doesn't it? Yes, I released the new flvinfo-3.0 that ends truely the fight with the h263/flv detection and improves riff support so you can know now if the video was produced by virtualdub =).
Overview
The table below vaults thousands of words. Indeed, it puts in light the fact that except dave's promo video and my h264 encoded files, file header is RIFF. This is surely the explanation why other vp6 codecs are not playable , ie recognized by mc media player.name | size | duration | header | width | height | codec | rate | mode | sampling | tags | |||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
video | audio | video | audio | video | audio | video | audio | video | audio | ||||||
goldorak_h264_tagged_id3_reinjected_updated_by_yamdi.flv | 13.61 MB | 1:02 | flv | 320 | 240 | Sorenson H.264(H264) | MPEG Layer-3 (MP3) | 1.63 KB/s | 125.14 | ? | ? | 25.05 | 44100 | Array(25) | Array(0) |
goldorak_h264_tagged_custom_flv4php4.flv | 3.51 MB | 1:02 | flv | 320 | 240 | Sorenson H.264(H264) | MPEG Layer-3 (MP3) | 1.67 KB/s | 125.00 | ? | ? | 25.00 | 44100 | Array(40) | Array(10) |
goldorak_h264_tagged_id3_reinjected.flv | 13.61 MB | 1:02 | flv | 320 | 240 | Sorenson H.264(H264) | MPEG Layer-3 (MP3) | 1.67 KB/s | 125.00 | ? | ? | 25.00 | 44100 | Array(25) | Array(0) |
goldorak_h264_tagged_id3.mp3 | 971.85 KB | 1:02 | mp3 | MPEG Layer-3 (MP3) | 125.00 | cbr | 44100 | Array(0) | Array(11) | ||||||
goldorak_h264_tagged_id3.flv | 13.61 MB | 1:02 | flv | 320 | 240 | Sorenson H.264(H264) | MPEG Layer-3 (MP3) | 1.67 KB/s | 125.00 | ? | ? | 25.00 | 44100 | Array(22) | Array(10) |
goldorak_h264_tagged.flv | 13.61 MB | 1:02 | flv | 320 | 240 | Sorenson H.264(H264) | MPEG Layer-3 (MP3) | 1.67 KB/s | 125.00 | ? | ? | 25.00 | 44100 | Array(25) | Array(0) |
mario.flv | 3.56 MB | 1:02 | flv | 400 | 300 | Sorenson Spark(FLV1) | MPEG Layer-3 (MP3) | 413.15 B/s | 56.45 | ? | ? | 25.00 | 22050 | Array(35) | Array(7) |
test.flv | 153.69 KB | -1:48 | flv | 320 | 240 | Sorenson Spark(FLV1) | Linear PCM(PCM#platform endian) | 287.05 B/s | 0.00 | ? | ? | ? | ? | Array(19) | Array(0) |
goldorak_sorenson_spark_avidemux.flv | 11.41 MB | 1:02 | riff | 352 | 288 | Sorenson H.263(H263) | MPEG Layer-3 (MP3) | 1.34 MB/s | 125.00 | vbr | cbr | 25.00 | 44100 | Array(25) | Array(0) |
goldorak_h263_avidemux.flv | 8.25 MB | 1:02 | riff | 352 | 288 | Sorenson H.263(H263) | MPEG Layer-3 (MP3) | 956.25 KB/s | 125.00 | vbr | cbr | 25.00 | 44100 | Array(25) | Array(0) |
goldorak_flv_ffmpeg.flv | 2.97 MB | 1:02 | flv | 352 | 288 | Sorenson Spark(FLV1) | MPEG Layer-3 (MP3) | 195.31 B/s | 125.00 | ? | ? | 25.00 | 44100 | Array(13) | Array(0) |
goldorak_h263_ffmpeg.flv | 3.01 MB | 1:02 | riff | 352 | 288 | Sorenson H.263(H263) | MPEG Layer-3 (MP3) | 262.74 KB/s | 125.00 | vbr | cbr | 25.00 | 44100 | Array(25) | Array(0) |
goldorak_h264.flv | 13.61 MB | 1:02 | flv | 320 | 240 | Sorenson H.264(H264) | MPEG Layer-3 (MP3) | 1.67 KB/s | 125.00 | ? | ? | 25.00 | 44100 | Array(13) | Array(0) |
goldorak_vp60.flv | 12.61 MB | 1:02 | riff | 320 | 240 | On2 VP60(VP60) | MPEG Layer-3 (MP3) | 1.49 MB/s | 125.00 | vbr | cbr | 25.00 | 44100 | Array(25) | Array(0) |
goldorak_vp61.flv | 10.37 MB | 1:02 | riff | 320 | 240 | On2 VP61(VP61) | MPEG Layer-3 (MP3) | 1.21 MB/s | 125.00 | vbr | cbr | 25.00 | 44100 | Array(25) | Array(0) |
MCMP_Promo.flv | 1.3 MB | 0:30 | flv | 480 | 270 | On2 VP6(VP62) | MPEG Layer-3 (MP3) | 300.00 B/s | 40.00 | ? | ? | 25.00 | 22050 | Array(11) | Array(0) |
goldorak_vp70.flv | 3.4 MB | 1:02 | riff | 320 | 240 | On2 VP70(VP70) | MPEG Layer-3 (MP3) | 316.65 KB/s | 125.00 | vbr | cbr | 25.00 | 44100 | Array(25) | Array(0) |
goldorak_vp80.flv | 3.22 MB | 1:02 | riff | 320 | 240 | Google VP8 Video(WebM) | MPEG Layer-3 (MP3) | 292.89 KB/s | 125.00 | vbr | cbr | 25.00 | 44100 | Array(25) | Array(0) |
All this table was generated dynamically from a code like this:
include "lib/flvinfo.php" ; //my addon (see at the end of this file)
include "lib/table.php" ; //for the output
//Directory of your flv files
$tubes='abc/def/';
$flvs=array(
'goldorak_h264_tagged_id3_reinjected.flv',//first one is important as all the column names depends on it, I use the tagged one on both audio and video sides
'goldorak_h264_tagged.flv', 'goldorak_flv1.flv',
'goldorak_h264.flv',
....
'goldorak_vp80.flv'
);
$fMax=count($flvs);
$infos=array();
$subarray_values=array();
for($f=0;$f<$fMax;$f++) {
$movie=$flvs[$f];
$flv=$tubes.$movie;
$info=getflvinfo($flv); //here is the main function of the addon
$infos[]=$info; //Optional, store the results for the next usage (meta info)
$info=$info["overview"]; //Overview only please
$header=($f==0) ? 1 : 0;//Use the first row data, ie first flv file as reference header for column names
html_show_array($info,$subarray_values,$header,0,15); //show only the first 14 columns because the table is too large for the screen..
}
Tags
Tags allow to store extra informations of the file. For example, jpeg extra informations (author, size...) are saved in the exif header.This is very usefull when you got a lot of pictures and want to set copyrights and establish categories. For flash videos with the flv header, as we will see below in the table, all technical video settings is encoded in a info table.I managed to dump major part of it thanks to the flv module of the getID3 Library. I have made an adapter to complete the table, because the riff format doesn't have the same properties names and my wish, as I said previously, was to compare the videos files. In red, the problems I encountered while trying to make order in the table and sometimes, I didn't manage to find equivalent to complete the data mining-hunt game.
Video
this is stored in the meta info. This is normaly filled when flv files are tagged but I discovered that wfw264 do this partially maybe there is an option x264.exe to complete this.The complete name of the injector for flvmdi, I used to complete the injection is shown and leads to a much more complete meta table if we compare it with the table of Dave's promo video excepting the tag creationdate but there is an equivalent, it's metadatadate. Maybe
video | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fileprops (thumb for this virtual tag) | metadata creator | has Key frames | has Video | has Audio | has Meta data | can Seek To End | duration | data size | video size | frame rate | video data rate | video codec id | width | height | audio size | audio data rate | audio codec id | audio sample rate | audio sample size | stereo | file size | last time stamp | lastkey frame time stamp | lastkey frame location | key frames | audio delay | encoder | creation date | metadata date | xtra data | album | artist | album_artist | composer | disc | year | genre | title | track | comments | creator | has key frames | has metadata | cuePoints | has CuePoints |
Yet Another Metadata Injector for FLV - Version 1.7 | 1 | 1 | 1 | 1 | 1 | 62.04 | 14270611 | 13233674 | 25.04835589942 | 1664.32 | 7 | 320 | 240 | 1021217 | 125.14 | 2 | 3 | 1 | 1 | 14271764 | 62.04 | 62.04 | 14271744 | Array(29) | |||||||||||||||||||||
FLV Editor for PHP V0.21a (Project: Flv4php) | 62.16 | 25 | 1706.19 | 7 | 320 | 240 | 125.00 | 2 | 44100 | 16 | 1 | 14270786 | Lavf52.83.0 | 1296427234000 | |||||||||||||||||||||||||||||||
Manitu Group FLV MetaData Injector 2 | 1 | 62.128 | 1202 | 13239890 | 25 | 1706.19 | 7 | 320 | 240 | 1030721 | 125.00 | 2 | 44100 | 16 | 1 | 14271826 | 62.04 | 62.04 | Array(29) | 0 | Lavf52.83.0 | unknown | 1295695234796 | karaoke by Actarus | |||||||||||||||||||||
62.16 | 25 | 1706.19 | 7 | 320 | 240 | 125.00 | 2 | 44100 | 16 | 1 | 14271137 | Lavf52.93.0 | UFO Robot Grendizer | Actarus | Shunsuke Kikuchi | Shunsuke Kikuchi | 1 | 1978 | Anime | La légende d'Actarus/Legend of Actarus | 0 | ||||||||||||||||||||||||
Manitu Group FLV MetaData Injector 2 | 1 | 62.115 | 1193 | 13239890 | 25 | 1706.19 | 7 | 320 | 240 | 1030577 | 125.00 | 2 | 44100 | 16 | 1 | 14271673 | 62.04 | 62.04 | Array(29) | 0 | Lavf52.83.0 | unknown | 1295432143295 | by actarus | |||||||||||||||||||||
inlet media FLVTool2 v1.0.6 - http://www.inlet-media.de/flvtool2 | 1 | 1 | 1 | 1 | 61.92 | 3718720 | 3212728 | 25 | 413.15 | 2 | 400 | 300 | 462786 | 56.45 | 2 | 22000 | 16 | 0 | 3735013 | 61.88 | 61.52 | Array(144) | 0 | 1297170710609 | Super Lego Mario | Mario | 2011 | Game | High scores | 1 | Score to beat:123456789 by Actarus | Array(144) | 1 | ||||||||||||
FLV Editor for PHP V0.21 (Project: Flv4php) | -12.179 | 571 | 156799 | 287.05 | 320 | 240 | 0 | 0.00 | 0 | 157379 | -12.179 | 4671 | 7305327 | Array(1) | 1296539613000 | FLV Editor for PHP V0.21 (Project: Flv4php) | 1 | 1 | |||||||||||||||||||||||||||
62.08 | 11904746 | 25 | 1406116.75 | ? | 352 | 288 | 125.00 | 2 | 44100 | 0 | 1 | 11962722 | |||||||||||||||||||||||||||||||||
62.08 | 8591910 | 25 | 979204.90 | ? | 352 | 288 | 125.00 | 2 | 44100 | 0 | 1 | 8649886 | |||||||||||||||||||||||||||||||||
62.08 | 25 | 195.31 | 2 | 352 | 288 | 125.00 | 2 | 44100 | 16 | 1 | 3114554 | Lavf52.93.0 | |||||||||||||||||||||||||||||||||
62.08 | 3081112 | 25 | 269050.52 | ? | 352 | 288 | 125.00 | 2 | 44100 | 0 | 1 | 3153758 | Lavf52.93.0 | ||||||||||||||||||||||||||||||||
62.16 | 25 | 1706.19 | 7 | 320 | 240 | 125.00 | 2 | 44100 | 16 | 1 | 14270786 | Lavf52.83.0 | |||||||||||||||||||||||||||||||||
62.08 | 13157850 | 25 | 1567599.23 | ? | 320 | 240 | 125.00 | 2 | 44100 | 0 | 1 | 13217578 | |||||||||||||||||||||||||||||||||
62.08 | 10807606 | 25 | 1264732.73 | ? | 320 | 240 | 125.00 | 2 | 44100 | 0 | 1 | 10868736 | VirtualDubMod 1.5.10.2 (build 2542/release) | ||||||||||||||||||||||||||||||||
1 | 29.96 | 25 | 300.00 | 4 | 480 | 270 | 40.00 | 2 | 0 | Wed Aug 13 18:01:40 2008 | |||||||||||||||||||||||||||||||||||
62.08 | 3509448 | 25 | 324248.45 | ? | 320 | 240 | 125.00 | 2 | 44100 | 0 | 1 | 3569664 | VirtualDubMod 1.5.10.2 (build 2542/release) | ||||||||||||||||||||||||||||||||
62.08 | 3320632 | 25 | 299916.49 | ? | 320 | 240 | 125.00 | 2 | 44100 | 0 | 1 | 3381248 | VirtualDubMod 1.5.10.2 (build 2542/release) |
Here is the code to produce this table:
//dump the meta info columns $subarray_tags=array(); //Generate the header taking the first video as reference $info=$infos[0]["overview"]; $infos_tags=$info["tags"]; //==== Complete the missing tags columns ==== //Virtual tag, inject the file name to know which video we are referring to array_unshift($infos_tags["video"], "name <br><br>(virtual tag to see which video we are referring to!)"); //----extra tag from flvmdi $infos_tags["video"]["audiodelay"]=true; //---extra tag from ffmpeg/FLVTool2(video) $infos_tags["video"]["encoder"]=true; //---extra tag from Dave's on VP62 encoder $infos_tags["video"]["creationdate"]=true; //---extra tag from flvmdi/FLVTool2 $infos_tags["video"]["metadatadate"]=true; //---extra custom tag from flvmdi $infos_tags["video"]["xtradata"]=true; //---extra tags from ffmpeg (audio/id3) $infos_tags["video"]["album"]=true; $infos_tags["video"]["artist"]=true; $infos_tags["video"]["album_artist"]=true; $infos_tags["video"]["composer"]=true; $infos_tags["video"]["disc"]=true; $infos_tags["video"]["year"]=true; //renamed, TYER for ffmpeg but year for mp3 $infos_tags["video"]["genre"]=true; $infos_tags["video"]["title"]=true; $infos_tags["video"]["track"]=true; $infos_tags["video"]["comments"]=true;//added, this one was missing in ffmpeg but in mp3's ID3V2 //---extra custom tag from flv4php/yamdi $infos_tags["video"]["creator"]=true; //---extra custom tag from FLVTool2 (cuepoint support) $infos_tags["video"]["cuePoints"]=true; $infos_tags["video"]["hasCuePoints"]=true; unset($infos_tags["audio"]); html_show_array($infos_tags,$subarray_tags,2); //2= generates only the header table $header=0;//0=generates only the row for($f=0;$f<$fMax;$f++) { $info=$infos[$f]["overview"]; $infos_tags=$info["tags"]; unset($infos_tags["audio"]); //delete audio tags array_unshift($infos_tags["video"], $info["name"]); if(array_key_exists("TYER",$infos_tags["video"])) { //Uniformize with mp3's getID3v2 more human readable $infos_tags["video"]["year"]=$infos_tags["video"]["TYER"]; unset($infos_tags["video"]["TYER"]); } html_show_array($infos_tags,$subarray_tags,$header); } echo "\n";
You surely want to know how to inject custom tags with goldorak's injector, please check this before.
Audio
What's about the audio id3tag tag? Note that the id3 tags is only for mp3 encoded audio. As I didn't set any of these, I downloaded mp3tag. My first think was... could this soft, will be able to tag mp3 in flv directly? Answer is unfortunately not. You will have to extract the sound before as a mp3 track, then to tag it and remux using ffmpeg.
audio | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
fileprops (thumb for this virtual tag) | album | artist | band | comments | composer | part_of_a_set | encoder_settings | genre | title | year | track |
Lavf52.83.0 | |||||||||||
UFO Robot Grendizer | Actarus | Shunsuke Kikuchi | aka UFO Robot Grendizer | Shunsuke Kikuchi | 1 | Lavf52.83.0 | Anime | La légende d'Actarus/Legend of Actarus | 1978 | ||
UFO Robot Grendizer | Actarus | Shunsuke Kikuchi | Shunsuke Kikuchi | 1 | Lavf52.93.0 | Anime | La légende d'Actarus/Legend of Actarus | 1978 | 0 | ||
Super Lego Mario | Mario | Score to beat:123456789 by Actarus | Game | High scores | 2011 | 1 | |||||
Again, here is the code to produce this table:
//dump the meta info columns $subarray_tags=array(); //Force the mp3 file as reference $info=$infos[3]["overview"]; $infos_tags=$info["tags"]; unset($infos_tags["video"]); //Vitual tag, inject the file name to know which video we referred to array_unshift($infos_tags["audio"], "name <br><br>(virtual tag to see which file we are referring to!)"); html_show_array($infos_tags,$subarray_tags,2); //2= generates only the header table for($f=0;$f<$fMax;$f++) { $info=$infos[$f]["overview"]; $infos_tags=$info["tags"]; unset($infos_tags["video"]); //delete audio tags column as we want video tags only array_unshift($infos_tags["audio"], $info["name"]); html_show_array($infos_tags,$subarray_tags,0); //0=generates only the row } echo "\n";