Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • FFMPEG [SHELL CMD] cutting last x frames [SHELL CMD] combining videos

    25 avril 2014, par user1708604

    .mp4 videos in 1920 x 1080, 25 frames / second different length

    Two commands needed:

    0) One command should delete x frames from the end of the video and create a new video without the last x frames as .mp4, save it in folder y 1) One command should combine x amount of videos to one new video

    Just for info: I am using Python to call ffmpeg. Platform: Windows or CentOS.

    Many thanks in advance. :)

  • openRTSP TCP 100% Cpu

    25 avril 2014, par user1199722

    First thanks for the great work for live media group. I am currently facing a problem with OpenRTSP utilizing cpu 100%. I am using the following commands to stream from remote ipcamera through internet. It works fine with local cameras. But when I try to stream from Internet IP camera (720p), At random times openRTSP start uses 100% cpu and stops output of streaming. The process is not exiting it stay with 100% cpu.

    I have observed that stream stops with a series of "c9c99c999......." I am using TCP streaming of rtsp. Please find the command that i am using.

    openRTSP -d 60 -v -t -c -b 800000 | ~/bin/ffmpeg -r 15 -i - -codec copy -hls_list_size 65535 -hls_time 5

    Please provide your suggestions regarding the problem Waiting for your valuable pointers.

  • Encode video for ipod classic

    25 avril 2014, par mulllhausen

    I just finished installing ffmpeg on debian wheezy using these instructions - http://trac.ffmpeg.org/wiki/UbuntuCompilationGuide. Now I want to encode a video to play on my iPod classic. The video has the following info:

    $ mediainfo in.mp4 
    General
    Complete name                            : in.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media / Version 2
    Codec ID                                 : mp42
    File size                                : 1.21 GiB
    Duration                                 : 55mn 10s
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 3 130 Kbps
    Encoded date                             : UTC 2010-08-25 23:38:59
    Tagged date                              : UTC 2010-08-25 23:38:59
    
    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L3.2
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 2 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 55mn 10s
    Bit rate mode                            : Variable
    Bit rate                                 : 3 000 Kbps
    Maximum bit rate                         : 5 000 Kbps
    Width                                    : 1 280 pixels
    Height                                   : 720 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Constant
    Frame rate                               : 29.970 fps
    Standard                                 : NTSC
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.109
    Stream size                              : 1.16 GiB (96%)
    Language                                 : English
    Encoded date                             : UTC 2010-07-21 13:28:49
    Tagged date                              : UTC 2010-07-21 13:28:49
    Color primaries                          : BT.709-5, BT.1361, IEC 61966-2-4, SMPTE RP177
    Transfer characteristics                 : BT.709-5, BT.1361
    Matrix coefficients                      : BT.709-5, BT.1361, IEC 61966-2-4 709, SMPTE RP177
    
    Audio
    ID                                       : 2
    Format                                   : AAC
    Format/Info                              : Advanced Audio Codec
    Format profile                           : LC
    Codec ID                                 : 40
    Duration                                 : 55mn 10s
    Bit rate mode                            : Variable
    Bit rate                                 : 125 Kbps
    Maximum bit rate                         : 270 Kbps
    Channel(s)                               : 2 channels
    Channel positions                        : Front: L R
    Sampling rate                            : 44.1 KHz
    Compression mode                         : Lossy
    Stream size                              : 49.4 MiB (4%)
    Language                                 : English
    Encoded date                             : UTC 2010-07-21 13:28:49
    Tagged date                              : UTC 2010-07-21 13:28:49
    mdhd_Duration                            : 3310353
    

    I have already tried just copying the video to the IPod with banshee but the video just shows a black screen. Which is the best format to play the video on the Ipod? What ffmpeg parameters should I use? I would like to maximize resolution while minimizing file size.

  • rtp decoding issue on p frames

    24 avril 2014, par user3569521

    I am streaming an rtsp stream from an IP camera. I have a parser which packages the data into frames based on the rtp payload type. The parser is able to process I frames since these contain the start of frame and end of frame packets, as well as packets in between (this is FU-A payload type).

    These are combined to create a complete frame. The problem comes in when I try to construct P frames, from the wireshark dump some of these appear to be fragmented (FU-A payload type) these contain the start of frame and end of frame packets, however these do not contain packets in between. Also in some instances the camera sends strange marked packets with a payload type 1, this according to my understanding should be a complete frame.

    Upon processing these two versions of P frames I then use ffmpeg to attempt to decode the frames, I receive errors messages like top block unavailable for intra mode 4x4.

    At first I thought this could be due to an old ffmpeg version but I searched the web and recompiled ffmpeg with the same problem.

    The I frames appear fragmented and contain lots of packets, some P frame have a start of frame (0x81) and EOF (0x41) but no packets in between and some just looked corrupt starting with 0x41 (seems like this should be the second byte) which gives payload type of 1. I am a novice when it comes to these issues but I looked at rtp documentation and I cannot find an issue with how I handle the data.

    Also I stream from VLC and this seems fine but appears to halve the frame rate, I am not sure how they are able to reconstruct frames.

    Please could someone help.

  • FFMPEG : Smooth streaming on IOS and Android

    24 avril 2014, par Vprnl

    I am transcoding a file to the ISMV "smooth streaming" format to create fragmented MP4 files.

    The Ffmpeg parameters I use are the following:

    ffmpeg -i "'+inputUrl+'" -g 52 -threads 0 \
    -vcodec libx264 -coder 0 -flags -loop -pix_fmt yuv420p \
    -crf 22 -subq 0 -sc_threshold 0 -s 1280x720 -profile:v baseline \
    -keyint_min 150 -deinterlace -maxrate 10000000 -bufsize 10000000 \
    -b 1200k -acodec aac -ar 48000 -ab 192k -strict experimental \
    -movflags +frag_keyframe+empty_moov '+outputUrl
    

    The main purpose is to play the file while transcoding. This works great on my desktop. Sadly though, this can not be said for Android and IOS devices. It simply does not play anything.

    Is it possible to play a fragmented mp4 on these devices?