Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Need help on handling MPEG4V1 data

    14 septembre 2011, par Gediminas

    I'm in situation where I need to get a chunk of MPEG4V1 (Microsoft MPEG-4 VKI Codec V1) data located in the beginning of a packet (that was sent by some DVR unit).

    Packet structure looks something like this:

    • Compressed MPEG4 data.
    • Long integer - Number of events and tripwires.
    • Long integer - Number of events.
    • Event - Event's sequence.
    • Long integer - Number of tripwires.
    • Tripwire - Tripwires sequence.
    • Long integer - Cyclical redundant code (CRC).

    So there is no indication of how to know where does the MPEG4 data ends (Or is there?), and from where should I start reading this additional data like "Number of events and tripwires" and etc...

    I uploaded two packet's so you could see how the actual data looks like: recvData1.txt, recvData2.txt.

    I've tried to decode those packets using FFmpeg library with avcodec_decode_video function and by removing byte by byte from the end of my recvData buffer in a hope for any results,
    but FFmpeg just allways returned with an error messages like this:

    "[msmpeg4v1 @ 038865a0] invalid startcode", "[msmpeg4v1 @ 038865a0] header damaged".

    I'm not that good specialist on knowing of how does the MPEG4 works from the inside, but judging by the error messages it's clearly seen that I'm missing some data for decoding at the start of the buffer.

    So I'm not sure of what part / kind of MPEG data I'm getting here..
    Maybe it's some kind of MPEG's "frame" data with it's "end" indication or something?

    I've even compared the start of my recvData buffer to some of MPEG4V1 encoded video files I found on the net "http://www.trekmania.net/clips/video_clips4.htm" to check if the start of my buffer really contains the MPEG data ..and not some kind of DVR vendor specific stuff..

    And I noticed that there are about 20bytes of data (at the start of my packet data, and in .avi files right after about ~180bytes..) that looks like some kind of header or something..

    Please check this image: "http://ggodis.gamedev.lt/stackOverflow/recvData.jpg"

    Maybe someone knows what this part of MPEG4V1 data represents?

    P.S. ..I've checked the CRC values for my received packets and they were correct..

  • ffmpeg : trying to set gop = 5

    14 septembre 2011, par user739711

    I am trying convert a .vob file to another .ts segment file with h264.

    I am trying to set GOP = 5. But output file does not have GOP = 5. I am using this command:

    ffmpeg -ss 0:0:0 -i "D:\sample videos\input9.vob" -ac 2 -f mpegts 
    -acodec libmp3lame -ar 48000 -ab 64000 -s 720x408 -vcodec libx264 -b 1200k 
    -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 5 
    -trellis 0 -refs 1 -coder 0 -me_range 16  -keyint_min 1 -sc_threshold 40 
    -i_qfactor 0.71 -bt 1300k -bufsize 524288 -qmin 2 -qmax 48 -aspect 1.7647059 
    -g 5 -r 30 -async 2  out.ts
    

    Anyone have any idea where i am missing?

  • HTTP Stream (video) recording to a set of files

    14 septembre 2011, par mhambra

    I just thinked that a usage of VLC's livehttp module on a certain project is way too resource hungry, just for recording video stream by 30-minute files. Thereby, what OSS software can be used to record an UDP video stream part-by-part? Excluding mencoder, since the recorded video should be gap-less.

    Also, if writing own FFmpeg code, what is the best way to tell libavformat/libavcodec to switch file output after certain # of keyframes, using already cached last/next frames?

  • Creating a pipe between C# and Ffmpeg

    13 septembre 2011, par John Oliver

    I have a C# program that creates a video and saves it to the disk in real-time. Instead of doing that, I want it to write it directly in a pipe connected with ffmpeg...

    The function that keeps saving the video in the disk, which I can not control, receives an IntPtr with a reference to the file.

    So, I need to create a pipe or something like that with ffmpeg, get a pointer to that, and use that pointer in the function, so that it streams the file to ffmpeg and not the disk...

    Regards, John Oliver

  • ffmpeg : Resampling with input channels greater than 2 unsupported ?

    13 septembre 2011, par user739711

    This question is already been asked but because that thread is old I am posting again.

    When a video file has 5.1 audio channels ffmpeg is not able to convert it to another format giving error:

    "Resampling with input channels greater than 2 unsupported"

    I saw some blogs saying I can modify the code and or patch ffmpeg for it.

    Any solution found yet?