Advertisement
gormed

ffmpeg and UE4

Jun 15th, 2015
584
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. Hi, i use ffmpeg together with the Unreal Engine 4 (UE4) to record audio/video. Setup of codecs, format, file, etc. seems to work fine until i write into the file with av_interleaved_write_frame, where i get an access violation. I currently have the latest stable version build with MYSY2/mingw for Winx64 + libx264. I use Win 8.1 with VS2013 for UE4 development.
  2.  
  3. Version:
  4.  
  5. ffmpeg version n2.6.3-1-g1f7343c Copyright (c) 2000-2015 the FFmpeg developers
  6. built with gcc 4.9.2 (Rev5, Built by MSYS2 project)
  7. configuration: --prefix=/usr/ffmpeg --enable-gpl --enable-pthreads --enable-li
  8. bx264 --arch=x86_64 --target-os=mingw32 --enable-debug=1 --disable-optimizations
  9. --enable-extra-warnings --disable-stripping --disable-fast-unaligned --enable-m
  10. emory-poisoning --enable-pic --enable-shared
  11. libavutil 54. 20.100 / 54. 20.100
  12. libavcodec 56. 26.100 / 56. 26.100
  13. libavformat 56. 25.101 / 56. 25.101
  14. libavdevice 56. 4.100 / 56. 4.100
  15. libavfilter 5. 11.102 / 5. 11.102
  16. libswscale 3. 1.101 / 3. 1.101
  17. libswresample 1. 1.100 / 1. 1.100
  18. libpostproc 53. 3.100 / 53. 3.100
  19.  
  20. The recording uses an extra thread in my UE4 plugin; it does not seem like a race condition to me.
  21.  
  22. ret = av_interleaved_write_frame(oc, &pkt); // Unhandled exception at 0x000000006AE999FE (avformat-56.dll) in UE4Editor.exe: 0xC0000005: Access violation reading location 0x0000000000000070.
  23.  
  24. I already had to do that to prevent a divide by zero in av_interleaved_write_frame:
  25.  
  26. // this seems to fix a divide - by - zero error
  27. if (st->pts.den == 0)
  28. {
  29. st->pts.num = 0;
  30. st->pts.den = 1;
  31. }
  32.  
  33. OpenCV does something similar, while doing its own interleaving (is this why i have the error?). I used OpenCV successfully, for the same purpose, but it does not support audio rec, which is why ffmpeg.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement