Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6054497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:09:34+00:00 2026-05-23T08:09:34+00:00

I’m trying to determine the real type of a file programmatically. It seems I

  • 0

I’m trying to determine the real type of a file programmatically. It seems I have to use for example FFMPeg for that.

I want to determine if an uploaded file is in fact a MP4 or FLV (for flash videos) [or WebM (for HTML5)]. I know the -i operator in FFMPeg but I don’t know what to check for.

For example:

Input #0, flv, from 'c:\www\data.aspbooru\image\0\40c24ba424d1334ef81c88c416ce794e.flv':

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'c:\www\data.aspbooru\image\0\8c1a747b5188349d92cca17a502d2d57.mp4':

Those are FFMPeg outputs. Is this all I have to check for when filtering videos for flash?

So, if none of those apply. How do I check for a swf file?

Input #0, swf, from 'c:\www\data.aspbooru\image\0\90447bd30d30ccb1474c0433e948d438.swf':
Duration: 00:07:16.08, start: 0.000000, bitrate: 63 kb/s
Stream #0.0: Audio: mp3, 44100 Hz, 2 channels, s16, 64 kb/s
Stream #0.1: Video: flv, yuv420p, 320x240, 25 fps, 25 tbr, 25 tbn, 25 tbc

Is checking for Input #0, swf, enough? It extracts an included flv which I dont want.

Now I also need to check for file types which are completely NOT videos and filetypes which are videos, but could be converted to a mp4 with h.264 (Or Webm?)
I have completely no clue how to do this.

The conversion thing can be managed, but hints on that would be very cool too (converting h.264 and webm?).

I input a random file. Is this it?
c:\web.config: Invalid data found when processing input

EDIT: No programming language specified because it is independent of any programming language. But I would be grateful for language specific input: VB.NET. You can assume I already have the process logic and the output is there as a string! Regex would be cool too 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:09:35+00:00Added an answer on May 23, 2026 at 8:09 am

    Determining Types

    You might have better luck with MediaInfo.

    Grab the command line version and use it like this:

    mediainfo --full --language=raw --output=xml
    

    This gives XML output, you can then use XPath to grab the Codec field.
    Or if XML is not your thing drop the ‘–output=xml’ then write a regex to parse the text output.

    For non recognised files it looks like it gives some output but certainly won’t have a Codec field.

    Converting videos

    For actually converting videos FFmpeg is the Swiss Army Knife of video encoding and is probably your best option.

    You don’t need to know the input really as long as you know what output codecs you want.

    Something like this can get you started:

    ffmpeg -i input.mov -vcodec libx264 -acodec libfaac -f mov out.mp4
    

    That will give you a MPEG-4 with H.264 video and AAC audio.
    Although there are many options available to tune this to get what you want.

    This site is useful for tuning H.264 options.

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I am trying to understand how to use SyndicationItem to display feed which is
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
i want to parse a xhtml file and display in UITableView. what is the
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.