FFmpeg/libavcodec failing for asv1 conversion using PHPVideoToolkit - ffmpeg

It seems that I can not get libavcodec running with my install of ffmpeg. I say 'it seems' because the searching I have done based on the following error message has gotten me to that point:
PHPVideoToolkit Error: Execute error. Output for file "/home/clrock/public_html/drupal-7.14/sites/default/files/img/videos/original/StoryboardMovie.mp4" was found, but the file contained no data. Please check the available codecs compiled with FFmpeg can support this type of conversion. You can check the encode decode availability by inspecting the output array from PHPVideoToolkit::getFFmpegInfo().
The ffmpeg command is
/usr/local/bin/ffmpeg \
-i '/home/clrock/public_html/drupal-7.14/sites/default/files/img/videos/original/StoryboardMovie.mp4' \
-strict experimental -vcodec 'asv1' -s '640x480' -acodec 'aac' -ac '2' \
/tmp/1343067407-500d950fbd290.3gp
I can not seem to find out how to get ffmpeg to configure with libavcodec. It seems all of the necessary files are there in /usr/src/ffmpeg-0.7.12/libavcodec.
ffmpeg can make mp4 and flv files fine, only when using asv1 does it hang up.

I only needed to change the ouput settings. For webm:
vcodec=libvpx acodec=vorbis
Form Mp4
vcodec=libx264 acodec=libmp3lame
With Mp4, I couldn't use the libx264-hq preset as something was missing. I'm not sure what, but it's good to know I don't need it.
Thanks.

Related

Using ffmpeg to convert an SEC file

I need to convert an SEC file into any video format that I can share and/or upload to Youtube. MP4, etc.
I'm a complete newbie at all things terminal. I've tried:
ffmpeg -i video.sec video.mp4
ffmpeg -i video.sec -bsf:v h264_mp4toannexb -c:v copy video.avi
ffmpeg -i video.sec -b 256k -vcodec h264 -acodec aac video.mp4
I don't understand what any of these mean, they're just examples I found online. However, whatever I try returns this error:
Invalid data found when processing input
Any thoughts? Thanks!
I had to add the following option so it would skip the SEC's custom header.
-skip_initial_bytes 48
i know this is old, but i was trying to figure this out as well, what ended up finally working for me was this command.
./ffmpeg -f h264 -i INPUT.sec -filter:v "setpts=4*PTS" OUTPUT.avi
the -f h264 was the part i was missing. and the -filter:v "setpts=4*PTS" part is to slow it back down to the original speed. you can also change the .avi at the end to whichever format works best for you.
i hope this helps someone out :)
OK, just to clear up some recent threads…
The Samsung DVR used here was an SRD-440. RB kindly sent me a file to test and he sent me a .BU file with an associated .db2 file. This was a bit of a surprise as in all older Samsung DVR’s, the .bu files can only be played back in the DVR. I mentioned this here, https://spreadys.wordpress.com/2014/07/21/ifsec-samsung-exports/
It appears that Samsung have caught on, and the BU file is now playable due to it being a H264/AVC Stream conforming to a standard profile. I have updated the IFSEC Post mentioned above to highlight this change.
Back to RB’s stream and the challenge was to get these files viewable in WMV format. They were all field based, at 704×288.
The speed of playback is controlled by the Samsung software, using the .db2 file. As such, the metadata and timing information in the video stream was wrong. This caused speed issues and then quality issues when attempting to correct this.
As a result, I found it necessary to force an input rate and generate a new Presentation Time Stamp BEFORE the input file.
The following FFmpeg string did the job…
ffmpeg -r 12 -fflags genpts -i FILE.bu -vf scale=704:528 -sws_flags lanczos -q:v 2 FILE.wmv
Remember, this is for preview – analysis would be completed differently due to the scaling, the interpolation method, and the WMV compression!
As its likely that RB may have quite a few .bu files in a folder, I placed this into a batch file to transcode the whole lot within a few minutes… more on batch files coming in a new post soon!
https://spreadys.wordpress.com/2014/07/21/ifsec-samsung-exports/
or
ffmpeg -i (name of file).sec (name of final file).mp4
ffmpeg -i (name of file).sec -filter:v "setpts=3.3*PTS" (name of final_file).mp4

Stretching WAV audio file with rubberband in fffmpeg causes invalid audio format

