Recherche avancée

Médias (0)

Mot : - Tags -/page unique

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (27)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (7448)

  • SEO for Financial Services : The Ultimate Guide

    26 juin 2024, par Erin

    You know that having a digital marketing strategy is crucial for helping your financial services business capture the attention and trust of potential customers and thrive in an increasingly competitive digital landscape.

    The question is — what’s the best way to go about improving your ranking in SERPs and driving organic traffic to your website ? 

    That’s where SEO strategies for financial services come into play. 

    This article will cover everything your company needs to know about SEO for financial services — from the unique challenges you’ll face to the proven tips and strategies you can implement to boost your ranking in SERPs. 

    What is SEO for financial services ? 

    SEO — short for search engine optimisation — refers to optimising your content and website for search engines, particularly Google. 

    The main goal of an SEO strategy is to make your site search-engine-friendly, show that you’re a trusted source and increase the likelihood of appearing in SERPs when potential customers look up relevant keywords — ultimately driving organic visibility and traffic. 

    Now, when it comes to evaluating the success of your financial services SEO strategy, there are certain key performance indicators (KPIs) you should keep track of — including : 

    • SEO ranking, or the position your web pages show up in SERPs for specific search terms (the terms and phrases identified during keyword research) 
    • SEO Score, which shows a website’s overall SEO health and indicates how well it will rank in SERPs
    • Impressions, or the number of times users saw your pages when they looked up relevant search terms 
    • Organic traffic, or the number of people that visit your website via search engines
    • Engagement metrics, such as time on page, pages per session, and bounce rate 
    • Conversion rates from website traffic, including both “hard” conversions (lead generation and purchases) and “soft” conversions (such as newsletter subscriptions) 

    It’s important to note that the financial services industry is incredibly competitive — especially given the large-scale digital transformations in the financial sector and the rise of fintech companies. 

    According to a 2022 report, the global market for financial services was valued at $25.51 trillion. Moreover, it’s expected to grow at a compound annual growth rate of 9.7%, reaching $58.69 trillion by 2031.

    Importance and challenges of financial services SEO 

    The financial services industry is changing rapidly, mainly driven by globalisation, innovation, shifting economies, and compliance risks. It’s crucial for financial service companies to develop effective SEO strategies that align with the opportunities and challenges unique to this sector. 

    Certain benefits of a well-executed SEO strategy, namely, better search engine rankings, driving more search traffic, delivering a better user experience, and maximising ROI and promoting business growth, are “universal.” 

    Illustration of top position in SERPs

    Financial services SEO efforts can provide a number of benefits. It can help you : 

    • Improve lead generation and customer acquisition ; the more search traffic you get, the higher the chances of converting visitors into potential clients 
    • Build a strong online presence and brand awareness, which comes as a result of increased visibility in organic search results and reaching a wider audience 
    • Increase your credibility and authority within the industry, primarily through high-quality content that shows your expertise and backlinks from authoritative websites 
    • Gain a competitive edge by analysing and outranking your main competitors 

    That said, financial services companies face some unique challenges :

    High competition : The digital arena for financial services is highly competitive, with numerous companies vying for the same business.

    YMYL (Your Money or Your Life) content : Google’s YMYL framework places higher scrutiny on financial content, demanding higher standards for experience, expertise, authoritativeness, and trustworthiness. We’ll cover this topic in greater detail shortly.

    Regulatory changes and compliance : The financial services sector is characterised by constant regulatory changes and new compliance requirements that businesses must navigate. Sometimes this makes it difficult to gather insights and market to your audience. 

    As a privacy-fist, compliant web analytics solution Matomo can provide valuable insights to support your SEO efforts. Matomo ensures compliance with privacy laws — including GDPR, CCPA and more — and provides 20-40% more comprehensive data than Google Analytics.

    Try Matomo for Free

    Get the web insights you need, without compromising data accuracy.

    No credit card required

    8 proven strategies for implementing SEO for financial services 

    SEO for financial services involves a wide range of strategies — including keyword optimisation, technical SEO, content marketing, link building and other off-page SEO activities — that can help your website rank higher in SERPs. 

    Of course, it’s not just about better search rankings. It’s about attracting the right search traffic to your website — potential clients interested in your financial services.

    Here are some proven financial services SEO strategies you should implement : 

    1. Build trust and topical authority 

    Financial services content typically covers more complex topics that could impact the reader’s financial stability and well-being — or, as Google calls them, “Your Money or Your Life” topics (YMYL). As such, it’s subject to much stricter quality standards. 

    To improve your YMYL content, you’ll need to apply the E-E-A-T framework — short for “Experience, Expertise, Authority, and Trust”. 

    This is a key part of Google’s search rater guidelines for evaluating a website’s quality and credibility. 

    The E-E-A-T standards become even more relevant to financial topics such as investment strategies, financial advice, taxes, and retirement planning. 

    In that sense, the overarching goal of your content strategy should be to build customer trust by demonstrating real expertise and topical authority through in-depth educational content. 

    2. Earn reputable external links through link-building 

    You also need to monitor your off-page SEO—factors outside your website that can’t be directly controlled but can still build trust and contribute to better ranking in SERPs. 

    These include everything from social media engagement and unlinked brand mentions in blog posts, news articles, user reviews and social media discussions — to inbound links from other reputable websites in the finance industry.

    That brings us to high-quality backlinks as a significant factor for YMYL content that can improve your financial services website’s SEO performance : 

    Earning external links can improve your domain authority and reinforce your brand’s position as a reliable source in the financial services niche — which, in turn, can contribute to better search engine rankings and drive more website traffic

    Here are a few link-building strategies you can try : 

    • Use tools like Ahrefs and Semrush to look for reputable websites and then request for them to link to your site
    • Demonstrate your expertise and get backlinks from reputable media outlets through Help a Reporter Out (HARO) 
    • Reach out to authoritative websites that mention your company without linking to you directly and ask them to include a link to your websit

    3. Conduct an SEO audit 

    An SEO audit is a key step in developing and implementing a successful financial SEO strategy. It sets the foundation for all your future efforts — and allows you to measure progress further down the line. 

    You’ll need to perform a comprehensive SEO audit, covering both the existing content and technical aspects of your website — including : 

    • Indexing issues
    • Internal linking and site architecture 
    • Duplicate content 
    • Backlink profile 
    • Broken links 
    • Page titles and metadata 

    It’s possible to do this manually, third-party tools will allow you to dig deeper and speed up the process. Ahrefs and Screaming Frog — to name a few — can help you evaluate your website’s overall health and structure. And, with a web analytics platform like Matomo you can easily measure the success of your SEO efforts.

    But this shouldn’t be a one-time thing ; be sure to perform audits regularly — ideally every six months. 

    4. Understand your target audience

    You can’t create helpful content without learning about your customers’ needs, pain points and preferences. 

    For example, a financial service provider focusing on individuals nearing retirement would prioritise content that educates on retirement planning strategies, investment options for seniors, and tax-efficient withdrawal strategies, aiming to guide clients through the transition from saving to managing retirement funds effectively.

    In contrast, a provider targeting small business owners would emphasise content related to small business loans, funding options, and financial management advice tailored to entrepreneurs seeking to expand their businesses and navigate financial challenges effectively.

    So, before you dive into keyword research and content creation, ensure you have a deep understanding of your target audience. 

    Identifying different audience categories and developing detailed customer personas for each segment is crucial for creating content that resonates with them and aligns with their search intent. 

    Matomo’s Segmentation tool can be of huge help here. It allows you to divide your audience into smaller groups based on factors like demographics and website interactions : 

    : Screenshot of Matomo's Segmentation tool demo

    In addition to that, you can : 

    • Engage with your frontline teams that interact directly with clients to gain deeper insights into prospects’ needs and concerns
    • Track social media channels and other online discussions related to the financial world and your audience
    • Gather qualitative insights from your site visitors through the Matomo Surveys plugin (questions like “What financial services are you most interested in ?” or “Are there any specific financial topics you would like us to cover in more detail ?” will help you understand your visitors better)
    • Watch out for financial trends and developments that could directly impact your audience’s needs and preferences 

    5. Identify new opportunities through keyword research 

    Comprehensive keyword research can help you identify key search terms — specific phrases that potential customers may use when looking up things related to their finances. 

    It’s best to start with a brainstorming session and assemble a list of relevant topics and core keywords. Once you have an initial list, use tools like Ahrefs and Semrush to get more keyword ideas based on your seed keywords, including : 

    • More specific long-tail keywords — and often less competitive — indicate a clearer intent to convert. For example :
      • “low-risk investment options for retirees”
      • “financial planning for freelancers”
      • “small business loan requirements”
    • Keywords that your competitors already rank for. For instance :
      • If a competing investment firm ranks for “best investment strategies for beginners,” targeting similar keywords can attract novice investors.
      • A competitor’s high ranking for “life insurance quotes online” suggests potential to optimise your own content around similar terms.
    • Location-specific keywords (if you have physical store locations)

    Google Search Console can provide information about the search terms you’re already ranking for — including underperforming content that may benefit from further optimisation. If you want deeper SEO insights, you can import your search keywords into Matomo. 

    While you’re at it, try Matomo’s Site Search feature, too. It will show you the exact terms and phrases visitors enter when using your website’s search bar — and you can use that information to find more content opportunities.

    Try Matomo for Free

    Get the web insights you need, without compromising data accuracy.

    No credit card required

    Of course, not all keywords are equal — and it would be impossible to target them all. Instead, prioritise keywords based on two factors : 

    • Search volume, which indicates the “popularity” of a particular query
    • Keyword difficulty, which indicates how hard it’ll be to rank for a specific term, depending on domain authority, search volume and competition 
    Illustration of search engine optimisation concept

    6. Find your main organic competitors 

    Besides performing an SEO audit, finding your core keywords, and researching your target market, competitor analysis is another crucial aspect of SEO for finance companies. 

    Before you start, it’s important to differentiate between your main organic search competitors and your direct industry competitors : 

    You’ll always have direct competitors — other financial services brands offering similar products and services and targeting the same audience as you.

    However, regarding search results, your financial services business won’t be in a “bubble” specifically reserved for the financial industry. Depending on the specific search queries — and the search intent behind them — SERPs could feature a wider range of online content, from niche finance blogs to news websites, and huge financial publications.

    Even if another company doesn’t offer the same services, they’re an organic competitor if you’re both ranking for the same keywords. 

    Once you determine who your main organic competitors are, you can analyse their websites to : 

    • Check how they’re getting search traffic 
    • See which types of content they’re publishing 
    • Find and fill in any potential content gaps 
    • Assess the quality of their backlink profile 
    • See if they currently have any featured snippets

    7. Consider local SEO

    According to a 2023 survey, 21% of US-based consumers report using the internet to look up local businesses daily, while another 32% do so multiple times a week. 

    Local SEO is worth investing in as a financial service provider, especially with physical locations. Prospective clients will typically look up nearby financial services when they need additional information or are ready to engage in financial planning, investment, or other financial activities.

    Here are a few suggestions on how to optimise your site for local searches : 

    • Create listings on online business directories, like Google Business Profile (previously known as Google My Business)
    • If your financial service company operates in more than one physical location, be sure to create a separate Google Business Profile for each one 
    • Identify location-specific keywords that will help you rank in local SERPs
    • Make sure that your name, address, and phone number (NAP) citations are correct and consistent 
    • Leverage positive customer reviews and testimonials as social proof

    8. Optimise technical aspects of your website 

    Technical SEO — which primarily deals with the website’s underlying structure — is another crucial factor that financial services brands must monitor. 

    It’s an umbrella term that covers a wide range of elements, including : 

    • Site speed 
    • Indexing issues 
    • Broken links, orphaned pages, improper redirects 
    • On-page optimisation 
    • Mobile responsiveness

    In 2020, Google introduced Core Web Vitals, a set of metrics that measure web page performance in three key areas — loading speed, responsiveness and visual stability. 

    Given that they’re now a part of Google’s core ranking systems, you should consider using Matomo’s SEO Web Vitals feature to monitor these crucial metrics. Here’s why :

    When technical aspects of your website — namely, site speed and mobile responsiveness — are properly optimised, you can deliver a better user experience. That’s what Google seeks to reward. 

    Plus, it can be a critical brand differentiator for your business. 

    Conclusion 

    Investing in SEO for financial services is crucial for boosting online visibility and driving organic traffic and business growth. However, one thing to keep in mind is that SEO efforts shouldn’t be a one-time thing : 

    SEO is an ongoing process, and it will take time to establish your company as a trustworthy source and see real results. 

    You can start building that trust by using a web analytics platform that offers crucial insights for improving your website’s ranking in SERPs and maintains full compliance with GDPR and other privacy regulations. 

    That’s why Matomo is trusted by more than 1 million websites around the globe. As an ethical alternative to Google Analytics that doesn’t rely on data sampling, Matomo is not only easy to use but more accurate, too — providing 20-40% more data compared to GA4. 

    Sign up for a 21-day free trial and see how Matomo can support your financial services SEO strategy. No credit card required.

  • Segmentation Analytics : How to Leverage It on Your Site

    27 octobre 2023, par Erin — Analytics Tips

    The deeper you go with your customer analytics, the better your insights will be.

    The result ? Your marketing performance soars to new heights.

    Customer segmentation is one of the best ways businesses can align their marketing strategies with an effective output to generate better results. Marketers know that targeting the right people is one of the most important aspects of connecting with and converting web visitors into customers.

    By diving into customer segmentation analytics, you’ll be able to transform your loosely defined and abstract audience into tangible, understandable segments, so you can serve them better.

    In this guide, we’ll break down customer segmentation analytics, the different types, and how you can delve into these analytics on your website to grow your business.

    What is customer segmentation ?

    Before we dive into customer segmentation analytics, let’s take a step back and look at customer segmentation in general. 

    Customer segmentation is the process of dividing your customers up into different groups based on specific characteristics.

    These groups could be based on demographics like age or location or behaviours like recent purchases or website visits. 

    By splitting your audience into different segments, your marketing team will be able to craft highly targeted and relevant marketing campaigns that are more likely to convert.

    Additionally, customer segmentation allows businesses to gain new insights into their audience. For example, by diving deep into different segments, marketers can uncover pain points and desires, leading to increased conversion rates and return on investment.

    But, to grasp the different customer segments, organisations need to know how to collect, digest and interpret the data for usable insights to improve their business. That’s where segmentation analytics comes in.

    What is customer segmentation analytics ?

    Customer segmentation analytics splits customers into different groups within your analytics software to create more detailed customer data and improve targeting.

    What is segmentation analytics?

    With customer segmentation, you’re splitting your customers into different groups. With customer segmentation analytics, you’re doing this all within your analytics platform so you can understand them better.

    One example of splitting your customers up is by country. For example, let’s say you have a global customer base. So, you go into your analytics software and find that 90% of your website visitors come from five countries : the UK, the US, Australia, Germany and Japan.

    In this area, you could then create customer segmentation subsets based on these five countries. Moving forward, you could then hop into your analytics tool at any point in time and analyse the segments by country. 

    For example, if you wanted to see how well your recent marketing campaign impacted your Japanese customers, you could look at your Japanese subset within your analytics and dive into the data.

    The primary goal of customer segmentation analytics is to gather actionable data points to give you an in-depth understanding of your customers. By gathering data on your different audience segments, you’ll discover insights on your customers that you can use to optimise your website, marketing campaigns, mobile apps, product offerings and overall customer experience.

    Rather than lumping your entire customer base into a single mass, customer segmentation analytics allows you to meet even more specific and relevant needs and pain points of your customers to serve them better.

    By allowing you to “zoom in” on your audience, segmentation analytics helps you offer more value to your customers, giving you a competitive advantage in the marketplace.

    5 types of segmentation

    There are dozens of different ways to split up your customers into segments. The one you choose depends on your goals and marketing efforts. Each type of segmentation offers a different view of your customers so you can better understand their specific needs to reach them more effectively.

    While you can segment your customers in almost endless ways, five common types the majority fall under are :

    5 Types of Segmentation

    Geographic

    Another way to segment is by geography.

    This is important because you could have drastically different interests, pain points and desires based on where you live.

    If you’re running a global e-commerce website that sells a variety of clothing products, geographic segmentation can play a crucial role in optimising your website.

    For instance, you may observe that a significant portion of your website visitors are from countries in the Southern Hemisphere, where it’s currently summer. On the other hand, visitors from the Northern Hemisphere are experiencing winter. Utilising this information, you can tailor your marketing strategy and website accordingly to increase sells.

    Where someone comes from can significantly impact how they will respond to your messaging, brand and offer.

    Geographic segmentation typically includes the following subtypes :

    • Cities (i.e., Austin, Paris, Berlin, etc.)
    • State (i.e., Massachusetts)
    • Country (i.e., Thailand)

    Psychographic

    Another key segmentation type of psychographic. This is where you split your customers into different groups based on their lifestyles.

    Psychographic segmentation is a method of dividing your customers based on their habits, attitudes, values and opinions. You can unlock key emotional elements that impact your customers’ purchasing behaviours through this segmentation type.

    Psychographic segmentation typically includes the following subtypes :

    • Values
    • Habits
    • Opinions

    Behavioural

    While psychographic segmentation looks at your customers’ overall lifestyle and habits, behavioural segmentation aims to dive into the specific individual actions they take daily, especially when interacting with your brand or your website.

    Your customers won’t all interact with your brand the same way. They’ll act differently when interacting with your products and services for several reasons. 

    Behavioural segmentation can help reveal certain use cases, like why customers buy a certain product, how often they buy it, where they buy it and how they use it.

    By unpacking these key details about your audience’s behaviour, you can optimise your campaigns and messaging to get the most out of your marketing efforts to reach new and existing customers.

    Behavioural segmentation typically includes the following subtypes :

    • Interactions
    • Interests
    • Desires

    Technographic

    Another common segmentation type is technographic segmentation. As the name suggests, this technologically driven segment seeks to understand how your customers use technology.

    While this is one of the newest segmentation types marketers use, it’s a powerful method to help you understand the types of tech your customers use, how often they use it and the specific ways they use it.

    Technographic segmentation typically includes the following subtypes :

    • Smartphone type
    • Device type : smartphone, desktop, tablet
    • Apps
    • Video games

    Demographic

    The most common approach to segmentation is to split your customers up by demographics. 

    Demographic segmentation typically includes subtypes like language, job title, age or education.

    This can be helpful for tailoring your content, products, and marketing efforts to specific audience segments. One way to capture this information is by using web analytics tools, where language is often available as a data point.

    However, for accurate insights into other demographic segments like job titles, which may not be available (or accurate) in analytics tools, you may need to implement surveys or add fields to forms on your website to gather this specific information directly from your visitors.

    How to build website segmentation analytics

    With Matomo, you can create a variety of segments to divide your website visitors into different groups. Matomo’s Segments allows you to view segmentation analytics on subsets of your audience, like :

    • The device they used while visiting your site
    • What channel they entered your site from
    • What country they are located
    • Whether or not they visited a key page of your website
    • And more

    While it’s important to collect general data on every visitor you have to your website, a key to website growth is understanding each type of visitor you have.

    For example, here’s a screenshot of how you can segment all of your website’s visitors from New Zealand :

    Matomo Dashboard of Segmentation by Country

    The criteria you use to define these segments are based on the data collected within your web analytics platform.

    Here are some popular ways you can create some common themes on Matomo that can be used to create segments :

    Visit based segments

    Create segments in Matomo based on visitors’ patterns. 

    For example :

    • Do returning visitors show different traits than first-time visitors ?
    • Do people who arrive on your blog experience your website differently than those arriving on a landing page ?

    This information can inform your content strategy, user interface design and marketing efforts.

    Demographic segments

    Create segments in Matomo based on people’s demographics. 

    For example :

    • User’s browser language
    • Location

    This can enable you to tailor your approach to specific demographics, improving the performance of your marketing campaigns.

    Technographic segments

    Create segments in Matomo based on people’s technographics. 

    For example :

    • Web browser being used (i.e., Chrome, Safari, Firefox, etc.)
    • Device type (i.e., smartphone, tablet, desktop)

    This can inform how to optimise your website based on users’ technology preferences, enhancing the effectiveness of your website.

    Interaction based segments

    Create segments in Matomo based on interactions. 

    For example :

    • Events (i.e., when someone clicks a specific URL on your website)
    • Goals (i.e., when someone stays on your site for a certain period)

    Insights from this can empower you to fine-tune your content and user experience for increasing conversion rates.

    Visitor Profile in Matomo
    Visitor profile view in Matomo with behavioural, location and technographic insights

    Campaign-based segments

    Create segments in Matomo based on campaigns. 

    For example :

    • Visitors arriving from specific traffic sources
    • Visitors arriving from specific advertising campaigns

    With these insights, you can assess the performance of your marketing efforts, optimise your ad spend and make data-driven decisions to enhance your campaigns for better results.

    Ecommerce segments

    Create segments in Matomo based on ecommerce

    For example :

    • Visitors who purchased vs. those who didn’t
    • Visitors who purchased a specific product

    This allows you to refine your website and marketing strategy for increased conversions and revenue.

    Leverage Matomo for your segmentation analytics

    By now, you can see the power of segmentation analytics and how they can be used to understand your customers and website visitors better. By breaking down your audience into groups, you’ll be able to gain insights into those segments to know how to serve them better with improved messaging and relevant products.

    If you’re ready to begin using segmentation analytics on your website, try Matomo. Start your 21-day free trial now — no credit card required.

    Matomo is an ideal choice for marketers looking for an easy-to-use, out-of-the-box web analytics solution that delivers accurate insights while keeping privacy and compliance at the forefront.

  • How to Crop the visible portion of landscape video in android ?

    30 août 2016, par Deepak
    1. I am working on Panning and cropping the landscape video using Texture View.I am in a half way that I can pan the landscape video from left to right vice versa by using this example
      https://github.com/crust87/Android-VideoCropView.

    enter image description here

    enter image description here

    1. FFMPEG can crop the particular portion of the video by using this command
      ffmpeg -i /sdcard/videokit/in.mp4 -filter:v crop=720:1088:0:0 -c:a
      copy /sdcard/videokit/out.mp4

    How can I crop only the video which is visible in Texture View and save it local storage in Android.

    crop=720:1088:0:0 is a hard coded width and height of the video and it is cropping fine.But how can I get the width and height of the visible video in Texture View to crop the visible video and Save it to the local storage in android.

    public class MainActivity extends Activity {

       // Layout Components
       private FrameLayout top_frame;

       // Attributes
       private String originalPath;
       @Override
       protected void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.check);
           top_frame = (FrameLayout)findViewById(R.id.top_frame);
       }

       @Override
       protected void onActivityResult(int requestCode, int resultCode, Intent data) {
           if (requestCode == 1000 && resultCode == RESULT_OK) {
               final VideoCropView mVideoCropView = new VideoCropView(this);
               mVideoCropView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {

                   @Override
                   public void onPrepared(MediaPlayer mp) {
                       mVideoCropView.start();
                   }
               });
               top_frame.addView(mVideoCropView);
               Uri selectedVideoUri = data.getData();

               originalPath = getRealPathFromURI(selectedVideoUri);

               mVideoCropView.setVideoURI(selectedVideoUri);

               mVideoCropView.seekTo(1);
           }
       }

       public void onButtonLoadClick(View v) {
           top_frame.removeAllViews();
           Intent lIntent = new Intent(Intent.ACTION_PICK);
           lIntent.setType("video/*");
           lIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
           startActivityForResult(lIntent, 1000);
       }

       public String getRealPathFromURI(Uri contentUri) {    // getting image path from gallery.
           Cursor cursor = null;
           try {
               String[] proj = { MediaStore.Images.Media.DATA };
               cursor = getApplicationContext().getContentResolver().query(contentUri, proj, null, null, null);
               int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
               cursor.moveToFirst();
               return cursor.getString(column_index);
           } finally {
               if (cursor != null) {
                   cursor.close();
               }
           }
       }

    }

    CropVideoView

    public class VideoCropView extends TextureView implements MediaPlayerControl {
       // Constants
       private static final String LOG_TAG = "VideoCropView";
       private static final int STATE_ERROR = -1;
       private static final int STATE_IDLE = 0;
       private static final int STATE_PREPARING = 1;
       private static final int STATE_PREPARED = 2;
       private static final int STATE_PLAYING = 3;
       private static final int STATE_PAUSED = 4;
       private static final int STATE_PLAYBACK_COMPLETED = 5;

       // MediaPlayer Components
       protected Context mContext;
       private MediaPlayer mMediaPlayer;
       private Surface mSurface;
       private OnInfoListener mOnInfoListener;
       private OnCompletionListener mOCompletionListener;
       private OnErrorListener mOnErrorListener;
       private OnPreparedListener mOnPreparedListener;
       private OnTranslatePositionListener mOnTranslatePositionListener;

       // CropView Components
       private Matrix mMatrix;

       // MediaPlayer Attributes
       protected Uri mUri;
       private int mCurrentBufferPercentage;
       private int mSeekWhenPrepared;
       protected int mVideoWidth;
       protected int mVideoHeight;

       // CropView Attributes
       private float mRatioWidth;
       private float mRatioHeight;
       private float mPositionX;
       private float mPositionY;
       private float mBoundX;
       private float mBoundY;
       private int mRotate;
       private float mScaleX;
       private float mScaleY;
       private float mScale;

       // Working Variables
       private int mCurrentState = STATE_IDLE;
       private int mTargetState = STATE_IDLE;

       // Touch Event
       // past position x, y and move point
       float mPastX;
       float mPastY;
       float mTouchDistance;
       private Context context;

       // Constructors
       public VideoCropView(final Context context) {
           super(context);
           mContext = context;

           initAttributes();
           initVideoView();
       }

       public VideoCropView(final Context context, final AttributeSet attrs) {
           super(context, attrs);
           mContext = context;

           initAttributes(context, attrs, 0);
           initVideoView();
       }

       public VideoCropView(Context context, AttributeSet attrs, int defStyleAttr) {
           super(context, attrs, defStyleAttr);
           mContext = context;

           initAttributes(context, attrs, defStyleAttr);
           initVideoView();
       }

       private void initAttributes() {
           mRatioWidth = 1;
           mRatioHeight = 1;
       }

       private void initAttributes(Context context, AttributeSet attrs, int defStyleAttr) {
           TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.VideoCropView, defStyleAttr, 0);

           mRatioWidth = typedArray.getInteger(R.styleable.VideoCropView_ratio_width, 3);
           mRatioHeight = typedArray.getInteger(R.styleable.VideoCropView_ratio_height, 4);
       }

       @Override
       protected void onMeasure(final int widthMeasureSpec, final int heightMeasureSpec) {
           int heightLayout;
           int widthLayout;
           widthLayout = MeasureSpec.getSize(widthMeasureSpec);
           heightLayout = MeasureSpec.getSize(heightMeasureSpec);
           setMeasuredDimension(widthLayout, heightLayout);

           /*if(widthMeasureSpec < heightMeasureSpec){

               int width = MeasureSpec.getSize(widthMeasureSpec);
               int height = (int) ((width / mRatioWidth) * mRatioHeight);


               setMeasuredDimension(width, height);

           }else{

               int width = MeasureSpec.getSize(widthMeasureSpec);
               int height =MeasureSpec.getSize(heightMeasureSpec);
               setMeasuredDimension(width, height);

           }
    */
       }

       @Override
       public boolean onTouchEvent(MotionEvent event) {
           if(mCurrentState == STATE_ERROR || mCurrentState == STATE_IDLE || mCurrentState == STATE_PREPARING) {
               return false;
           }

           switch (event.getAction()) {
               case MotionEvent.ACTION_DOWN:
                   mPastX = event.getX();
                   mPastY = event.getY();
                   mTouchDistance = 0;
               case MotionEvent.ACTION_MOVE:
                   if(mBoundX!=0 || mBoundY!=0) {
                       float dx = event.getX() - mPastX;
                       float dy = event.getY() - mPastY;
                       updateViewPosition(dx, dy);
                       mPastX = event.getX();
                       mPastY = event.getY();
                       mTouchDistance += (Math.abs(dx) + Math.abs(dy));
                   }
                   break;
               case MotionEvent.ACTION_UP:
                   if (mTouchDistance < 25) {
                       if (isPlaying()) {
                           pause();
                       } else {
                           start();
                       }
                   }

                   mTouchDistance = 0;
                   break;
           }

           return true;
       }

       @Override
       public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
           super.onInitializeAccessibilityEvent(event);
           event.setClassName(VideoView.class.getName());
       }

       @Override
       public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
           super.onInitializeAccessibilityNodeInfo(info);
           info.setClassName(VideoView.class.getName());
       }

       public int resolveAdjustedSize(int desiredSize, int measureSpec) {
           Log.d(LOG_TAG, "Resolve called.");
           int result = desiredSize;
           int specMode = MeasureSpec.getMode(measureSpec);
           int specSize = MeasureSpec.getSize(measureSpec);

           switch (specMode) {
               case MeasureSpec.UNSPECIFIED:
               /*
                * Parent says we can be as big as we want. Just don't be larger
                * than max size imposed on ourselves.
                */
                   result = desiredSize;
                   break;

               case MeasureSpec.AT_MOST:
               /*
                * Parent says we can be as big as we want, up to specSize. Don't be
                * larger than specSize, and don't be larger than the max size
                * imposed on ourselves.
                */
                   result = Math.min(desiredSize, specSize);
                   break;

               case MeasureSpec.EXACTLY:
                   // No choice. Do what we are told.
                   result = specSize;
                   break;
           }
           return result;
       }

       public void initVideoView() {

           mVideoHeight = 0;
           mVideoWidth = 0;
           setFocusable(false);
           setSurfaceTextureListener(mSurfaceTextureListener);
           mCurrentState = STATE_IDLE;
           mTargetState = STATE_IDLE;

       }

       public void setVideoPath(String path) {
           if (path != null) {
               setVideoURI(Uri.parse(path));
           }
       }

       public void setVideoURI(Uri pVideoURI) {
           mUri = pVideoURI;
           mSeekWhenPrepared = 0;

           MediaMetadataRetriever retriever = new MediaMetadataRetriever();
           retriever.setDataSource(mContext, pVideoURI);

           // create thumbnail bitmap
           if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
               String rotation = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION);

               try {
                   mRotate = Integer.parseInt(rotation);
               } catch(NumberFormatException e) {
                   mRotate = 0;
               }
           }

           retriever.release();

           openVideo();
           requestLayout();
           invalidate();
       }

       public void stopPlayback() {
           if (mMediaPlayer != null) {
               mMediaPlayer.stop();
               mMediaPlayer.release();
               mMediaPlayer = null;
               mCurrentState = STATE_IDLE;
               mTargetState = STATE_IDLE;
           }
       }

       public void openVideo() {
           if ((mUri == null) || (mSurface == null)) {
               // not ready for playback just yet, will try again later
               return;
           }
           // Tell the music playback service to pause
           // TODO: these constants need to be published somewhere in the
           // framework.
           Intent intent = new Intent("com.android.music.musicservicecommand");
           intent.putExtra("command", "pause");
           mContext.sendBroadcast(intent);

           // we shouldn't clear the target state, because somebody might have
           // called start() previously
           release(false);
           try {
               mMediaPlayer = new MediaPlayer();
               // TODO: create SubtitleController in MediaPlayer, but we need
               // a context for the subtitle renderers

               mMediaPlayer.setOnPreparedListener(mPreparedListener);
               mMediaPlayer.setOnVideoSizeChangedListener(mSizeChangedListener);
               mMediaPlayer.setOnCompletionListener(mCompletionListener);
               mMediaPlayer.setOnErrorListener(mErrorListener);
               mMediaPlayer.setOnInfoListener(mInfoListener);
               mMediaPlayer.setOnBufferingUpdateListener(mBufferingUpdateListener);
               mCurrentBufferPercentage = 0;
               mMediaPlayer.setDataSource(mContext, mUri);
               mMediaPlayer.setSurface(mSurface);
               mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);

               mMediaPlayer.setScreenOnWhilePlaying(true);
               mMediaPlayer.prepareAsync();
               mMediaPlayer.setLooping(true);
               mCurrentState = STATE_PREPARING;
           } catch (IllegalStateException e) {
               mCurrentState = STATE_ERROR;
               mTargetState = STATE_ERROR;
               e.printStackTrace();
           } catch (IOException e) {
               mCurrentState = STATE_ERROR;
               mTargetState = STATE_ERROR;
               e.printStackTrace();
           }
       }

       private OnVideoSizeChangedListener mSizeChangedListener = new OnVideoSizeChangedListener() {
           @Override
           public void onVideoSizeChanged(final MediaPlayer mp, final int width,
                                          final int height) {
               mVideoWidth = mp.getVideoWidth();
               mVideoHeight = mp.getVideoHeight();

               if (mVideoWidth != 0 && mVideoHeight != 0) {
                   requestLayout();
                   if(mVideoWidth >= mVideoHeight)
                   initVideo();
               }
           }
       };

       private OnPreparedListener mPreparedListener = new OnPreparedListener() {
           @Override
           public void onPrepared(final MediaPlayer mp) {
               mCurrentState = STATE_PREPARED;

               if (mOnPreparedListener != null) {
                   mOnPreparedListener.onPrepared(mp);
               }

               mVideoWidth = mp.getVideoWidth();
               mVideoHeight = mp.getVideoHeight();

               int seekToPosition = mSeekWhenPrepared; // mSeekWhenPrepared may be
               // changed after seekTo()
               if (seekToPosition != 0) {
                   seekTo(seekToPosition);
               }

               if ((mVideoWidth != 0) && (mVideoHeight != 0)) {
                   if(mVideoWidth >= mVideoHeight) initVideo();

                   if (mTargetState == STATE_PLAYING) {
                       start();
                   }
               } else {
                   // We don't know the video size yet, but should start anyway.
                   // The video size might be reported to us later.
                   if (mTargetState == STATE_PLAYING) {
                       start();
                   }
               }
           }
       };

       private OnCompletionListener mCompletionListener = new OnCompletionListener() {
           @Override
           public void onCompletion(final MediaPlayer mp) {
               mCurrentState = STATE_PLAYBACK_COMPLETED;
               mTargetState = STATE_PLAYBACK_COMPLETED;

               if (mOCompletionListener != null) {
                   mOCompletionListener.onCompletion(mMediaPlayer);
               }
           }
       };

       private OnInfoListener mInfoListener = new OnInfoListener() {
           public boolean onInfo(MediaPlayer mp, int arg1, int arg2) {
               if (mOnInfoListener != null) {
                   mOnInfoListener.onInfo(mp, arg1, arg2);
               }
               return true;
           }
       };

       private OnErrorListener mErrorListener = new OnErrorListener() {
           @Override
           public boolean onError(MediaPlayer mp, int framework_err, int impl_err) {
               Log.d(LOG_TAG, "Error: " + framework_err + "," + impl_err);
               mCurrentState = STATE_ERROR;
               mTargetState = STATE_ERROR;

               /* If an error handler has been supplied, use it and finish. */
               if (mOnErrorListener != null) {
                   if (mOnErrorListener.onError(mMediaPlayer, framework_err,
                           impl_err)) {
                       return true;
                   }
               }
               return true;
           }
       };

       private OnBufferingUpdateListener mBufferingUpdateListener = new OnBufferingUpdateListener() {
           @Override
           public void onBufferingUpdate(final MediaPlayer mp, final int percent) {
               mCurrentBufferPercentage = percent;
           }
       };

       public void setOnPreparedListener(OnPreparedListener listener) {
           mOnPreparedListener = listener;
       }

       public void setOnCompletionListener(OnCompletionListener listener) {
           mOCompletionListener = listener;
       }

       public void setOnErrorListener(OnErrorListener listener) {
           mOnErrorListener = listener;
       }

       public void setOnInfoListener(OnInfoListener listener) {
           mOnInfoListener = listener;
       }

       private void release(boolean cleartargetstate) {
           if (mMediaPlayer != null) {
               mMediaPlayer.reset();
               mMediaPlayer.release();
               mMediaPlayer = null;
               mCurrentState = STATE_IDLE;
               if (cleartargetstate) {
                   mTargetState = STATE_IDLE;
               }
           }
       }

       @Override
       public void start() {
           if (isInPlaybackState()) {
               mMediaPlayer.start();
               mCurrentState = STATE_PLAYING;

           }
           mTargetState = STATE_PLAYING;
       }

       @Override
       public void pause() {
           if (isInPlaybackState()) {
               if (mMediaPlayer.isPlaying()) {
                   mMediaPlayer.pause();
                   mCurrentState = STATE_PAUSED;
               }
           }

           mTargetState = STATE_PAUSED;
       }

       @Override
       public int getDuration() {
           if (isInPlaybackState()) {
               return mMediaPlayer.getDuration();
           }

           return -1;
       }

       @Override
       public int getCurrentPosition() {
           if (isInPlaybackState()) {
               return mMediaPlayer.getCurrentPosition();
           }
           return 0;
       }

       @Override
       public void seekTo(int msec) {
           if (isInPlaybackState()) {
               mMediaPlayer.seekTo(msec);
               mSeekWhenPrepared = 0;
           } else {
               mSeekWhenPrepared = msec;
           }
       }

       @Override
       public boolean isPlaying() {
           return isInPlaybackState() && mMediaPlayer.isPlaying();
       }

       @Override
       public int getBufferPercentage() {
           if (mMediaPlayer != null) {
               return mCurrentBufferPercentage;
           }
           return 0;
       }

       private boolean isInPlaybackState() {
           return (mMediaPlayer != null && mCurrentState != STATE_ERROR
                   && mCurrentState != STATE_IDLE && mCurrentState != STATE_PREPARING);
       }

       @Override
       public boolean canPause() {
           return false;
       }

       @Override
       public boolean canSeekBackward() {
           return false;
       }

       @Override
       public boolean canSeekForward() {
           return false;
       }

       @Override
       public int getAudioSessionId() {
           return -1;
       }

       SurfaceTextureListener mSurfaceTextureListener = new SurfaceTextureListener() {
           @Override
           public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
               mSurface = new Surface(surface);
               openVideo();
           }

           @Override
           public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) {
               boolean isValidState = (mTargetState == STATE_PLAYING);
               boolean hasValidSize = (mVideoWidth == width && mVideoHeight == height);
               if (mMediaPlayer != null && isValidState && hasValidSize) {
                   start();
               }
           }

           @Override
           public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
               if (mMediaPlayer != null) {
                   mMediaPlayer.reset();
                   mMediaPlayer.release();
                   mMediaPlayer = null;
               }

               if (mSurface != null) {
                   mSurface.release();
                   mSurface = null;
               }

               return true;
           }

           @Override
           public void onSurfaceTextureUpdated(final SurfaceTexture surface) {

           }
       };

       @Override
       protected void onVisibilityChanged(View changedView, int visibility) {
           super.onVisibilityChanged(changedView, visibility);

           if (visibility == View.INVISIBLE || visibility == View.GONE) {
               if (isPlaying()) {
                   stopPlayback();
               }
           }
       }

       public float getScale() {
           return mScale;
       }

       private void initVideo() {
           try {
                   int width = getWidth();
                   int height = getHeight();
                   mScaleX = 1.0f;
                   mScaleY = 1.0f;
                   mPositionX = 0;
                   mPositionY = 0;
                   mBoundX = 0;
                   mBoundY = 0;
                   mMatrix = new Matrix();

                   mScaleX = (float) mVideoWidth / width;
                   mScaleY = (float) mVideoHeight / height;

                   mBoundX = width - mVideoWidth / mScaleY;
                   mBoundY = height - mVideoHeight / mScaleX;

                   if (mScaleX < mScaleY) {
                       mScale = mScaleX;
                       mScaleY = mScaleY * (1.0f / mScaleX);
                       mScaleX = 1.0f;
                       mBoundX = 0;
                   } else {
                       mScale = mScaleY;
                       mScaleX = mScaleX * (1.0f / mScaleY);
                       mScaleY = 1.0f;
                       mBoundY = 0;
                   }

                   mMatrix = new Matrix();
                   mMatrix.setScale(mScaleX, mScaleY);
                   setTransform(mMatrix);
           } catch (NumberFormatException e) {
               e.printStackTrace();
           }
       }

       public void updateViewPosition(float x, float y) {

           float nextX = mPositionX + x;
           float nextY = mPositionY + y;

           if(mScaleX == 1.0f) {
               x = 0;
           } else {
               if(nextX > 0) {
                   x = -mPositionX;
                   mPositionX = mPositionX + x;
               } else if(nextX < mBoundX) {
                   x = mBoundX - mPositionX;
                   mPositionX = mPositionX + x;
               } else {
                   mPositionX = nextX;
               }
           }

           if(mScaleY == 1.0f) {
               y = 0;
           } else {
               if(nextY > 0) {
                   y = -mPositionY;
                   mPositionY = mPositionY + y;
               } else if(nextY < mBoundY) {
                   y = mBoundY - mPositionY;
                   mPositionY = mPositionY + y;
               } else {
                   mPositionY = nextY;
               }
           }

           if(mOnTranslatePositionListener != null) {
               mOnTranslatePositionListener.onTranslatePosition(mPositionX, mPositionY, mPositionX * -mScale, mPositionY * -mScale);
           }

           mMatrix.postTranslate(x, y);
           setTransform(mMatrix);
           invalidate();
       }

    //  public void setOriginalRatio() {
    //      if(mVideoWidth != 0 && mVideoHeight != 0) {
    //          int gcd = gcd(mVideoWidth, mVideoHeight);
    //          setRatio(mVideoWidth / gcd, mVideoHeight / gcd);
    //      }
    //  }

       public int gcd(int n, int m) {
           while (m != 0) {
               int t = n % m;
               n = m;
               m = t;
           }

           return Math.abs(n);
       }

    //  public void setRatio(float ratioWidth, float ratioHeight) {
    //      mRatioWidth = ratioWidth;
    //      mRatioHeight = ratioHeight;
    //
    //      int seek = getCurrentPosition();
    //
    //      requestLayout();
    //      invalidate();
    //      openVideo();
    //
    //      seekTo(seek);
    //  }


       public float getRatioWidth() {
           return mRatioWidth;
       }

       public float getRatioHeight() {
           return mRatioHeight;
       }

       public float getRealPositionX() {
           return mPositionX * -mScale;
       }

       public float getRealPositionY() {
           return mPositionY * -mScale;
       }

       public int getVideoWidth() {
           return mVideoWidth;
       }

       public int getVideoHeight() {
           return mVideoHeight;
       }

       public int getRotate() {
           return mRotate;
       }

       public void setOnTranslatePositionListener(OnTranslatePositionListener pOnTranslatePositionListener) {
           mOnTranslatePositionListener = pOnTranslatePositionListener;
       }

       public void setContext(Context context) {
           this.context = context;
       }

       public interface OnTranslatePositionListener {
           public abstract void onTranslatePosition(float x, float y, float rx, float ry);
       }
    }

    FFMPEG for cropping particular portion

    ffmpeg -i /sdcard/videokit/in.mp4 -filter:v crop=720:1088:0:0 -c:a copy /sdcard/videokit/out.mp4

    public class SimpleExample extends Activity {

       String workFolder = null;
       String demoVideoFolder = null;
       String demoVideoPath = null;
       String vkLogPath = null;
       private boolean commandValidationFailedFlag = false;


       @Override
       public void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.ffmpeg_demo_client_1);

           demoVideoFolder = Environment.getExternalStorageDirectory().getAbsolutePath() + "/videokit/";
           demoVideoPath = demoVideoFolder + "in.mp4";

           Log.i(Prefs.TAG, getString(R.string.app_name) + " version: " + GeneralUtils.getVersionName(getApplicationContext()) );
           workFolder = getApplicationContext().getFilesDir().getAbsolutePath() + "/";
           //Log.i(Prefs.TAG, "workFolder: " + workFolder);
           vkLogPath = workFolder + "vk.log";

           GeneralUtils.copyLicenseFromAssetsToSDIfNeeded(this, workFolder);
           GeneralUtils.copyDemoVideoFromAssetsToSDIfNeeded(this, demoVideoFolder);

           Button invoke =  (Button)findViewById(R.id.invokeButton);
           invoke.setOnClickListener(new OnClickListener() {
               public void onClick(View v){
                   Log.i(Prefs.TAG, "run clicked.");
                   if (GeneralUtils.checkIfFileExistAndNotEmpty(demoVideoPath)) {
                       new TranscdingBackground(SimpleExample.this).execute();
                   }
                   else {
                       Toast.makeText(getApplicationContext(), demoVideoPath + " not found", Toast.LENGTH_LONG).show();
                   }
               }
           });

           int rc = GeneralUtils.isLicenseValid(getApplicationContext(), workFolder);
           Log.i(Prefs.TAG, "License check RC: " + rc);
       }

       public class TranscdingBackground extends AsyncTask
       {

           ProgressDialog progressDialog;
           Activity _act;
           String commandStr;

           public TranscdingBackground (Activity act) {
               _act = act;
           }



           @Override
           protected void onPreExecute() {
               EditText commandText = (EditText)findViewById(R.id.CommandText);
               commandStr = commandText.getText().toString();

               progressDialog = new ProgressDialog(_act);
               progressDialog.setMessage("FFmpeg4Android Transcoding in progress...");
               progressDialog.show();

           }

           protected Integer doInBackground(String... paths) {
               Log.i(Prefs.TAG, "doInBackground started...");

               // delete previous log
               boolean isDeleted = GeneralUtils.deleteFileUtil(workFolder + "/vk.log");
               Log.i(Prefs.TAG, "vk deleted: " + isDeleted);

               PowerManager powerManager = (PowerManager)_act.getSystemService(Activity.POWER_SERVICE);
               WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "VK_LOCK");
               Log.d(Prefs.TAG, "Acquire wake lock");
               wakeLock.acquire();

               ///////////// Set Command using code (overriding the UI EditText) /////
               //commandStr = "ffmpeg -y -i /sdcard/videokit/in.mp4 -strict experimental -s 320x240 -r 30 -aspect 3:4 -ab 48000 -ac 2 -ar 22050 -vcodec mpeg4 -b 2097152 /sdcard/videokit/out.mp4";
               //String[] complexCommand = {"ffmpeg", "-y" ,"-i", "/sdcard/videokit/in.mp4","-strict","experimental","-s", "160x120","-r","25", "-vcodec", "mpeg4", "-b", "150k", "-ab","48000", "-ac", "2", "-ar", "22050", "/sdcard/videokit/out.mp4"};
               ///////////////////////////////////////////////////////////////////////


               LoadJNI vk = new LoadJNI();
               try {


                   vk.run(GeneralUtils.utilConvertToComplex(commandStr), workFolder, getApplicationContext());




                   GeneralUtils.copyFileToFolder(vkLogPath, demoVideoFolder);


               } catch (Throwable e) {
                   Log.e(Prefs.TAG, "vk run exeption.", e);
               }
               finally {
                   if (wakeLock.isHeld())
                       wakeLock.release();
                   else{
                       Log.i(Prefs.TAG, "Wake lock is already released, doing nothing");
                   }
               }
               Log.i(Prefs.TAG, "doInBackground finished");
               return Integer.valueOf(0);
           }

           protected void onProgressUpdate(Integer... progress) {
           }

           @Override
           protected void onCancelled() {
               Log.i(Prefs.TAG, "onCancelled");
               //progressDialog.dismiss();
               super.onCancelled();
           }


           @Override
           protected void onPostExecute(Integer result) {
               Log.i(Prefs.TAG, "onPostExecute");
               progressDialog.dismiss();
               super.onPostExecute(result);

               // finished Toast
               String rc = null;
               if (commandValidationFailedFlag) {
                   rc = "Command Vaidation Failed";
               }
               else {
                   rc = GeneralUtils.getReturnCodeFromLog(vkLogPath);
               }
               final String status = rc;
               SimpleExample.this.runOnUiThread(new Runnable() {
                   public void run() {
                       Toast.makeText(SimpleExample.this, status, Toast.LENGTH_LONG).show();
                       if (status.equals("Transcoding Status: Failed")) {
                           Toast.makeText(SimpleExample.this, "Check: " + vkLogPath + " for more information.", Toast.LENGTH_LONG).show();
                       }
                   }
               });
           }

       }


    }