Newest 'libx264' Questions - Stack Overflow
Les articles publiés sur le site
-
Updating ffmpeg on Ubuntu 12.04 ; conflicts with old version from standard repository
29 octobre 2016, par Frank van WensveenI have never used ffmpeg on my Ubuntu Linux 12.04 (Precise Pangolin) box until now. Typing 'ffmpeg' at the command prompt revealed that ffmpeg 0.8.17 (listed as ffmpeg 0.8.17-4:0.8.17-0ubuntu0.12.04.2) was installed. Seeing as I need to convert h.265 to h.264, an update was obviously required.
Following posted instructions, I installed a ream of packages:
$ sudo apt-get install faad libmp4v2-dev libfaac0 libfaac-dev libxvidcore4 libxvidcore4-dev liba52-0.7.4 liba52-0.7.4-dev libx264-dev libgsm-tools libogg-dev libtheora-bin libfaad-dev libvorbis-dev libtheora-dev libdts-dev git-core yasm texi2html checkinstall
followed by
$ sudo apt-get purge ffmpeg
in order to get rid of the old stuff from the original repo.
Downloaded the latest ffmpeg, and a ."/configure; make; sudo make install" later, I should be in business.
Except that typing 'ffmpeg' at the prompt still fired up the old version. A quick look revealed that the old ffmpeg binary was still sitting in /usr/bin with the new one being installed in /usr/local/bin. But ffmpeg is no longer listed as an installed package, and sudo apt-get remove ffmpeg tells me that "Package ffmpeg is not installed, so not removed".
Running /usr/local/bin/ffmpeg directly works, however then fails in an Unknown encoder 'libx264' error. Which is puzzling because the package libx264-120 is installed and /usr/lib/i386-linux-gnu/libx264.so.120 (with the appropriate symlink to /usr/lib/i386-linux-gnu/libx264.so) does exist.
Maybe I've been looking at this for too long, because I'm sure this is a simple issue but I just can't see it.
Can someone please hand me the stupid had and point out why I deserve to wear it?
Tnx!
-
can write frames to rtsp server, but can't display them in the ffplay or live555 client
11 octobre 2016, par tankyxI am working on a zero latency streaming server, using ffmpeg libraries and I am facing a problem. My server is working when using nvenc, I can streaming successfully to my client, which is another computer on LAN. But if I change my encoder to use the libx264 (in order to reduce the latency), the server still write the frames, but the client is facing problems with the sdp header, and more specifically, the media subsession does not seem to be initialized. Therefore, the client crashes.
The thing is, when I dump the sdp header when using nvenc and libx264, it is actually the same in both case.
Here is the code I have done to initialize my encoder :
/* Init the codec that is used to encode the video. Init the output format context (aka RTSP uri). */ FfmpegEncoder::FfmpegEncoder(char *url) { AVRational tmp_time_base; AVDictionary* options = NULL; this->pCodec = avcodec_find_encoder_by_name("libx264"); if (this->pCodec == NULL) throw myExceptions("Error: Can't initialize the encoder. FfmpegEncoder.cpp l:9\n"); this->pCodecCtx = avcodec_alloc_context3(this->pCodec); //Alloc output context if (avformat_alloc_output_context2(&outFormatCtx, NULL, "rtsp", url) < 0) throw myExceptions("Error: Can't alloc stream output. FfmpegEncoder.cpp l:17\n"); this->st = avformat_new_stream(this->outFormatCtx, this->pCodec); this->st->id = this->outFormatCtx->nb_streams - 1; if (this->st == NULL) throw myExceptions("Error: Can't create stream . FfmpegEncoder.cpp l:22\n"); //Define the framerate of the output. The numerator should stay 1. Denumerator is the framerate we are aiming for. tmp_time_base.num = 1; tmp_time_base.den = 60; //TODO : parse these values this->pCodecCtx->bit_rate = 5000000; this->pCodecCtx->width = 1280; this->pCodecCtx->height = 720; //This set the fps. 60fps at this point. this->pCodecCtx->time_base = tmp_time_base; this->st->time_base = tmp_time_base; //Add a intra frame every 12 frames this->pCodecCtx->gop_size = 10; this->pCodecCtx->pix_fmt = AV_PIX_FMT_YUV420P; av_opt_set(this->pCodecCtx, "tune", "zerolatency", 0); av_opt_set(this->pCodecCtx, "vprofile", "main", 0); av_opt_set(this->pCodecCtx, "preset", "faster", 0); //Open Codec, using the context + x264 options if (avcodec_open2(this->pCodecCtx, this->pCodec, &options) < 0) throw myExceptions("Error: Can't open the codec. FfmpegEncoder.cpp l:43\n"); if (avcodec_copy_context(this->st->codec, this->pCodecCtx) != 0) { throw myExceptions("Error : Can't copy codec context. FfmpegEncoder.cpp : l.46"); } av_dump_format(this->outFormatCtx, 0, url, 1); //write the header needed to start the stream. if (avformat_write_header(this->outFormatCtx, NULL) != 0) throw myExceptions("Error: failed to connect to RTSP server. FfmpegEncoder.cpp l:48\n"); }
-
can write frames to rtsp server, but can't display them in the ffplay or live555 client
11 octobre 2016, par tankyxI am working on a zero latency streaming server, using ffmpeg libraries and I am facing a problem. My server is working when using nvenc, I can streaming successfully to my client, which is another computer on LAN. But if I change my encoder to use the libx264 (in order to reduce the latency), the server still write the frames, but the client is facing problems with the sdp header, and more specifically, the media subsession does not seem to be initialized. Therefore, the client crashes.
The thing is, when I dump the sdp header when using nvenc and libx264, it is actually the same in both case.
Here is the code I have done to initialize my encoder :
/* Init the codec that is used to encode the video. Init the output format context (aka RTSP uri). */ FfmpegEncoder::FfmpegEncoder(char *url) { AVRational tmp_time_base; AVDictionary* options = NULL; this->pCodec = avcodec_find_encoder_by_name("libx264"); if (this->pCodec == NULL) throw myExceptions("Error: Can't initialize the encoder. FfmpegEncoder.cpp l:9\n"); this->pCodecCtx = avcodec_alloc_context3(this->pCodec); //Alloc output context if (avformat_alloc_output_context2(&outFormatCtx, NULL, "rtsp", url) < 0) throw myExceptions("Error: Can't alloc stream output. FfmpegEncoder.cpp l:17\n"); this->st = avformat_new_stream(this->outFormatCtx, this->pCodec); this->st->id = this->outFormatCtx->nb_streams - 1; if (this->st == NULL) throw myExceptions("Error: Can't create stream . FfmpegEncoder.cpp l:22\n"); //Define the framerate of the output. The numerator should stay 1. Denumerator is the framerate we are aiming for. tmp_time_base.num = 1; tmp_time_base.den = 60; //TODO : parse these values this->pCodecCtx->bit_rate = 5000000; this->pCodecCtx->width = 1280; this->pCodecCtx->height = 720; //This set the fps. 60fps at this point. this->pCodecCtx->time_base = tmp_time_base; this->st->time_base = tmp_time_base; //Add a intra frame every 12 frames this->pCodecCtx->gop_size = 10; this->pCodecCtx->pix_fmt = AV_PIX_FMT_YUV420P; av_opt_set(this->pCodecCtx, "tune", "zerolatency", 0); av_opt_set(this->pCodecCtx, "vprofile", "main", 0); av_opt_set(this->pCodecCtx, "preset", "faster", 0); //Open Codec, using the context + x264 options if (avcodec_open2(this->pCodecCtx, this->pCodec, &options) < 0) throw myExceptions("Error: Can't open the codec. FfmpegEncoder.cpp l:43\n"); if (avcodec_copy_context(this->st->codec, this->pCodecCtx) != 0) { throw myExceptions("Error : Can't copy codec context. FfmpegEncoder.cpp : l.46"); } av_dump_format(this->outFormatCtx, 0, url, 1); //write the header needed to start the stream. if (avformat_write_header(this->outFormatCtx, NULL) != 0) throw myExceptions("Error: failed to connect to RTSP server. FfmpegEncoder.cpp l:48\n"); }
-
Does libx265 and libx264 libraries implement a decoder ?
10 octobre 2016, par KevinoI have one question about these 2 codec library developped by videolan.
Does x265(libx265) implements a decoder? Same question for x264(libx264).
Thank you for your answers.
-
Does libx265 and libx264 libraries implement a decoder ?
10 octobre 2016, par KevinoI have one question about these 2 codec library developped by videolan.
Does x265(libx265) implements a decoder? Same question for x264(libx264).
Thank you for your answers.