Newest 'libx264' Questions - Stack Overflow
Les articles publiés sur le site
-
Extract Motion Vectors From x264 source code
27 mai 2021, par Essam AlyIf you are familiar with the x264 source code, where in the code I can extract the MV (motion vectors) of each frame? Can you point please to a line of code I can intercept and save the MVs to disk? Thank you.
-
Ubuntu ffmpeg can't use libx264
27 mai 2021, par user1315621Command
ffprobe rtsp://localhost/myvideo -codec:v libx264 -show_frames -of csv
Output
Failed to set value 'libx264' for option 'codec:v': Option not found
But
libx264
seems to be installed -sudo apt install libx264-dev
:Reading package lists... Done Building dependency tree Reading state information... Done libx264-dev is already the newest version (2:0.152.2854+gite9a5903-2).
-
how to put SPS/PPS before each keyframe while encode h264 with ffmpeg ?
18 mai 2021, par woderI see there is an flag can put pps and sps before each keyframe
// x264.h int b_repeat_headers; /* put SPS/PPS before each keyframe */
but I don't know how to enable it while encode with ffmpeg; I search ffmpeg codec library wrapper file
libx264.c
that I only findb_repeat_headers
will be set to 0 if codec context flagAV_CODEC_FLAG_GLOBAL_HEADER
is setif (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) x4->params.b_repeat_headers = 0;
but I don't find where to set
b_repeat_headers
to 1, how can I make it? -
How to use ffmpeg for streaming mp4 via websocket
18 mai 2021, par curtissI've written a sample in nodejs which streams some input to the client via websocket connection in mp4 format. On the client side, the mp4 packages are added to a MediaSourceBuffer.
This runs fine, but only if the client gets the stream from the beginning with the first package. So another client can't play the current Stream, because he won't get the Stream from the beginning.
I tried (try&error) to save the first package ffmpeg sends and send this at the beginning of a new connection, then the current stream. Then the MediaSourceBuffer breaks because of encoding error..
Here is the ffmpeg command :
-i someInput -g 59 -vcodec libx264 -profile:v baseline -f mp4 -movflags empty_moov+omit_tfhd_offset+frag_keyframe+default_base_moof -reset_timestamps 1 -
The part "empty_moov+omit_tfhd_offset+frag_keyframe+default_base_moof" should make the Streampackages independent in putting the moovatom at the beginning of each part and sizing the parts in 59 frames each by keyframe, so I don't get it why I can't view the Stream beginning after the start.
-
Error initializing output stream ffmpeg on Rasbpi converting jpg to video
5 avril 2021, par JakeI have a folder with thousands of jpgs at 1024x768 that I want to convert into a single video for playback.
The error I get is
Error initializing output stream 73:0 -- Error while opening encoder for output stream #73:0 - maybe incorrect parameters such as bit_rate, rate, width or height Conversion failed!
Here's my input
$ ffmpeg -i Timelapse/*.jpg -c:v libx264 -preset ultrafast -crf 0 output.mkv -y
What is strange is it errors on a specific numbered output stream. It seems to be either 71:0, 72:0, or 73:0. I thought it was something wrong with the file it is attempting to process in the given stream but the resolution is all the same (as I've seen errors when its not divisible by 2). I've deleted the 71st-73rd image in hopes it was somehow messed up but that doesn't help either. I've ensured my libx264 is installed correctly as well.
Any suggestions?
Terminal output example