Having an issue here using ffmpeg's add-on Rubberband. When I try to stretch a WAV audio file with a given ratio, the WAV file is generated fine but then, when I want to parse its header, I can see an invalid audio format.
'Unknwon format: 22127'
Have reported this issue on this GitHub tracker. All details are there:
https://github.com/rackfx/Node-WAV-File-Info/issues/11
But now I am very unsure and wonder if it's not a Rubberband bug? Or am I missing something in the ffmpeg command to ensure correct audio format is set?
That's the ffmpeg command I used to generate that stretched WAV file with the invalid audio format (using ffmpeg v3.0.2 here)
ffmpeg -thread_queue_size 2048 -i /home/michael-heuberger/binarykitchen/code/videomail.io/var/local/tmp/clients/videomail.io/11e6-aebd-f5430180-84c7-074d5706928b/videomail_preview.wav -y -acodec libvorbis -ac 1 -filter:a rubberband=tempo=1.454366279637038 -loglevel warning /home/michael-heuberger/binarykitchen/code/videomail.io/var/local/tmp/clients/videomail.io/11e6-aebd-f5430180-84c7-074d5706928b/videomail_preview_for_webm_stretched.wav
Any clues?
Remove -c:a libvorbis. ffmpeg will then automatically choose a common and compatible audio format for WAV.

How to get a lossless encoding with ffmpeg - libx265

I would like to convert 16 bits grayscale images in an HEVC/mkv video with the x265 encoder without loss, using ffmpeg. I use the monochrome12 profile. My first step is to convert images into yuv format:
ffmpeg -f image2 -i "C:\DATA FOLDER\images%d.png" video.yuv
And I try to convert it as a .mkv file, losslessly:
ffmpeg video.yuv video.mkv -c:v libx265 -x265-params "profile=monochrome12:crf=0:lossless=1:preset=veryslow:qp=0"
But I get
Unrecognized option '-lossless'
Error splitting the argument list : Option not found
When I don't write lossless=1 everything's right, but I don't manage to have a lossless video by this way.
thank you for your help.
It works for me if I make a few changes:
ffmpeg -i video.avi -c:v libx265 \
-x265-params "profile=monochrome12:crf=0:lossless=1:preset=veryslow:qp=0" \
video.mkv
This is like the command you've provided, except I'm using a different input format, and prepend -i to mark it as an input file.
I also put the output filename at the end, after the output options, otherwise they are not applied, and I get this warning among the output:
Trailing options were found on the commandline.
I don't think the command you gave would cause the error you get though.
libx265 will not give an error on params it doesn't recognise, but show a warning like:
[libx265 # 0x563e4520e740] Unknown option: lessloss.
I can reproduce your exact error by trying to add --lossless as a parameter to ffmpeg:
ffmpeg --lossless -i video.avi video.mkv
Unrecognized option '-lossless'.
Error splitting the argument list: Option not found

FFMPEG says "No such file or directory" when trying to convert image sequence

From the shell, when I specify a sequence of images via %d in the input filename, FFMPEG insists "No such file or directory", despite evidence to the contrary. Looking online, I haven't managed to find any references to generating video from a sequence of images using FFMPEG where %d is not used, yet it seems to fail here.
My images should be identified by FFMPEG from img%06d.gif. Issuing ls img[0-9][0-9][0-9][0-9][0-9][0-9].gif succeeds in the very same directory I issue the FFMPEG command.
The command I use is:
ffmpeg -i img%06d.gif -c:v libx264 -r 30 -pix_fmt yuv720p test.mp4
What could possibly be going wrong???
The following definitely works:
ffmpeg -i images%06d.png -c:v libx264 -r 30 test.mp4 -y
However it doesn't work with GIF pictures.
You can losslessly convert your pictures to PNG and run the above command line.

ffmpeg -r option

I am trying to use ffmpeg (under linux) to add a small title to a video. So, I use:
ffmpeg -i hk.avi -r 30000/1001 -metadata title="SOF" hk_titled.avi
The addition of title seems to work, but, the problem is the output file is about a 1/3rd of the file size of the input file and I was wondering why this is? Is this at the expense of quality of the video? I am unsure.. How do I preserve the same quality/size as the input file?
The main point I am unable to figure out is the use of -r option. Going through the ffmpeg docs, it seems to suggest that -r is frames per second (The input video is 23.9fps). At the moment, (30000/1001) works out to 29 fps, but I was unsure if I should be using this value.
Thanks for your time.
The default settings for ffmpeg do not always provide a good quality output when you encode, but this depends on your output format and the available encoders. With your output ffmpeg will use the default of -b 200k or -b:v 200k.
However, you can tell ffmpeg to simply copy the input streams without re-encoding and this is recommended if you just want to add or edit metadata. These examples do the same thing but use different syntax depending on your ffmpeg version:
ffmpeg -i hk.avi -vcodec copy -acodec copy -metadata title="SOF" hk_titled.avi
ffmpeg -i hk.avi -c copy -metadata title="SOF" hk_titled.avi

Resources