Giter Site home page Giter Site logo

happyroom99 / ffmpeg-tutorial Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mpenkov/ffmpeg-tutorial

0.0 2.0 0.0 127 KB

A set of tutorials that demonstrates how to write a video player based on FFmpeg

Home Page: http://www.ffmpeg.org/documentation.html

Makefile 0.70% C 99.30%

ffmpeg-tutorial's Introduction

ffmpeg-tutorial


The original tutorials have now been updated. I won't be maintaining this project anymore, and am keeping it here for historical reasons.


This repository contains files from an FFmpeg tutorial originally written by Stephen Dranger ([email protected]). The files have been updated to work with the most recent version of FFmpeg (see VERSION.txt for the most recent version at the time of writing). The updates were performed with an effort to modify as little code as possible, so that the original code and tutorial descriptions could be easily consulted.

The code from the original tutorial and the accompanying description is located here.

Main changes

  • Renamed includes, e.g. ffmpeg/avcodec.h --> libavcodec/avcodec.h
  • Work around deprecated functions and symbols (see below)
  • Initializing pointers to NULL on declaration. Some FFmpeg functions (e.g. avformat_open_input) now segfault when given uninitialized pointers as input.
  • Removed tutorial08.c, which introduced software scaling (as opposed to using the img_convert method). img_convert has been deprecated and is no longer available, so these new tutorials use software scaling from the very beginning, and a separate tutorial is not necessary.

Deprecated Functions and Symbols

This section describes the changes made to work around deprecated functions and symbols, in the format: before --> after. In some cases, a simple rename sufficed (e.g. dump_format), but in others, more significant changes to the code were required (e.g. avcodec_decode_audio2). Consult the diffs for each respective tutorial to see exactly what has changed since the original version of the tutorial.

  • av_open_input_file --> avformat_open_input
  • av_find_stream_info --> avformat_find_stream_info
  • dump_format --> av_dump_format
  • CODEC_TYPE_VIDEO --> AVMEDIA_TYPE_VIDEO
  • avcodec_open --> avcodec_open2
  • avcodec_decode_video --> avcodec_decode_video2
  • img_convert --> sws_scale
  • av_close_input_file --> avformat_close_input
  • avcodec_decode_audio2 --> avcodec_decode_audio4
  • CODEC_TYPE_AUDIO --> AVMEDIA_TYPE_AUDIO
  • url_set_interrupt_cb --> avio_open2
  • url_ferror --> check attribute is->pFormatCtx->pb->error
  • pstrcpy --> av_strlcpy

Building and Running

First, make sure you have a recent installation of FFmpeg. It's recommended that you build FFmpeg from source as described in this link.

To build the tutorials:

git clone [email protected]:chelyaev/ffmpeg-tutorial.git
cd ffmpeg-tutorial
make

To run a tutorial, first make sure that your ffmpeg installation is on your $LD_LIBRARY_PATH and then:

bin/tutorial01.out

ffmpeg-tutorial's People

Contributors

mpenkov avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.