Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • How to extract raw YUV files from MPEG2 TS file ?

    11 septembre 2012, par Wang Wei

    I have a 1920x1080 mpeg2 .ts file. I need to get the raw YUV files for each frame. I tried ffmpeg but no luck. I end up with many small files. I expect each frame to be 1920x1080x1.5 = 3110400 Bytes.

    [root@dwarch frames]# ffmpeg -i video.ts -f image2 foo-%03d.yuv
    FFmpeg version git-N-28713-g65daa94, Copyright (c) 2000-2011 the FFmpeg developers
      built on Mar 30 2011 09:20:16 with gcc 4.6.0
      configuration: --prefix=/usr --enable-gpl --enable-libmp3lame --enable-libvorbis --enable-libfaac --enable-libxvid --enable-libx264 --enable-libvpx --enable-libtheora --enable-postproc --enable-shared --enable-x11grab --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libschroedinger --enable-libopenjpeg --enable-version3 --enable-nonfree --enable-runtime-cpudetect --disable-debug
      libavutil    50. 40. 0 / 50. 40. 0
      libavcodec   52.116. 0 / 52.116. 0
      libavformat  52.104. 0 / 52.104. 0
      libavdevice  52.  4. 0 / 52.  4. 0
      libavfilter   1. 76. 0 /  1. 76. 0
      libswscale    0. 13. 0 /  0. 13. 0
      libpostproc  51.  2. 0 / 51.  2. 0
    Input #0, mpegts, from 'video.ts':
      Duration: 00:04:51.58, start: 0.333333, bitrate: 36041 kb/s
      Program 10 
        Stream #0.0[0x20]: Video: mpeg2video (Main), yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 35000 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
        Stream #0.1[0x21]: Audio: ac3, 48000 Hz, 5.1, s16, 224 kb/s
    Incompatible pixel format 'yuv420p' for codec 'mjpeg', auto-selecting format 'yuvj420p'
    [buffer @ 0x97148c0] w:1920 h:1080 pixfmt:yuv420p
    [setdar @ 0x9714df0] a:16/9
    [setdar @ 0x9714df0] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'Parsed filter 0 setdar'
    [scale @ 0x9711db0] w:1920 h:1080 fmt:yuv420p -> w:1920 h:1080 fmt:yuvj420p flags:0x4
    [setdar @ 0x9714df0] w:1920 h:1080 -> dar:16/9 sar:1/1
    Output #0, image2, to 'foo-%03d.yuv':
      Metadata:
        encoder         : Lavf52.104.0
        Stream #0.0: Video: mjpeg, yuvj420p, 1920x1080 [PAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 23.98 tbc
    Stream mapping:
      Stream #0.0 -> #0.0
    
  • Building FFmpeg for android to run command line args

    11 septembre 2012, par Zargoon

    I am trying to build the FFmpeg library to use in my android app with the NDK. The reason for this is because I am using the native video capture feature in android because I really don't want to write my own video recorder. However, the native video capture only allows for either high-quality encoding, or low quality encoding. I want something in between, and I believe that the solution is to use the FFmpeg library to re-encode the high quality video to be lighter.

    So far I have been able to build the FFmpeg library according to this guide: http://www.roman10.net/how-to-build-ffmpeg-for-android/ and which a few tweaks I have been able to get it to work.

    However, everything that I've found seems to be about writing your own encoder, which seems like overkill to me. All that I really want to do is send a string in command line format to the main() function of FFmpeg and re-encode my video. However, I can't seem to figure out how I build FFmpeg to give me access to the main method. I found this post: Compile ffmpeg.c and call its main() via JNI which links to a project doing what I want more of less, but for the life of me I cannot figure out what is going on. It also seems like he is compiling more than I want, and I would really like to keep my application as light weight as possible.

    Some additional direction would be extremely helpful. Thank you.

  • Ffprobe with print json doesn't print anything

    10 septembre 2012, par Richard Knop

    I am trying to get information about a movie (resolution, frame rate, bit rate, codecs, duration etc) in a human readable way. I found this commnad:

    ffprobe -v quiet -print_format json -show_format -show_streams somefile.asf
    

    In this Stack Overflow question: Get ffmpeg information in friendly way

    But it doesn't work for me. When I try it in a terminal, the output is empty:

    richard@richard-desktop:~/projects/hello-python$ ffprobe -v quiet -print_format json -show_format -show_streams tests/test_1.mpg 
    richard@richard-desktop:~/projects/hello-python$ 
    
  • ffmpeg SDP file for Darwin Streaming Server

    10 septembre 2012, par SP Sandhu

    I am making a streaming server to view live video feed of my webcam on my mobile device.

    I considered using ffmpeg , VLC and DSS and made the following setup that worked somewhat, though the frames were skipped :-

    video4linux2 > ffserver > VLC transcoding > DSS

    (RAW to ffserver) > (outputs to SDP link) > (SDP link to SDP file) > (SDP file to live streaming to mobile)

    Later, on testing VLC i found to be very inefficient and slow on my Netbook(Intel Atom N480) as it skips lot of frames.

    DSS can stream a SDP file from its /usr/local/movies(default).

    And at the same time, ffmpeg's ffserver module can stream live feed to SDP link(not SDP file).

    My requirement is that i need to create SDP file in DSS's /usr/local/movies directory so as to pass this DSS for streaming.

    So, how to create a sdp file from ffmpeg or how to create SDP file from SDP link (without using VLC's trans-coding).

    How to do that ?

  • ffmpeg : scale output cropped width/height doesn't work

    10 septembre 2012, par Meir Gerenstadt

    I'm trying to crop video frames with ffmpeg, and I would like to scale the cropped image automatically. I saw an option at av filter: http://ffmpeg.org/libavfilter.html#SEC41

    ./ffmpeg -i video.mp4 -vf "crop=640:480,scale=ow:oh" -f mpegts udp://127.0.0.1:1234

    I receive an error: Error when evaluating the expression 'oh'