oneam / h264bsd

A simple h264 software decoding library
Other
194 stars 52 forks source link

trying to decode #23

Open piniSolomon opened 1 year ago

piniSolomon commented 1 year ago

hi, I'm trying to use the library with some mp4 I downloaded from the internet (from here https://dvdloc8.com/clip.php?movieid=8419&clipid=2) and getting an error, H264BSD_ERROR. when trying the files in the test folder it works. so I'm guessing I don't understand something. Both files are played with vlc player. Can you help me understand if this library can decode some "regular" mp4?

Heath123 commented 1 year ago

I think you need to do something like ffmpeg -i video.mp4 -vcodec copy -an -bsf:v h264_mp4toannexb video.h264 though I'm still getting some errors when I do that (but it's close at least because if I comment out the error checks it sort of works)

oneam commented 1 year ago

As long as the video is encoded in Constrained Baseline Profile it should decode fine after the ffmpeg conversion. If it doesn't work, try this incantation:

ffmpeg -i video.mp4 -profile:v baseline video.h264

That will re-encode the video into Annex B H.264 using constrained baseline profile.