jc-kynesim / rpi-ffmpeg

FFmpeg work for RPI
Other
111 stars 27 forks source link

Encode fragmented mp4 with h264_v4l2m2m: Static build working; shared build "No start code found" (4.3.4) #55

Closed saturn-hh closed 1 year ago

saturn-hh commented 2 years ago

I want to use ffmpeg with hardware acceleration in another project (Weylus). Therefore, I tested the 4.3.4 main branch to encode fragmented mp4 (movflags: rag_keyframe+default_base_moof+faststart).

If I build ffmpeg with "conf_native.sh --noshared" the encoded video file is playable. If I build ffmpeg with conf_native.sh I get an error message ("No start code found") while trying to play the encoded video with ffplay (same resolt with vlc).

Steps to reproduce Build ffmpeg (4.3.4 main branch) as usual with the above-mentioned helper scripts.

Encode a testvideo with the shared and the static build: ffmpeg -hide_banner -f lavfi -i testsrc2=size=1920x1080 -vcodec h264_v4l2m2m -t 10 -bf 0 \ -movflags frag_keyframe+default_base_moof+faststart h264_v4l2m2m.mp4

Play the encoded video with ffplay. In case of the static build the video is playable. In case of the shared build one gets an error ("No start code found") Actually, I want to use ffmpeg in another project, so I need a working shared build.

Using the software encoder (libx264) the video is playable but the encoding performance is not sufficient.

Any help is appreciated.

ffmpeg: 4.3.4 main branch Raspberry Pi 4, 8 GB System Information "Debian GNU/Linux 11 (bullseye)"

jc-kynesim commented 2 years ago

If static works but shared doesn't are you sure that you've clean out all the old libraries from usr/lib/... and copied all the new ones? At least for PiOS there is a script pi-util/clean_usr_libs.sh (use sudo) that wipes everywhere that old libs lurk.

saturn-hh commented 1 year ago

Sorry for the late replay. It's working. The scripts in pi-utils are really helpful. Thank you for your fantastic work.

I would like build the 5.. release, but there is no pi-utils and the scripts from the 4.4 release aren't working with the 5... release. I'am going to open a new discussion regarding this question.