As you can see the in the above image, the end part of the .wav file is not represented in the mp3 file. Here, I am making use of avcodec_decode_audio4() api to decode each packet, and using lame_encode_buffer() api to encode it in mp3 format. Here, I am seeing this issue for MONO streams( 1.wav -> 1.mp3 ). I just wanted to know why is this occuring, even when I am providing all the .wav file content. I am suspecting there is some caching that is happening, due to which I am unable to get whole data into the mp3 file. Any help here would be appreciated.
Add a section of silence at the end of the WAV file then reconvert to mp3
Related
Anyone know if ffprobe is safe to use as a method to check the content of a video? I want to determine if someone renames an exe to mp4 or some other video mime and I run ffprobe on it, would the file execute or fail safely without executing the content?
ffprobe should not execute content unless DirectDraw filter would do it itself (which is rather weird thing to think of).
Yet, AFAIK, ffprobe doesnt't produce nice MIME information, especially for not-multimedia-files. format_name/format_long_name are not very good.
For what you're looking for, the best approach is content sniffing described at https://mimesniff.spec.whatwg.org/
I have found that link in this SO question: MIME type for transcoded stream
To create a video from a powerpoint presentation I can use for example
ppFile.CreateVideo fileName, false, 1, 793, 2, 100
How can I define the format of the output file.
Obviously I can call the fileName foo.mp4 or foo.wav but I have my doubts that this really changes the way the video is encoded as apposed to just changing the suffix of the file.
What is the default encoding method and how can one select a different encoding method?
Thanks
The output is WMV, if you want a different format you must convert using a transcoding utility, for example the ffmpeg command line tool.
I'm writing a C program that uses the ffmpeg's libav* libs, and using Dranger's tutorial, I can decode both audio and video correctly. Currently, I'm trying to extract subtitles. I actually don't want to decode them on time and display them on the video, but actually extract the subtitle text out of the container.
For example, on the cli,
ffmpeg -i video.mkv -map 0:4 -scodec copy out.ass
would give me the ass file back. (For some reason, srts only return the text.)
I've tried messing with AVSubtitle, avcodec_decode_subtitle2, etc., but they're returning the subtitles line by line. I would like the timecodes in srts, header information in ass, etc. All I want is the entire subtitle text file that was muxed into the container.
In the case of .mkv files, you could use mkvextract. You may need to use mkvinfo first to identify which track you want to extract.
Since you want to do this from your own C program, you would probably want to use the Matroska libraries instead of the command line tools.
Is there any direct command in FFmpeg to merge videos in iPhone. I need to do this programmatically by setting the command line argument to the FFmpeg containing the input movie files to merge and the output file name.
I just wanted to merge two .mov movie files using FFmpeg. I was trying to do this in iPhone where I was creating a command line argument containing two video fies to merge as an input parameter and the destination video file as output parameter and then calling main method of FFmpeg. But for merging videos using FFmpeg first we need to convert it to mpg format and then pass the movie files in mpg format in the command line format. This is the only way found to merge the video using FFmpeg as far as I know. Is there anybody out there done this in a different way?
To paraphrase the FFmpeg FAQ entry "How can I join video files?"
Transcode to a format that supports direct concatenation (MPEG-1, MPEG-2 PS, DV) and then back to the desired format.
Use the concat protocol to get the same effect without the intermediate files.
Use named pipes to avoid the intermediate files.
Do any of the above with the lossless yuv4mpegpipe or raw formats.
Where can I find documentation/sample code of the VOBsub subtitles format? The one that's an .idx and a .sub file.
I need to create a program that generates those subtitles. I've been looking on Google but only found how to rip them from DVD.
Thanks
VOBsub extracts the DVD subtitles raw PES from a DVD and dumps this to a .sub file. It also creates a .idx Index file with the times and byteoffsets for each and every single subtitle. The format has support for multiple tracks and can also be embedded in MP4 (by Nero) and Matroska files.
Technical specs vobsub
Technical specs from Matroska.org
Example files: Specs_and_idx-sub_files.rar
Have a look at these open source implementations:
BDSup2Sub (Java)
Subtitle Edit (C#)
guliverkli by gabest (C++) check out VSFilter and VSRip; original implementation
Son2VobSub.rar (C++)
And then there are the media players like VLC. You can also check out these threads on doom9:
http://forum.doom9.org/archive/index.php/t-87171.html
http://forum.doom9.org/archive/index.php/t-99815.html
I think your best approach would be to have a look at the sourcecode of some of the open-source media players. Some of them will have the code to interpret an .idx or .sub subtitle file.
This might be a useful starting point:
http://sourceforge.net/projects/guliverkli/