Newest 'libx264' Questions - Stack Overflow
Les articles publiés sur le site
-
FFMPEG MKV Causing Errors in DASH JS
24 juin 2018, par MikeI'm getting the following browser errors (on all browsers) using Dash JS when transcoding and MKV file:
ERROR DOMException: Failed to read the 'buffered' property from 'SourceBuffer': This SourceBuffer has been removed from the parent media source.
and...
dash.all.min.js:26 Uncaught (in promise) DOMException: Failed to load because no supported source was found.
What's weird is I have no issues when I transcode a MP4 file. I'm using FFMPEG in conjunction with Bento4 to build MPEG DASH and HLS files for my video player.
What I did to single out FFMPEG was to transcode a video that gave me errors on my test server on my local machine (which works) and start the Bento4 process on that file. Doing that, I had no issues and everything played just fine.
I have removed FFMPEG and reinstalled it multiple times and I always get the same result. I'm sure I screwed something up on my server, but for the life of me I can't seem to figure out where to start with fixing the issue.
FFMPEG Version
ffmpeg version N-91321-ge85c608 Copyright (c) 2000-2018 the FFmpeg developers built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-28) configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --extra-libs=-lpthread --extra-libs=-lm --bindir=/root/bin --enable-gpl --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libtheora --enable-libx264 --enable-nonfree libavutil 56. 18.102 / 56. 18.102 libavcodec 58. 20.102 / 58. 20.102 libavformat 58. 17.100 / 58. 17.100 libavdevice 58. 4.101 / 58. 4.101 libavfilter 7. 25.100 / 7. 25.100 libswscale 5. 2.100 / 5. 2.100 libswresample 3. 2.100 / 3. 2.100 libpostproc 55. 2.100 / 55. 2.100
FFMPEG Command
ffmpeg -i ${DIRECTORY}/${INPUT_FILE} -progress ${DIRECTORY}/transcode.log -s 1920x1080 -c:v libx264 -b:v 3000k -c:a aac -b:a 32k -minrate 3000k -maxrate 3000k -bufsize 6000k -g 96 -keyint_min 96 -sc_threshold 0 -profile:v high -flags +cgop -movflags faststart -preset ultrafast -pix_fmt yuv420p ${DIRECTORY}/ffmpeg_1920_1080_3000.mp4 &> ${DIRECTORY}/ffmpeg.log
Also, I get no errors and and if I access the output files directly, they play just fine.
I'm sure I'm not including all the information needed to troubleshoot this, so let me know if there is better information I can provide.
What would cause FFMPEG to transcode MP4 and not MKV?
EDIT One last thing, I converted the MKV to an MP4 then used the above command and it worked. It's like MP4 to MP4 is fine, but MKV to MP4 is broke.
-
ffmpeg for android, out of memory on encoding h264
15 juin 2018, par Rafael LimaI'm getting an weird error when enconding a video with ffmpeg on android
Failed to inject frame into filter network: Out of memory
Althoug is a pretty objective error, I do believe this is some "generic message" for another problem, because the video I used for testing is 17MB and less than 11 seconds length and I've sucessfully tested with videos bigger than 200MB and longer than 5min
This problem happens to
any videovertical videos recorded on my phone (the videos were recorded and play fine on my phone but i cant reencode them... other video h264 were encoded fine on same phone)this is ffmpeg output
ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers built with Android (4691093 based on r316199) clang version 6.0.2 (https://android.googlesource.com/toolchain/clang 183abd29fc496f55536e7d904e0abae47888fc7f) (https://android.googlesource.com/toolchain/llvm 34361f192e41ed6e4e8f9aca80a4ea7e9856f327) (based on LLVM 6.0.2svn) configuration: --prefix=/home/rafa/Desktop/m4/build --target-os=android --arch=i686 --cpu=i686 --cross-prefix=/home/rafa/Desktop/m4/ndk/toolchain/i686/bin/i686-linux-android- --enable-cross-compile --cc=/home/rafa/Desktop/m4/ndk/toolchain/i686/bin/clang --cxx=/home/rafa/Desktop/m4/ndk/toolchain/i686/bin/clang++ --pkg-config=/usr/bin/pkg-config --pkg-config-flags=--static --enable-pic --enable-gpl --enable-nonfree --enable-static --disable-shared --enable-ffmpeg --disable-ffplay --disable-ffprobe --disable-doc --disable-devices --enable-libx264 --enable-libfdk-aac --enable-bsf=aac_adtstoasc --disable-asm libavutil 56. 14.100 / 56. 14.100 libavcodec 58. 18.100 / 58. 18.100 libavformat 58. 12.100 / 58. 12.100 libavdevice 58. 3.100 / 58. 3.100 libavfilter 7. 16.100 / 7. 16.100 libswscale 5. 1.100 / 5. 1.100 libswresample 3. 1.100 / 3. 1.100 libpostproc 55. 1.100 / 55. 1.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/data/com.tomatedigital.toolsforinstagram/qqq.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isommp42 creation_time : 2018-06-09T04:28:55.000000Z location : -08.0638-034.8723/ location-eng : -08.0638-034.8723/ com.android.version: 7.0 Duration: 00:00:09.06, start: 0.000000, bitrate: 17349 kb/s Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 17088 kb/s, SAR 1:1 DAR 16:9, 30.04 fps, 30 tbr, 90k tbn, 180k tbc (default) Metadata: rotate : 90 creation_time : 2018-06-09T04:28:55.000000Z handler_name : VideoHandle Side data: displaymatrix: rotation of -90.00 degrees Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 255 kb/s (default) Metadata: creation_time : 2018-06-09T04:28:55.000000Z handler_name : SoundHandle Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help Error reinitializing filters! Failed to inject frame into filter network: Out of memory Error while processing the decoded data for stream #0:0 Conversion failed!
=====================UPDATE===================
I re-run the command with
-v 9 -loglevel 99
and got paste the log file at:If someone have real good expertise at ffmpeg i would apreciate very much the help
=====================UPDATE 2=================
I made more tests and the problem happens only when i record the video with my phone at vertical (other videos in vertical work and videos from my phone in horizontal also work)
==================UPDATE 3==================== I detected the problem happens to ANY video with the
Metadata: rotate : 90 (or any value)
It was suggested to use
-noautorotate
as workaround and it WORKDED, but this implies in tons of other complications ex:-if i decide to apply any filter to the video, it will be applied to the horizontal version but the video will be played at vertical producing a totally different effect
ex: https://i.stack.imgur.com/R3jXJ.jpg (at this photo the drawtext filter should be placed at bottom line with horizontal text, but as ffmpeg can't handle the orientation it is missplaced and rotated at runtime producing this vertical message)
-I checked and if I set
-metadata:s:v:0 rotate=
while enconding it has no effect ex:ffmpeg -i input.mp4 -c copy -metadata:s:v:0 rotate= output.mp4
will remove the rotate metadata and produce a non rotated videoBUT
ffmpeg -i input.mp4 -c:v libx264 -metadata:s:v:0 rotate= output.mp4
will keep the metadata and the produced video will be played rotated (this behavior was also noticed on the official ffmpeg 4.0 binaries for windows available at ffmpeg website)I'M STILL LOOKING FOR A BETTER SOLUTION, THANKS FOR THE HELP
-
ffmpeg for android out of memory
15 juin 2018, par Rafael LimaI'm getting an weird error when enconding a video with ffmpeg on android
Failed to inject frame into filter network: Out of memory
Althoug is a pretty objective error, I do believe this is some "generic message" for another problem, because the video I used for testing is 17MB and less than 11 seconds length and I've sucessfully tested with videos bigger than 200MB and longer than 5min
This problem happens to any video recorded on my phone (the videos were recorded and play fine on my phone but i cant reencode them... other video h264 were encoded fine on same phone)
this is ffmpeg output
ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers built with Android (4691093 based on r316199) clang version 6.0.2 (https://android.googlesource.com/toolchain/clang 183abd29fc496f55536e7d904e0abae47888fc7f) (https://android.googlesource.com/toolchain/llvm 34361f192e41ed6e4e8f9aca80a4ea7e9856f327) (based on LLVM 6.0.2svn) configuration: --prefix=/home/rafa/Desktop/m4/build --target-os=android --arch=i686 --cpu=i686 --cross-prefix=/home/rafa/Desktop/m4/ndk/toolchain/i686/bin/i686-linux-android- --enable-cross-compile --cc=/home/rafa/Desktop/m4/ndk/toolchain/i686/bin/clang --cxx=/home/rafa/Desktop/m4/ndk/toolchain/i686/bin/clang++ --pkg-config=/usr/bin/pkg-config --pkg-config-flags=--static --enable-pic --enable-gpl --enable-nonfree --enable-static --disable-shared --enable-ffmpeg --disable-ffplay --disable-ffprobe --disable-doc --disable-devices --enable-libx264 --enable-libfdk-aac --enable-bsf=aac_adtstoasc --disable-asm libavutil 56. 14.100 / 56. 14.100 libavcodec 58. 18.100 / 58. 18.100 libavformat 58. 12.100 / 58. 12.100 libavdevice 58. 3.100 / 58. 3.100 libavfilter 7. 16.100 / 7. 16.100 libswscale 5. 1.100 / 5. 1.100 libswresample 3. 1.100 / 3. 1.100 libpostproc 55. 1.100 / 55. 1.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/data/com.tomatedigital.toolsforinstagram/qqq.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isommp42 creation_time : 2018-06-09T04:28:55.000000Z location : -08.0638-034.8723/ location-eng : -08.0638-034.8723/ com.android.version: 7.0 Duration: 00:00:09.06, start: 0.000000, bitrate: 17349 kb/s Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 17088 kb/s, SAR 1:1 DAR 16:9, 30.04 fps, 30 tbr, 90k tbn, 180k tbc (default) Metadata: rotate : 90 creation_time : 2018-06-09T04:28:55.000000Z handler_name : VideoHandle Side data: displaymatrix: rotation of -90.00 degrees Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 255 kb/s (default) Metadata: creation_time : 2018-06-09T04:28:55.000000Z handler_name : SoundHandle Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help Error reinitializing filters! Failed to inject frame into filter network: Out of memory Error while processing the decoded data for stream #0:0 Conversion failed!
-
How to encode frames selectively and write in different video files as per required
10 juin 2018, par MSD Paulsuppose, for example, I have 10 frames, I want to encode 1,2,3 in one video, 4,5,6 in another video and rest in another video. How to achieve this without encoding each of them differently by us. (as that solution will not be scalable) How to change in the code while writing encoded frames into the video file?
How to make the write to happen into multiple video files.
and how to change the sequence of encoding i.e. after 1 how can I possibly encode 4,5 skipping 2,3 after 4,5 done then encode 2,3. How to do this?
-
Parsing x264 to LibAV in C
26 mai 2018, par Stephan PichFor a Project in School I have to encode and mux a Yuv File to mp4 using the Libav and lib x264 explicitly. I've already managed to encode the File to h264 using the libx264 but now i'm stuck muxing them into mp4.
I know that I've to write the NALU Packages into the file but I've no Idea how to turn the NALU to AVFrame or AVPacket.
Thanks for your help in advance.