I have been using an app named flixtools from http://flixtools.com/, It got me really curious about how it searches for the movie name. I renamed the movie file with some random text and yet it finds the correct name of the movie for finding subtitles. From a developers view I wanted to understand how it is able to find the real name of the movie file.
Simply put : the movie name is in the file's metadata.
Most media formats (jpeg, mp3, mp4, etc...) are structured so that, along with the image/music/video data, there are some metadata about the photo/music track/tv show/movie that the file contains.
Related
I am looking for a way to retrieve the artwork from a large amount of mp3 files and store the artwork as jpg files in a folder. The only gem I am aware of able to read mp3 data is mp3info and the documentation only says that it can write images to the mp3 not retrieve the data from the mp3, are there any gems that give this capability?
So I ended up getting it. As I said above, I ended up using taglib, and used Carrierwave to store the files in my fs.
If you follow the documentation on https://robinst.github.io/taglib-ruby/, you would use:
file = TagLib::MPEG::File.new(file)
id3v2_tag = file.id3v2_tag
cover = id3v2_tag.frame_list('APIC').first
file.close
to grab the picture. Then create a new file to write the data:
newfile = File.new('temp.jpg', 'w+')
newfile.write(cover.picture.force_encoding('UTF-8'))
newfile.close
Then use Carrierwave, Paperclip, or whatever to store it somewhere. Hope this helps.
I have a question relative to Complete_NameLast MediaInfo field
CompleteName_Last : Complete name (Folder+Name+Extension) of
the last file (in the case of a sequence of files)
Does any one knows how and when this field adding to file ?
How to set it via FFMPEG ?
I was assuming that this field added with squence of video files for example we have one big source file, streaming it and than capturing via FFMPEG but at that case some files have it and some files don't.
In picture that you were seen above we have it (current file index4.ts) but with other file that was captured from the same soruce we don't have it (for example index 40.ts)
The main questions are
1. Where I can find additional information about ffmpeg file squence capturing
2. Where I can find find more information relative to this
MediaInfo property
Thank you.
That's not a property of the file. When Mediainfo detects a sequence of media files in a folder which are consecutively named, it displays that field with the name of the last file in the sequence.
The word file here refers to the shell file command, and not actual files. I want to determine whether a file is a, for example, video file (.mpg, .mkv, .avi). file is pretty good at returning image for image files, video for video files, and audio for audio files (and application/x-empty for some reason for text). My question is how reliable this is for identifying types. If I did a simple
file -ib deliverance.avi | grep video
would that work for all of the main video files outlined here?
The results from file are less than perfect, and it has more problems with some types of files than others. File basically just looks for particular pieces of binary data in predictable patterns to figure out filetypes.
Unfortunately, in particular, some of the filetypes often used for video fall into this "problematic" category. The newer container formats like .mp4 and .mkv usually have several different MIME types that should properly depend on what type of data is being contained. For example, an .mp4 could properly be identified as video/mp4, audio/mp4, or application/mp4 depending on the content.
In practice, file often makes guesses that simply conform with common usage, and it may work perfectly well for you. For example, while I mentioned some theoretical difficulties with identifying Matroska files correctly, file basically just assumes that any Matroska file is a video. On the other hand, the usage of the Ogg container is more evenly split between audio and video, and I believe the current version of file just splits the difference, and identifies Ogg files as application/ogg, which wouldn't fall into any of your categories.
The one thing I can say with certainty is that you want the most up-to-date version of file you can get your hands on. The "magic" files that contain the patterns to match against and the MIME types that will result from a match are updated fairly often to include newer filetypes like WebM, or just to improve accuracy for older types.
file works by referencing the header of the file against a "magic number" file. I suspect the best way to see how robust file is to check your local magic number file (possibly /usr/share/magic but see man file for details) for the file types from your referenced list.
It seems like it should work for most video/audio/image files. But, if it doesn't, there's actually a file that contains the relations between an extension and it's type:
The information identifying these files is read from the compiled magic file /usr/share/magic.mgc , or /usr/share/magic if the compile file does not exist.
see:
http://linux.about.com/library/cmd/blcmdl1_file.htm
Hope this helps!
I have hundreds of mp3 files that have unique file names in succession. i.e. mysong8001.mp3 and mysong8002.mp3 and mysong8101.mp3 where "80" and "81" are the year and "01" and "02" reflect the order of the files for a given year.
The person that created the files did not add any tags except for a Title. Unfortunately all of the files for 1980 have the Title "1980" and all of 1981 have the Title "1981". Once imported into iTunes, there is no way to distinguish the files or their order.
Is there a way to change the id3 tag info for the Title to be the same as the file name? So that in iTunes, the Title would be "mysong8001"? I would prefer to change this for all files in a directory rather than me having to open each file's info and manually change it. That would take days to weeks to accomplish.
One other thing that would be nice is that as a group of files, that I could also change other tags as well that would be common to all of them like the "Artist", "Album", etc.
Any suggestion for an app (on a Mac) that would let me do this would be appreciated.
Linda
This one works perfectly.
http://macupdate.com/info.php/id/15407/tritag
Linda
I think Mp3Tag ( http://www.mp3tag.de/en/ ) should work fine for you. You can describe a pattern the filename is constructed of and add/remove/change tags to the mp3 file.
Life hacker has put together an article on six best id3 tag editors, you might like one of them.
http://lifehacker.com/5266613/six-best-mp3-tagging-tools
The editors for mac listed are:
TuneUp : http://www.tuneupmedia.com/
MusicBrainz Picard: http://musicbrainz.org/doc/PicardTagger
Another mac software worth looking is
http://www.apple.com/downloads/macosx/ipod_itunes/tune%E2%80%A2instructor.html
Where can I find documentation/sample code of the VOBsub subtitles format? The one that's an .idx and a .sub file.
I need to create a program that generates those subtitles. I've been looking on Google but only found how to rip them from DVD.
Thanks
VOBsub extracts the DVD subtitles raw PES from a DVD and dumps this to a .sub file. It also creates a .idx Index file with the times and byteoffsets for each and every single subtitle. The format has support for multiple tracks and can also be embedded in MP4 (by Nero) and Matroska files.
Technical specs vobsub
Technical specs from Matroska.org
Example files: Specs_and_idx-sub_files.rar
Have a look at these open source implementations:
BDSup2Sub (Java)
Subtitle Edit (C#)
guliverkli by gabest (C++) check out VSFilter and VSRip; original implementation
Son2VobSub.rar (C++)
And then there are the media players like VLC. You can also check out these threads on doom9:
http://forum.doom9.org/archive/index.php/t-87171.html
http://forum.doom9.org/archive/index.php/t-99815.html
I think your best approach would be to have a look at the sourcecode of some of the open-source media players. Some of them will have the code to interpret an .idx or .sub subtitle file.
This might be a useful starting point:
http://sourceforge.net/projects/guliverkli/