Newest 'x264' Questions - Stack Overflow
Les articles publiés sur le site
-
is it possible to compile x264 for webassembly using emscripten ?
4 novembre, par sunder kandasamyI am trying to build x264 code for webassembly. i use emconfigure to configure. like below
emconfigure ./configure --prefix="$(pwd)/em" --enable-shared --enable-static --disable-cli --disable-gpl
But this was throwing "No working C compiler found." error. i have gcc compiler 9.3.0 version and have tried reinstalling build-essentials and gcc but still same issue.
config.log also doesn't help.
If i provide --host cross compiler flag then it is generating libx264.so file, but i am not sure whether this is right as the wasm code should work in every browser in (windows/mac/linux)
please tell me first whether compiling x264 using emscripten is possible? If yes, please tell me what is the correct steps to do it
-
h264 RTP timestamp
26 octobre, par user269090I have a confusion about the timestamp of h264 RTP packet. I know the wall clock rate of video is 90KHz which I defined in the SIP SDP. The frame rate of my encoder is not exactly 30 FPS, it is variable. It varies from 15 FPS to 30 FPS on the fly. So, I cannot use any fixed timestamp.
Could any one tell me the timestamp of the following encoded packet.
After 0 milisecond encoded RTP timestamp = 0 (Let the starting timestamp 0)
After 50 milisecond encoded RTP timestamp = ?
After 40 milisecond encoded RTP timestamp = ?
After 33 milisecond encoded RTP timestamp = ?What is the formula when the encoded frame rate is variable?
Thank you in advance.
-
avcodec_find_encoder(AV_CODEC_ID_H264) returns null
23 septembre, par Monjura RumiI am building an android application which will encode image captured from camera preview and later decode it. I am using ffmpeg library to encode and decode. To build static library with x264 I have used this tutorial. http://dl.dropbox.com/u/22605641/ffmpeg_android/main.html. As a source code of ffmpeg if I use the one downloaded from the link given in tutorial I can built it but can't build library if i use source code downloaded from here git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg. I have built library in ubuntu and using it in windows 7 in Eclipse. As I need only h264 encoder and decoder I have used following code for ffmpeg, slightly modified from tutorial.
#!/bin/bash NDK=~/Documents/android-ndk-r8e PLATFORM=$NDK/platforms/android-8/arch-arm PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86 PREFIX=/home/android-ffmpeg function build_one { ./configure --target-os=linux --prefix=$PREFIX \ --enable-cross-compile \ --enable-runtime-cpudetect \ --disable-asm \ --arch=arm \ --cc=$PREBUILT/bin/arm-linux-androideabi-gcc \ --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \ --disable-stripping \ --nm=$PREBUILT/bin/arm-linux-androideabi-nm \ --sysroot=$PLATFORM \ --enable-nonfree \ --enable-version3 \ --disable-everything \ --enable-gpl \ --disable-doc \ --enable-avresample \ --disable-ffplay \ --disable-ffserver \ --enable-ffmpeg \ --disable-ffprobe \ --enable-avcodec \ --enable-libx264 \ --enable-encoder=libx264 \ --enable-encoder=libx264rgb \ --enable-decoder=h263 \ --enable-decoder=h264 \ --enable-decoder=svq3 \ --enable-zlib \ --enable-gpl \ --enable-pic \ --disable-devices \ --disable-avdevice \ --extra-cflags="-I/home/android-ffmpeg/include -fPIC -DANDROID -D__thumb__ -mthumb -Wfatal-errors -Wno-deprecated -mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=armv7-a" \ --extra-ldflags="-L/home/android-ffmpeg/lib" make -j4 install $PREBUILT/bin/arm-linux-androideabi-ar d libavcodec/libavcodec.a inverse.o $PREBUILT/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -L$PREFIX/lib -soname libffmpeg.so -shared -nostdlib -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffmpeg.so libavcodec/libavcodec.a libavfilter/libavfilter.a libavresample/libavresample.a libavformat/libavformat.a libavutil/libavutil.a libswscale/libswscale.a -lc -lm -lz -ldl -llog -lx264 --warn-once --dynamic-linker=/system/bin/linker $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a } build_one
After building library I have been able to build android ndk. A little part of my JNI code is here.
JNIEXPORT jint JNICALL Java_com_example_testjava_TestjniActivity_initencoder(JNIEnv* env,jobject obj){ av_register_all(); avcodec_register_all(); codec = avcodec_find_encoder(AV_CODEC_ID_H264); if (!codec) { __android_log_write(ANDROID_LOG_INFO, "debug", "not found"); return -1; } . . . }
When I run my java source code that calls initencoder() I get -1 as return value and logcat prints "not found". That means avcodec_find_encoder() returns null and if condition is being ok. I don't know what's wrong. Why this function is returning null? I have searched a lot but did not find any solution that could guide me to right direction. some says to use avcodec_init(). But ndk-build command fails and shows error saying undefined reference to 'avcodec_init()'. I have started with library build because I thought may be I am doing wrong from the first stage. Did I make any mistake in library building like not enabling things that I should? Please help me here. This is kind of urgent for me.
-
x264/x265 options for fast decoding while preserving quality
18 août, par user3301993I want to encode some videos in H264 and H265, and I would like to ask for help in order to chose the adequate options in x264/x265.
- My first priority is video quality. Lossless would be the best quality for example
- My second priority is fast decoding speed (ie: I would like faster decoding without sacrificing quality)
- fast decoding for me means that the decoding machine would use less CPU resources reading the resulting video
- Less RAM consumption would be a plus
- Latency is not important
- I don't care that much if the output file ends up bigger. Also, encoding speed is not important
I'm aware of the option
-tune fastdecode
in both x264 and x265. But apparently the quality gets a bit worse using it.For x264:
-tune fastdecode
is equivalent to--no-cabac --no-deblock --no-weightb --weightp 0
(My source isx264 --fullhelp
)Which options preserve quality ?
For x265:
-tune fastdecode
is equivalent to--no-deblock --no-sao --no-weightp --no-weightb --no-b-intra
(according to x265 doc)Again, which options preserve quality ?
I tried to read some documentation on these options, but I'm afraid I'm too stupid to understand if they preserve quality or not.
To explain further what I mean by "preserving quality":
I don't understand what the cabac option does exactly. But let's say for example that it adds some extra lossless compression, resulting in a smaller video file, but the decoding machine would need to do extra work to decompress the file
In that case, the
--no-cabac
option would skip that extra compression, resulting in no loss of quality, with a bigger file size, and the decoding machine would not need to decompress the extra compression, saving CPU work on the decoding sideIn this scenario, I would like to add the
--no-cabac
option, as it speeds up decoding, while preserving quality.I hope I could get my point across
Can anyone help me pick the right options ?
Thanks in advance
-
How to check 'Output bit depth' of the libx264 library in ffmpeg ?
26 mai, par GregAccording to the x264 Encoding Guide, the
crf
scale depends on whether x264 is 8-bit or 10-bit. Supposedlyx264 --help
shows theOutput bit depth
. But on Windowsffmpeg -h full
doesn't say anything aboutOutput bit depth
and thecrf
scale option is described asfrom -1 to FLT_MAX
. How can I check if my ffmpeg is using 8-bit or 10-bit version of the libx264 library?