Newest 'x264' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Gstreamer, x264enc "Redistribute latency..." error

    20 août 2021, par Jason

    I'm trying to setup a video pipeline with very limited bandwidth. I was able to do it with two raspberry pis using the below lines. The first is for the camera pi and the second is to watch stream:

    gst-launch-1.0 rpicamsrc preview=false !  'video/x-h264, width=800, height=600, framerate=30/1' ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! udpsink host=YOUR_PC_IP port=5000
    gst-launch-1.0 udpsrc port=5000 ! gdpdepay ! rtph264depay ! h264parse ! avdec_h264 ! autovideosink sync=false
    

    It works but I go over my bandwidth limit if there is movement. I'm not sure if there is a way to limit bandwidth by setting a parameter here:

    'video/x-h264, width=800, height=600, framerate=30/1'
    

    From what I can find online, I have to use something like x264enc. I've followed tutorials but I can't get x264enc to work. it always outputs "Redistribute latency..." on both machines when run and it stays there.

    I've tried using x264enc like follows:

    gst-launch-1.0 rpicamsrc preview=false !  'video/x-raw, width=800, height=600, framerate=30/1' ! x264enc ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! udpsink host=YOUR_PC_IP port=5000
    gst-launch-1.0 rpicamsrc preview=false !  'video/x-raw, width=800, height=600, framerate=30/1' ! x264enc tune=zerolatency ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! udpsink host=YOUR_PC_IP port=5000
    gst-launch-1.0 rpicamsrc preview=false ! x264enc ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! udpsink host=YOUR_PC_IP port=5000
    gst-launch-1.0 rpicamsrc preview=false ! x264enc tune=zerolatency ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! udpsink host=YOUR_PC_IP port=5000
    

    Based on tutorials, I would think some of those should work. Other threads say that tune=zerolatency fixes my problem. At least the ones with same output of "Redistribute latency..." I don't know what I'm doing wrong.

    Any help would be appreciated. Thanks!

  • How to encode multiple files with a batch file

    11 juillet 2021, par Black Butterfly

    I am Encoding my own anime videos to save some space on my HDD using this script

    https://gist.github.com/ScarletDevil25/9d71e4a7f5c215e558ecad158aa52600

    However I can only encode one video at a time by dragging said video to the batch file and allowing it to run.

    What I would like to be able to do is have the batch file encode multiple videos at once.

    also as another question if someone could tell me how I would run this as admin

  • x264_encoder_open always return null

    10 juillet 2021, par chinayin

    this is my code

    x264_param_default(&m_X264Param) ;

    nRet = x264_param_default_preset(&m_X264Param,"medium","zerolatency") ;
    if (nRet)
    {
        return -1;
    }
    if (cpMain == Param.nProfile)
    {
        nRet = x264_param_apply_profile(&m_X264Param,"main") ;
    }
    else if (cpSimple == Param.nProfile)
    {
        nRet = x264_param_apply_profile(&m_X264Param,"baseline") ;
    }
    else if (cpComplex == Param.nProfile)
    {
        nRet = x264_param_apply_profile(&m_X264Param,"high");
    }
    if (nRet)
    {
        return -1;
    }
    m_X264Param.i_width = Param.nWidth ;
    m_X264Param.i_height = Param.nHeight ;
    m_X264Param.i_threads = X264_THREADS_AUTO ;
    m_X264Param.i_log_level = X264_LOG_NONE ;
    m_X264Param.rc.i_bitrate = Param.nBitRate ;
    m_X264Param.rc.i_rc_method = X264_RC_ABR ;
    m_X264Param.i_csp          =  X264_CSP_I420 ;
    

    m_pX264Handle = x264_encoder_open(&m_X264Param) ;

    but it always return null it is my first time use it did i miss some key param? is anyone who can tell me the answer! thank you very much and best regards

  • Why does x264 keep giving me "command not found" error on my Mac ? [closed]

    2 juillet 2021, par hd-dvd

    I just installed x264 via Homebrew on my Mac running MacOS 11.4 Big Sur. I'm trying to encode a video but I can't get x264 to run properly.

    This is the command I am running in the Terminal:

    x264 --bitrate 25000 --preset veryslow --bluray-compat --tune film --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 30 --open-gop --slices 4 --fake-interlaced --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 1 -o out.264 in.mp4

    and this is what it outputs:

    bash: x264 --bitrate 25000 --preset veryslow: command not found

    If I delete the --preset part then it just gets hung up on some other part, like --tune.

    I have tried brew doctor and there are no errors.

    If I just run x264 then it gives me x264 [error]: No input file. Run x264 --help for a list of options. so it seems as if x264 is installed. I don't know where to begin troubleshooting this but I'd like to get it to work.

    If I simplify the command way down to x264 -o out.264 in.mp4 then I get:

    avs [error]: failed to load avisynth
    raw [error]: raw input requires a resolution.
    x264 [error]: could not open input file `in.mp4' via any method!
    

    I would greatly appreciate some pointers on how to get this working.

  • ffmpeg 2 pass encoding- understand the statistics in the output .log file

    21 juin 2021, par Yaelvi

    I am using 2 pass encoder to encode my input video with a target bitrate. I want to get the encoder (x264) statistics from the first pass- these statistics are written to ffmpeg2pass.log the output for each frame looks like that:

    in:2 out:2 type:B dur:2 cpbdur:2 q:28.41 aq:25.07 tex:4721 mv:2357 misc:2266 imb:24 pmb:527 smb:3049 d:- ref:0 ;

    How can I found is the meaning of each value? (for example, mv is motion vectors, but what is the meaning of misc, imb, pmb etc.?)

    ffmpeg command used: ffmpeg -f rawvideo -pix_fmt yuv422p16le -s:v 1280x720 -i "input_file.yuv" -c:v libx264 -pass 1 -stats -vstats -passlogfile "log_file_prefix" -f mp4 -y "output.mp4" && ffmpeg -f rawvideo -pix_fmt yuv422p16le -s:v 1280x720 -i "input_file.yuv" -c:v libx264 -pass 2 -passlogfile "log_file_prefix" -y "output.mp4"