
Recherche avancée
Autres articles (13)
-
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
Déploiements possibles
31 janvier 2010, parDeux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
Version mono serveur
La version mono serveur consiste à n’utiliser qu’une (...) -
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
Sur d’autres sites (4031)
-
FFmpeg android images to movie - error while opening encoder [duplicate]
12 juin 2018, par trinadh thatakulaThis question already has an answer here :
I have been working on android-ffmpeg to convert images into videos and I have found the code I was looking(links below) and I have tried to execute this command
val cmd5 = arrayOf("-analyzeduration", "1M", "-probesize", "1M", "-y", "-framerate", "1/3.79", "-i", Utils.outputPath + "image%d.jpg", "-i", audio!!.path, "-c:v", "libx264", "-tune", "stillimage", "-c:a", "aac", "-strict", "experimental", "-b:a", "192k", "-pix_fmt", "yuv420p", "-shortest", outputLocation.path)
and I got error saying
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
can any1 please help me
I have taken code from here -> KotlinFFmpeg and the code snippet is from here -> MovieMaker.kt, please give me a solution, thanks in advance
here are the logs
2018-06-12 18:22:24.000 25364-25664/photo.video.maker D/FFmpeg: Running publishing updates method
2018-06-12 18:22:24.096 25364-25364/photo.video.maker W/System.err: java.io.IOException: ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: built with gcc 4.8 (GCC)
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: libavutil 55. 17.103 / 55. 17.103
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: libavcodec 57. 24.102 / 57. 24.102
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: libavformat 57. 25.100 / 57. 25.100
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: libavdevice 57. 0.101 / 57. 0.101
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: libavfilter 6. 31.100 / 6. 31.100
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: libswscale 4. 0.100 / 4. 0.100
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: libswresample 2. 0.101 / 2. 0.101
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: libpostproc 54. 0.100 / 54. 0.100
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: [mjpeg @ 0xf193d000] Changing bps to 8
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: Input #0, image2, from '/storage/emulated/0/Photo Video Maker/image%d.jpg':
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: Duration: 00:02:35.39, start: 0.000000, bitrate: N/A
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1440x1919 [SAR 1:1 DAR 1440:1919], 0.26 tbr, 0.26 tbn, 0.26 tbc
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: [mp3 @ 0xf192d600] Skipping 0 bytes of junk at 61264.
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: [mjpeg @ 0xf193dc00] Changing bps to 8
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: Input #1, mp3, from '/data/user/0/photo.video.maker/files/audio2.mp3':
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: Metadata:
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: album_artist : Various Artists
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: AccurateRipDiscID: 018-002fb7fe-0279b2d7-47111512-2
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: AccurateRipResult: AccurateRip: Accurate (confidence 10) [0A38F342]
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: title : Morning
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: encoded_by : dBpoweramp Release 14.4
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: publisher : EMI Classics
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: composer : Edvard Grieg
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: TMED : CD (Lossless)
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: genre : Classical
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: compilation : 1
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: album : The Most Relaxing Classical Album in the World...Ever!
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: track : 2/18
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: disc : 1/2
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: artist : Edvard Grieg
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: Encoder : Lame 3.99.5
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: UPC : 024356665027
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: date : 1999
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: Duration: 00:04:18.04, start: 0.025056, bitrate: 321 kb/s
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: Stream #1:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: Metadata:
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: encoder : LAME3.99r
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: Stream #1:1: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 747x750 [SAR 1:1 DAR 249:250], 90k tbr, 90k tbn, 90k tbc
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: Metadata:
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: comment : Cover (front)
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: [swscaler @ 0xf1125000] deprecated pixel format used, make sure you did set range correctly
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: [libx264 @ 0xf193ec00] height not divisible by 2 (1440x1919)
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: Output #0, mp4, to '/storage/emulated/0/Photo Video Maker/video/movie_1528807939616.mp4':
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: Stream #0:0: Video: h264, none, q=2-31, 128 kb/s, SAR 1:1 DAR 0:0, 0.26 fps
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: Metadata:
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: encoder : Lavc57.24.102 libx264
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: Stream #0:1: Audio: aac, 0 channels, 128 kb/s
2018-06-12 18:22:24.097 25364-25364/photo.video.maker W/System.err: Metadata:
2018-06-12 18:22:24.098 25364-25364/photo.video.maker W/System.err: encoder : Lavc57.24.102 aac
2018-06-12 18:22:24.098 25364-25364/photo.video.maker W/System.err: Stream mapping:
2018-06-12 18:22:24.098 25364-25364/photo.video.maker W/System.err: Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
2018-06-12 18:22:24.098 25364-25364/photo.video.maker W/System.err: Stream #1:0 -> #0:1 (mp3 (native) -> aac (native))
2018-06-12 18:22:24.098 25364-25364/photo.video.maker W/System.err: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
2018-06-12 18:22:24.098 25364-25364/photo.video.maker W/System.err: at photo.video.maker.tools.video.MovieMaker$convert$1.onFailure(MovieMaker.kt:78)
2018-06-12 18:22:24.098 25364-25364/photo.video.maker W/System.err: at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.onPostExecute(FFmpegExecuteAsyncTask.java:70)
2018-06-12 18:22:24.098 25364-25364/photo.video.maker W/System.err: at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.onPostExecute(FFmpegExecuteAsyncTask.java:10)
2018-06-12 18:22:24.098 25364-25364/photo.video.maker W/System.err: at android.os.AsyncTask.finish(AsyncTask.java:695)
2018-06-12 18:22:24.098 25364-25364/photo.video.maker W/System.err: at android.os.AsyncTask.-wrap1(Unknown Source:0)
2018-06-12 18:22:24.098 25364-25364/photo.video.maker W/System.err: at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712)
2018-06-12 18:22:24.098 25364-25364/photo.video.maker W/System.err: at android.os.Handler.dispatchMessage(Handler.java:106)
2018-06-12 18:22:24.098 25364-25364/photo.video.maker W/System.err: at android.os.Looper.loop(Looper.java:164)
2018-06-12 18:22:24.098 25364-25364/photo.video.maker W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6494)
2018-06-12 18:22:24.098 25364-25364/photo.video.maker W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2018-06-12 18:22:24.098 25364-25364/photo.video.maker W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
2018-06-12 18:22:24.098 25364-25364/photo.video.maker W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) -
An introduction to reverse engineering
22 janvier 2011(This blog is still in hibernation, but I needed somewhere to post this)
Reverse engineering is one of those wonderful topics, covering everything from simple "guess how this program works" problem solving, to poking at silicon with scanning electron microscopes. I’m always hugely fascinated by articles that walk through the steps involved in these types of activities, so I thought I’d contribute one back to the world.
In this case, I’m going to be looking at the export bundle format created by the Tandberg Content Server, a device for recording video conferences. The bundle is intended for moving recordings between Tandberg devices, but it’s also the easiest way to get all of the related assets for a recorded conference. Unfortunately, there’s no parser available to take the bundle files (.tcb) and output the component pieces. Well, that just won’t do.
For this type of reverse engineering, I basically want to learn enough about the TCB format to be able to parse out the individual files within it. The only tools I’ll need in this process are a hex editor, a notepad, and a way to convert between hex and decimal (the OS X calculator will do fine if you’re not the type to do it in your head).
Step 1 : Basic Research
After Googling around to see if this was a solved issue, I decided to dive into the format. I brought a sample bundle into my trusty hex editor (in this case Hex Fiend).A few things are immediately obvious. First, we see the first four bytes are the letters TCSB. Another quick visit to Google confirms this header type isn’t found elsewhere, and there’s essentially no discussion of it. Going a few bytes further, we see "contents.xml." And a few bytes after that, we see what looks like plaintext XML. This is a pretty good clue that the TCB file consists of a
. Let’s scan a bit further and see if we can confirm that.
In this segment, we see the end of the XML, and something that could be another filename - "dbtransfer" - followed by what looks like gibberish. That doesn’t help too much. Let’s keep looking.
Great - a .jpg ! Looking a bit further, we see the letters "JFIF," which is recognizable as part of a JPEG header. If you weren’t already familiar with that, a quick google for "jpg hex header" would clear up any confusion. So, we’ve got the basics of the file format down, but we’ll need a little bit more information if we’re going to write a parser.Step 2 : Finding the pattern
We can make an educated guess that a file like this has to provide a few hints to a decoder. We would either expect a table of contents, describing where in the bundle each individual file was located, some sort of stop bit marking the boundary between files, byte offsets describing the locations of files, or a listing of file lengths.There isn’t any sign of a table of contents. Let’s start looking for a stop bit, as that would make writing our parser really easy. Want I’m going to do is pull out all of the data between two prospective files, and I want two sets to compare.
I’ve placed asterisks to flag the bytes corresponding to the filenames, since those are known.1E D1 70 4C 25 06 36 4D 42 E9 65 6A 9F 5D 88 38 0A 00 *64 62 74 72 61 6E 73 66 65 72* 42 06 ED 48 0B 50 0A C4 14 D6 63 42 F2 BF E3 9D 20 29 00 00 00 00 00 00 DE E5 FD
01 0C 00 *63 6F 6E 74 65 6E 74 73 2E 78 6D 6C* 9E 0E FE D3 C9 3A 3A 85 F4 E4 22 FE D0 21 DC D7 53 03 00 00 00 00 00 00
The first line corresponds to the "dbtransfer" entry, the second to the "contents.xml" entry. Let’s trim the first entry to match the second.
38 0A 00 *64 62 74 72 61 6E 73 66 65 72* 42 06 ED 48 0B 50 0A C4 14 D6 63 42 F2 BF E3 9D 20 29 00 00 00 00 00 00
01 0C 00 *63 6F 6E 74 65 6E 74 73 2E 78 6D 6C* 9E 0E FE D3 C9 3A 3A 85 F4 E4 22 FE D0 21 DC D7 53 03 00 00 00 00 00 00
It looks like we’ve got three bytes before the filename, followed by 18 bytes, followed by six bytes of zero. Unfortunately, there’s no obvious pattern of bits which would correspond to a "break" between segments. However, looking at those first three bytes, we see a 0x0A, and a 0x0C, two small values in the same place. 10 and 12. Interesting - the 12 entry corresponds with "contents.xml" and the 10 entry corresponds with "dbtransfer". Could that byte describe the length of the filename ? Let’s look at our much longer JPG entry to be sure.
70 4A 00 *77 77 77 5C 73 6C 69 64 65 73 5C 64 37 30 64 35 34 63 66 2D 32 39 35 62 2D 34 31 34 63 2D 61 38 64 66 2D 32 66 37 32 64 66 33 30 31 31 35 65 5C 74 68 75 6D 62 6E 61 69 6C 73 5C 74 68 75 6D 62 6E 61 69 6C 30 30 2E 6A 70 67*
0x4A - 74, corresponding to a 74 character filename. Looks like we’re in business.
At this point, it’s worth an aside to talk about endianness. I happen to know that the Tandberg Content Server runs Windows on Intel, so I went into this with the assumption that the format was little-endian. However, if you’re not sure, it’s always worth looking at words backwards and forwards, just in case.
So we know how to find our filename. Now how do we find our file data ? Let’s go back to our JPEG. We know that JPEGs start with 0xFFD8FFE0, and a quick trip to Google also tells us that they end with 0xFFD9. We can use that to pull a sample jpeg out of our TCB, save it to disk, and confirm that we’re on the right track.
This is one of those great steps in reverse engineering - concrete proof that you’re on the right track. Everything seems to go quicker from this point on.
So, we know we’ve got a JPEG file in a continuous 2177 byte segment. We know that the format used byte lengths to describe filenames - maybe it also uses byte lengths to describe file lengths. Let’s look for 2177, or 0x8108, near our JPEG.
Well, that’s a good sign. But, it could be coincidental, so at this point we’d want to check a few other files to be sure. In fact, looking further in some file, we find some larger .mp4 files which don’t quite match our guess. It turns out that file length is a 32bit value, not a 16bit value - with our two jpegs, the larger bytes just happened to be zeros.
Step 3 : Writing a parser
"Bbbbbut...", I hear you say ! "You have all these chunks of data you don’t understand !"
True enough, but all I care about is getting the files out, with the proper names. I don’t care about creation dates, file permissions, or any of the other crud that this file format likely contains.
Let’s look at the first two files in this bundle. A little bit of byte counting shows us the pattern that we can follow. We’ll treat the first file as a special case. After that, we seek 16 bytes from the end of file data to find the filename length (2 bytes), then we’re at the filename, then we seek 16 bytes to find the file length (4 bytes) and seek another 4 bytes to find the start of the file data. Rinse, repeat.
I wrote a quick parser in PHP, since the eventual use for this information is part of a larger PHP-based application, but any language with basic raw file handling would work just as well.
tcsParser.txt
This was about the simplest possible type of reverse engineering - we had known data in an unknown format, without any compression or encryption. It only gets harder from here... -
Q&A : An interview with Matomo founder, Matthieu Aubry