View Full Version : x264 encode not seekable
mariner
20th March 2016, 09:50
Greetings. Appreciate any kind assistance with making x264 encode seekable.
Using the following script, but output not seekable in Avidemux.
Many thanks and best regards.
x264 --fps 25 --crf 20 --tune film --bluray-compat --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 25 --open-gop --slices 4 --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 -o output.mkv input.avs
input.avs
DSS2("in.ts", preroll=50, lavs="L3", lavd="L3",fps=25000, fps_den=1000,tc_offset=-1)
nevcairiel
20th March 2016, 11:22
AFAIK, x264 mkv files do not have an index, you could remux it with mkvmerge, for example, to generate an index, which makes the files seekable, or output to another format, like mp4.
mariner
21st March 2016, 09:35
Thanks for the kind reply, nevcairiel.
Remuxing with mkvmerge did not work, neither did output to .264 and mux into mkv.
kuchikirukia
21st March 2016, 15:55
Avidemux support open GOP?
hello_hello
22nd March 2016, 11:40
Some media players will create their own index when you open an MKV without one. MPC-HC for example. That means you can open an MKV with MPC-HC while the video is still being encoded and it'll be able to seek.
Otherwise as nevcairiel suggested, remuxing with MKVMerge should make it seekable. If it's not when opening it with AviDemux, I'm not sure why. Maybe try a test encode without any of the Bluray compatibility options and if that's seekable, you should be able to find the culprit through a bit of trial and error.
PS. I was under the impression for Bluray compatibility the output must be .264, not MKV.
http://forum.doom9.org/showthread.php?t=154533
http://www.x264bluray.com/home/1080i-p
I can't remember the exact reason, but is that no longer the case, or does it tend not to matter?
mariner
24th March 2016, 12:53
Was anyone able to get x264 encode to seek in AviDemux? Appreciate if you could kindly share the script used.
Many thanks and best regards.
kuchikirukia
25th March 2016, 00:08
Of course h264 seeks in Avidemux. Jesus Christ, all you had to do was load one to see.
hello_hello
26th March 2016, 01:40
It seeks fine for me after remuxing. Default x264 settings with the slow speed preset.
mariner
29th March 2016, 12:31
It seeks fine for me after remuxing. Default x264 settings with the slow speed preset.
Thanks hello.
The culprit would appear to be --bluray-compat. Does anyone know why?
Asmodian
4th April 2016, 20:20
I believe it is because it sets OpenGOP.
sneaker_ger
4th April 2016, 20:33
--bluray-compat does not imply --open-gop.
hello_hello
5th April 2016, 14:51
It's a complete mystery to me, but I played around a little, testing various combinations and it seems....
This command line results in an output that AviDemux can't seek.
--level 4.1 --bluray-compat --open-gop --slices 4 --vbv-bufsize 30000 --vbv-maxrate 40000
It can seek when using this command line:
--level 4.1 --bluray-compat --open-gop --slices 4
This seems to be the problem "no seeking" combination. --nal-hrd vbr being something that's included in --bluray-compat
--nal-hrd vbr --open-gop --vbv-bufsize 30000 --vbv-maxrate 40000
The VBV settings with just --nal-hrd vbr are fine, and with just --open-gop it's fine, but put the three together and AviDemux won't seek. I've no idea why. I was testing by re-encoding a standard definition AVI I had handy.
sneaker_ger
5th April 2016, 14:57
Without vbv parameters HRD is not used at all. So "--nal-hrd vbr --open-gop" is equal to "--open-gop" when not accompanied by vbv settings. That explains why all three are required, i.e. it's the only combination with OpenGOP and HRD.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.