VideoHelp Forum




+ Reply to Thread
Results 1 to 7 of 7
  1. I am trying to filter, resize and encode a video on my VPS (remote server computer, one can log in) because it is 4x faster than home machine. My command like looks like:

    Code:
    ffmpeg -fflags +genpts -i myvideo.avi -an -c:v mjpeg -q:v 6 -vf "scale=2*ceil(iw/4):2*ceil(ih/4),lutyuv=y=gammaval(1/1.65)" -f avi tcp://101.101.101.101:1080?listen
    I encode video as mjpeg, because every frame is a keyframe, so on home machine I can easily seek through the video and select certain parts, recording frame ranges, etc.

    Video frame rate at server side: 29.97 fps, 29.97 tbr, 29.97 tbn, 29.98 tbc

    on client side at home machine I did:

    Code:
    ffmpeg -fflags +genpts -i http://101.101.101.101:1080 -c copy my-converted-video.avi
    Video frame rate at client side: 25 tbr, 50 tbn, 50 tbc

    My problem is when I open my-converted-video.avi at client side, its every second frame is marked as "D", which means "deleted" in VirtualDubMod. What should I do to get a normal video without deleted frames?
    Quote Quote  
  2. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    try adding the fps before and/or after the { -c copy } of the video.

    -r 29.970

    or

    -framerate 29.970

    also, may be beneficial to add the following, same condition as above.

    -rtbufsize 100MB # can vary value param, ie, 072000k, 10000k, ... etc

    and possibly

    -vsync 1
    Quote Quote  
  3. I would change container - avi may be not best streaming container - consider use something tailored for streaming or robust by definition (mpeg-ts is quite robust as data are usually in small packets), specify additionally frame payload size to prevent them from fragmentation - for Ethernet it is usually 1316 bytes (7*188bytes).

    For example:
    Code:
    -f mpegts udp://232.0.3.3:5000?pkt_size=1316
    I would also consider to change video codec to something more standard than mjpeg (Intra H.262 or Intra H.264 should be way more better).
    Quote Quote  
  4. Thx, and how can I activate "intra h264"? Does it mean that every frame is a keyframe and no B-frames are present?
    Quote Quote  
  5. Originally Posted by konstantinusz View Post
    Thx, and how can I activate "intra h264"?
    The x264 option is "--keyint 1".

    Originally Posted by konstantinusz View Post
    Does it mean that every frame is a keyframe and no B-frames are present?
    No B or P frames. All I frames.
    Last edited by jagabo; 11th Dec 2016 at 23:03.
    Quote Quote  
  6. Thx, using "-r 25" before and after "-i <input url>" together with "-vsync 1" worked, I just always have to check for the current fps at server side, but not a big problem.

    Interestingly, it turned out if I use codec mpeg2video either in matroska container/stream or mpegts, then there is no need for "-r 25" and "-vsync 1". Client side saved video is perfect.

    h264 and --keyint are not good for me, because I want to open the saved file at client side by VirtualDubMod + Wine, and it doesn't support that codec as far as I know. Doesn't exist similar "keyint" option for the mpeg4 or libxvid codec?
    Last edited by konstantinusz; 15th Dec 2016 at 19:44.
    Quote Quote  
  7. Originally Posted by konstantinusz View Post
    h264 and --keyint are not good for me, because I want to open the saved file at client side by VirtualDubMod + Wine, and it doesn't support that codec as far as I know.
    Just install a VFW h.264 decoder like ffdshow or x264vfw. But h.264 video and the AVI container (really the VFW AVI reader/splitter) don't get along well. I wouldn't recommend using it.

    Originally Posted by konstantinusz View Post
    Doesn't exist similar "keyint" option for the mpeg4 or libxvid codec?
    Of course. In the Xvid codec it's called Maximum I-frame interval. I believe it's "-g 1" in ffmpeg.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!