[FFmpeg-user] Syntax request for -vf to copy /pass through video stream
David Favor
david at davidfavor.com
Thu Oct 31 19:24:51 CET 2013
Stefano Sabatini wrote:
> On date Thursday 2013-10-31 12:47:40 -0500, David Favor wrote:
>> Stefano Sabatini wrote:
>>> On date Thursday 2013-10-31 12:31:59 -0500, David Favor wrote:
>>>> Stefano Sabatini wrote:
>>>>> On date Thursday 2013-10-31 12:20:26 -0500, David Favor wrote:
>>>>> [...]
>>>>>> + ffmpeg -y -i broken.mp4 -c:a copy -vf copy -vf setdar=dar=0 -vf setsar=sar=0 -t 10 vfcopy.mp4
>>>>> This command is broken in several ways, first you can't copy and
>>>>> filter at the same time, and multiple -vf a -vf b -vf c have the
>>>>> effect of the last -vf command (in this case -vf c).
>>>>>
>>>>> Please understand the meaning of the syntax and that you *CAN'T* copy
>>>>> a stream and filter it at the same time.
>>>> So -v:c copy and -vf copy are effectively the same.
>>> No, you're mixing two different things (and "-v:c" should be "-c:v"),
>>> bitstream copy (to copy a stream from input to output stream with no
>>> decoding and encoding) and copying data at the filtering level
>>> (working with a decoded video stream).
>> According to http://ffmpeg.org/ffmpeg.html there is only -c:v (codec video).
>> There is no -v:c... so this is correct...
>>
>> ffmpeg -y -i broken.mp4 -c:v copy -c:a copy -t 10 foo.mp4
>>
>> and this is incorrect...
>>
>
>> ffmpeg -y -i broken.mp4 -v:c copy -c:a copy -t 10 foo.mp4 (which produces...)
>> Invalid loglevel "copy". Possible levels are numbers or:
>> "quiet"
>> "panic"
>> "fatal"
>> "error"
>> "warning"
>> "info"
>> "verbose"
>> "debug"
>
> -v is an alias for -loglevel.
>
>>>> So there's no real way to copy (bit for bit) a video stream and
>>>> change SAR or DAR...
>>> There is the -aspect command if you want to bitstream-copy and change
>>> the aspect ratio in the output container.
>> Doing something like the following has no effect on SAR + DAR...
>>
>
>> ffmpeg -y -i broken.mp4 -c:a copy -c:v copy -aspect 16:9 -t 10 foo.mp4
>>
>> [SAR 64757:64800 DAR 319:180] is same in both input + output video, so
>> container aspect ratio [SAR] has not been effected.
>
> Show the commandline output.
Ah... this did appear to work... as
[SAR 64757:64800 DAR 319:180]
has now changed to...
[SAR 406:405 DAR 16:9]
And video now plays @ 16:9 instead of 4:3...
Thanks!
_______
David-Favor-iMac# ffmpeg -y -i broken.mp4 -c:a copy -c:v copy -aspect 16:9 -t 10 foo.mp4
ffmpeg version 2.1.0-2013-10-31-57660-g49287bb Copyright (c) 2000-2013 the FFmpeg developers
built on Oct 31 2013 08:52:34 with gcc 4.8.2 (MacPots gcc48 4.8.2_0)
configuration: --prefix=/david-favor-tools/osx-10.9 --enable-pic --enable-gpl --disable-debug --extra-cflags='-I
/david-favor-tools/osx-10.9/include -I /opt/local/include' --extra-ldflags='-Wl,-rpath,/david-favor-tools/osx-10.9/lib -Wl,-rpath,/opt/local/lib -L
/david-favor-tools/osx-10.9/lib -L /opt/local/lib' --enable-version3 --enable-shared --disable-static --enable-ffplay --enable-ffprobe
--enable-ffserver --enable-runtime-cpudetect --enable-nonfree --enable-zlib --enable-bzlib --enable-openssl --enable-libmp3lame --enable-libfaac
--enable-libvpx --enable-libtheora --enable-libvorbis --enable-libxvid --enable-libopus --enable-libopenjpeg --enable-libfreetype --enable-libx264
--enable-postproc --enable-frei0r --enable-libopencore-amrnb --enable-libmodplug --enable-libass --enable-openssl
libavutil 52. 48.100 / 52. 48.100
libavcodec 55. 39.100 / 55. 39.100
libavformat 55. 19.104 / 55. 19.104
libavdevice 55. 5.100 / 55. 5.100
libavfilter 3. 90.100 / 3. 90.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'broken.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : muxer
Duration: 00:42:19.96, start: 0.000000, bitrate: 938 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x406 [SAR 64757:64800 DAR 319:180], 810 kb/s, 23.98 fps, 23.98 tbr, 23976
tbn, 47.95 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 122 kb/s (default)
Metadata:
handler_name : SoundHandler
Overriding aspect ratio with stream copy may produce invalid files
Output #0, mp4, to 'foo.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.19.104
Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 720x406 [SAR 406:405 DAR 16:9], q=2-31, 810 kb/s, 23.98 fps, 23976 tbn, 23976
tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 122 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 242 fps=0.0 q=-1.0 Lsize= 1482kB time=00:00:10.00 bitrate=1213.6kbits/s
video:1307kB audio:167kB subtitle:0 global headers:0kB muxing overhead 0.547662%
--
Love Living Well Doing What You Love?
http://DavidFavor.com/books can help!
More information about the ffmpeg-user
mailing list